Azureus PHP Control Interface ============================= by Iain "Strawp" Wallace http://www.strawp.net/azureus_php About ----- These scripts are designed to create a works-in-anything web interface for Azureus. You could use it in the same way that you use the Swing interface or ('cos it works in Lynx) a slightly nicer console window interface than the headless UI. I've designed this with Model, View, Controller (MVC) methodology in mind meaning the 3 layers stack together nicely and hook into the adjacent layer: Model The XML over HTTP plugin Controller The Azureus PHP control client class - azureus_xml_client.php View index.php and _action.php - simply hooks into the controller methods If you wanted to build your own interface, you could simply use the client class and run with that. Prequisits ---------- 1. PHP5 set up on a web service. 2. Azureus with the XML over HTTP plugin running 3. A pencil Installing ---------- 1. Make sure the XML over HTTP plugin is running in Azureus. If you're already using the Java interface then you're all set. 2. If you haven't got it set up already, install PHP5 somewhere running as a web service. I recommend Apache 2, but I see no reason it wouldn't work under IIS for example. 3. Create a folder on your server for these scripts where the service can run them. 4. If your server is open to an untrusted network you may want to set up an htaccess file to password protect this script. (see later for an e.g.) 5. Unpack all the files somewhere the web server can run them. 6. If you're not running this script on the same server or port that Azureus XML over HTTP runs on by default, edit the definition of "XML_URL" in includes/settings.php to the URL that the web service is running on. Note that running this script on a web server entirely separate from Azureus should work fine as long as the port that the XML over HTTP plugin is on is open between them. I've never tried it myself, however. 7. Go to whatever URL you've put them. Oooh, look at that. Shiny. 8. Using the pencil, point at the screen and say these words: "Mmm, scripty goodness". Short note on .htaccess files ----------------------------- Chances are you're setting this up so you can download torrents at home, but manage them from work, right? So you want to leave your server open to the internet but you don't want randoms logging on and uh... queuing torrents up for you (why would they do that?) so it's a good idea to password off your scripts folder. The easiest way I've seen on this is using an htaccess password generator like the one at http://thejackol.com/scripts/htpasswdgen.php If it's not working, make sure the location where your script is has the "AllowOverride" directive set to the required privileges, e.g. "All" for that folder in your Apache configuration files. You want to be looking for ... Changelog --------- ....-..-..: Stopped massive long file names making the table wide by replacing some characters with spaces Added "availability" column, shuffled other colums about a bit Added sortable tables (click on a table header) Added priority up/down buttons Added asyncronous javascript for updating the torrents list 2005-12-09: Small HTML changes to index.php Consolidated server settings into settings.php Added experimental multi-server administration Fixed javascript bug with clicking the labels of downloads 2005-11-15: Added Javascript UI tweaks Added optional authentication to connect to the XML interface Tweaked CSS Added HTTP authentication to XML interface class and changed default charset to UTF-8 (thanks, Denis) 2005-09-26: Added torrent upload ability, tweaked CSS, included Azureus version in the footer 2005-07-31: First release License ------- If you use this code, credit me either on the web page you're building it into or the documentation. Other than that you're free to use this for whatever purposes you desire! Credits ------- * parg for writing the XML over HTTP interface and giving me tips on how to use it. * Gouss for linking me up on the site. * Members of #azureus and #azureus-users for helping me get Azureus running in console mode. * Everyone that's sent feedback to me.