Need help with Chaturbate API coding.
Collapse
X
-
-
if you want just female set CATEGORY to female
define ( 'CATEGORY', 'all' ); // What category do you want to show ( all , male, female, tranny)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Links
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
switch ( CATEGORY ) {
case 'all':
$category_string = '&categories[]=female&categories[]=male&categories[]=transsexual';
break;
case 'female':
$category_string = '&categories[]=female';
break;
case 'male':
$category_string = '&categories[]=male';
break;
case 'tranny':
$category_string = '&categories[]=transsexual';
break;
}
define ( 'XML_FILE', 'http://tools.bongacams.com/promo.php?c=226355&type=api&api_type=xml' . $category_string );Comment
-
-
Are you sure the feed is being fetched? If so, make sure that your server can write to the includes/data/feed.xml fileComment
-
@adulttemps
yes its work includes/data/feed.xml file
working
cams/tranny
not working
cams/male
cams/female
cams/couple
cams/lesbian
you working all category? please test and tell meComment
-
define ( 'CATEGORY', 'all' ); // What category do you want to show ( all , male, female, tranny)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Links
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
switch ( CATEGORY ) {
case 'all':
$category_string = '&categories[]=female&categories[]=male&categories[]=transsexual';
break;
case 'female':
$category_string = '&categories[]=female';
break;
case 'male':
$category_string = '&categories[]=male';
break;
case 'tranny':
$category_string = '&categories[]=transsexual';
break;
}
define ( 'XML_FILE', 'You are only allowed to post URLs to other sites after you have made 30 posts or more.' . $category_string );Comment
-
Did anyone notice that there are no males and shemales cams in bonga xml??I just checked and only females and couples are included.Anyway,back to CB api.
I tried to get cams by category,so i defined categories
From what i can understand,existing functions,print cams by gender,so i copied get_related function,modified name and changed every $gender with $age.My new function :Code:if( $cam->age <= "21" ) { $age= "teen"; } elseif ($cam->age > "21" && $age <= "30" ){ $age= "women"; } elseif ($cam->age > "30" && $age <= "40" ) { $age = "milf"; } elseif ($cam->age > "40" ) { $age = "mature"; } else { $age = ""; }
Call function in template file :Code:function cams_by_category( $affid, $track, $age, $limit ){ if( $cam->age <= "21" ) { $age= "teen"; } elseif ($cam->age > "21" && $age <= "30" ){ $age= "women"; } elseif ($cam->age > "30" && $age <= "40" ) { $age = "milf"; } elseif ($cam->age > "40" ) { $age = "mature"; } else { $age = ""; } if ( $_GET['arg1'] ) { if ( is_numeric( $_GET['arg1'] ) ) { $page = $_GET['arg1']; $targetpage = 'live/'; } else { $targetpage = 'live/' . $_GET['arg1'] . '/'; if ( $_GET['arg2'] ) { if ( is_numeric( $_GET['arg2'] ) ) { $page = $_GET['arg2']; } } else { $page = 1; } } } else { $targetpage = 'live/'; $page = 1; } $end = $page * $limit; $start = $end - $limit; $xml = '../cache/cams.xml'; $cams = new SimpleXMLElement($xml, null, true); // Count the total cams if ( $age != '' ) { $doc = new DOMDocument(); $doc->load($xml); $totalCams = 0; foreach( $doc->getElementsByTagName('age') as $tag ) { // to iterate the children foreach( $tag->childNodes as $child ) { // outputs the xml of the child nodes. Of course, there are any number of // things that you could do instead! $i = $doc->saveXML($child); if ($i == $age ) $totalCams++; } } } else { $totalCams = count($cams); } echo ' <div class="row"> <div class="12u"> <ul class="cb_thumbs"> '; $count = 0; foreach( $cams as $cam ){ if ( $cam->age == $age ) { if ( $count >= $start && $count < $end ) { print_cams($cam); } $count++; } if ( $age == '' ) { if ( $count >= $start && $count < $end ) { print_cams($cam); } $count++; } } echo ' </ul> </div> </div> '; }
Added in new page in index.php :Code:function tpl_category_cams() { $age = $_GET['arg1']; cams_by_category( AFFID, TRACK, $age, 60 );
Result: ALL CAMS,All agesCode:$core->addCommand('live', 'tpl_category_cams', 'title','', 'Keywords');
At least i get something
Comment
-
-
keen, I will work on an age based query this evening. It shouldnt't be that hardComment
-
I think you are trying to load the XML file from outside the US ? Look in your XML file and you will see, that the gender of each cam ist not declared like in the template.php.
I don't see any code for multi languages in the template.php
The simple 2 ways to fix that is:
A) Change the XML url in settings.php - You have to ad the "&lang=en" likte that:
define ( 'XML_FILE', 'http://tools.bongacams.com/promo.php?c=123456&lang=en&type=api&api_type=xml' . $category_string );
B) Define/update gender for each language in template.php.CamSoda invite link - promote an unsatisfied cam site!Comment
-
-
Thanks man,really appreciated
@saimonyz
I dont have the option to upload files.But you can take a look here https://github.com/hillipino/Chaturbate-API.It's the same script, i use the outdated version,the one from NMIP.
Functions are the same.
Comment
-
@k33n ok
@TitanWM
thanks It works category not working Male, one does not understand what needs to be changed in template.php and why in my lang=en&type=api&api_type=xml no <gender>Male</gender>
[HIDE=1]
can anyone be able to realize what site is JSON script
bonga-cams(dot)ru
bonga-cams(dot)ru/temp/
bonga-cams(dot)ru/footer_seo.js
bonga-cams(dot)ru/footer-links.js
bonga-cams(dot)ru/header-links.js
bonga-cams(dot)ru/top_model.js
bonga-cams(dot)ru/top-menu.js
[/HIDE]Comment


Comment