View Single Post
Old Apr 6th, 2008, 12:48 AM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 730
Rep Power: 4 Dameon is on a distinguished road
Re: Dreamhost Jabber Mannagement Script

There's a lot you need to ask yourself before you move forward.

What kind of tasks are you trying to automate?
What server software does dreamhost use?
What XMPP (the new, official name for Jabber) extensions does said software support?
Do you have access to the server running the software besides the web interface?

Web interfaces change. DreamHost has no reason to notify you before they update it. Sometimes it's the best solution, but automating an interface meant for human use is innately hackish.

Depending on what you need to do and what kind of software DeamHost is using, the cleanest way may be through XMPP itself. It's incredibly extensible. A quick search brought up this extension. The server software may support administrative commands via the more general 'ad-hoc command' extension (which in turn utilizes the very nifty 'data forms' extension). The point is, you may be able to log in with a reasonably full featured client (for example Psi, not Pidgin), list the services advertised by your server (in the same way you can for other servers or clients), and open the command interface.

I don't know how DreamHost does things as far as XMPP. I'm fairly sure you have one of the just add water hosting plans as opposed to a virtual or dedicated server, but for informational purposes I'll put another solution on the table. On such a server, it would make sense to log in via SSH and issue commands that way. Most any daemon will have a decent command line interface. You'd want to set up a key pair for the PHP utility rather than storing your password. PHP has an SSH extension that would do the trick. Good to know, but likely doesn't apply to you.

If you have no choice but to do it the hackish way, your first step is to gather data on how the web interface works. I suggest installing the FireBug extension for Firefox. You can easily spy on data in and out. I've never used CURL with PHP. You'll need to consult the documentation. The comments on php.net usually provide useful example code.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote