Quote:
Originally Posted by Paz
Just building one now on what was a hosted tube site. I don't know where I found the script but it uses the Chaturbate API and you just do a "for each where cam='male'. It's taken two days to get the url rewrites & pagination working properly. The other problem is that a 2 meg XML feed is a bloody inefficient way to capture and process online cams, and that the individual cams are in an iframe but it's work in progress and I'm having fun too.
|
I have 2 ideas for the feed - Just downloading and caching it with a cron job every few minutes works well - Then use the XML locally - Or writing it to a database that would keep all performer details and update them to being on/offline...
I have been working with the downloaded XML file and it works well so I might stick with that.....
PHP Code:
<?php
$cacheName = 'chatcache.xml';
$ageInSeconds = 60;
if(!file_exists($cacheName) || filemtime($cacheName) > time() + $ageInSeconds);
{
$contents = file_get_contents('http://chaturbate.com/affiliates/api/onlinerooms/?format=xml&wm=isCir');
file_put_contents($cacheName, $contents);
}
?>
This is what I have been using to generate the cache file - EdgeProd will probably say it's crap code - It works though

...