I don’t know if I’ll ever post this “live” but here is the new Azureus XML (Azureus_Stats.xml) processing script that I hacked together. Took me awhile since I couldn’t get my hosting company to add any sort of XML support to the server config. But here we go, using DOMXML EXSLT transformations and caching using the OB (output buffer). I haven’t seen very many people do this for obvious reasons. Most are no doubt afraid to reveal the consumption of copyrighted material (though proving the infringement bit will be hard without an actual log and given the intermittent updates). And those that would be bold enough to put up this sort of in your face statistics probably don’t care enough about it anyway. But I used to think it would be cool feature. Now, I’m not so sure.
The real remaining obstacle was to get a suitable uploading solution going. I was running a win32 version of cURL that uploaded the Azureus_Stats.xml file via FTP. And I had removed the scheduling while the XML processing and transformation functions were down. So it was essentially a manual task. Scheduled HTTP uploading seemed a lot leaner. So what I did was to set up a PHP script that accepts PUT via stdin. Essentially the default example that you can get from the PHP manual on PUT (”Saving HTTP PUT files with PHP 4″).
Then I installed nnCron LITE again. nnCron is a Windows clone of a well-known UNIX scheduler Cron and can run as a service, silently processing a cron.tab file in its installation directory. A file by the way that pleasantly enough follows the format of its UNIX predecessor to the letter. I also figured out how to run the scheduled programs hidden from view.
The actual uploading is still done using cURL and a syntax, including cron and all something like this:[code]0 */3 * * * ~curl.exe -T C:\Azureus_Stats.xml http://server/put.php[/code]One could of course set up some sort of authentication as well, but this will do for now.
And now that I’m running nnCron as a service anyway, I should look into scrapping Getright and its bloated daily downloads for mysql backups and move it to a “nncron/curl” solution. It makes sense. And why not scrap Feedreader as well and download the backup rss using nncron/curl? As long as I can ensure that all those scheduled tasks are truly run silently and wont pop up in the middle of a home cinema session it shouldn’t be a problem.
Contact
Lifestream



