Im suprised noone has commented on this:
QUOTE(Darklord @ May 23 2006, 18:03)
As the webserver as it was couldnt serve XML, i made the necessary changes (an ugly and imcomplete hack, the webserver needs serious refactoring); when done, it hit me with the new possibilities of this new interface:
- possibility of any XML aware program being able to monitor and control emulePlus easily; this includes IM programs, IRC programs, scripts, whatever...
I think this is a very useful feature. To give a better ideia, i implemented another prototype, this time a Yahoo Widget, that can monitor eMulePlus through the XML interface.
You can get it
here. It needs a new executable, that has the xml login implemented, which you can get
here.
Implementation NotesI needed another, webserver non-related, way to test the XML interface, to show issues with it that couldnt appear working only on the webserver.
Like i refered on the first post, a lot of possibilities exist, but i wanted to try working on another cool thing; the widgets are promissing and popular, so i decided to try to build a widget that could do the same as the prototype for the webserver client.
Got the documentation and gave it a quick study; the widgets are javascript and xml, so it was easy to get it.
Looking through the widget gallery, i found an already existing widget,
Emule Stats, that did all that i intended, only getting the info from the online sig (doesnt work with eMulePlus, because of diferences in location and format).
I looked through the code (its a small widget), added and changed what was needed; even reused some of the code on the template
One of the issues i talked about that i had already identified was the login, a way was needed to send the session id to the application, so that it could use it in the other requests; it isnt needed with the browser, as it already has one, but essencial for other applications.
I refactored the code of the webserver, moving the login procedure out of the processUrl() method and into one of its own. Then i added the rest of the code, to implement a request for login in the xml channel.
The request is this:
CODE
http://[webserver url]/?channel=xml&request=doLogin&p=[webserver password]
Given the way that the webserver can process both GET and POST http methods in the same way, the above GET method works. However, its recomended that a POST is used in this case (as its implemented in the widget).
The widget just uses the getStats request, same as the template as it is today.
Widget instructionsTo use the widget, you need the
Yahoo Widget Engine.
After each launch, the preferences window appears; configure the webserver url and password fields correctly.
After, it will try to connect to the webserver, if a problem with the connection occurs, an alert dialog box will appear. If such happens, you will need to restart the widget, as i didnt include a login button

This is just a prototype to show the possibilities i talked about; later i intent to add more functionality as it is implemented in the webserver.