wtorek, 12 lutego 2008

[EN] Jabber extension for modrapi - rapidshare download manager for linux

Most of you know what XMPP is
(jabber communication protocol).

Most of you are using jabber clients
to communicate with friends also.

Me 2!

I am using Pidgin as my client.
Becouse of that - ive created in perl a little script that emulate modrapi interface as jabber user.

It looks a liitle bit like this:

(19:05:27) m0d@mydomain.com:
yo

(19:05:27) snake: Hi m0d!
If you want to talk with me - enter valid password :

(19:05:36) m0d@mydomain.com:
TOPSECRETPASSWORD

(19:05:36) snake:
Now i remember you - m0d!

What do you want to do now?
Options:
bye - Logout
modrapi - Manage modrapi

(19:07:03) m0d@mydomain.com:
modrapi

(19:07:03) snake:
modrapi options:
help - Display this menu
bye - Logout
main - Return to main menu
add - Add rapidshare links
import - Import rapidshare links from web
status - Check modrapi status
db - Check queue
storage - Check downloaded files
delete - Delete links from queue
download - Start download

(19:08:05) m0d@mydomain.com:
status

(19:08:05) snake:
Status: Waiting for a job
What do you want to do now?


...


What do we need for modjabber?
1) XMPP perl library ( apt-get install libnet-xmpp-perl )
2) jabber server (4 example ejabberd: apt-get install ejabberd)
3) modrapi - rc2 version (link below)
4) modjabber.pm (link below)

Basic configuration of ejabberd is verry simple
edit: /etc/ejabberd/ejabberd.cfg

find section "%% Hostname"
and place there your domain or public IP
{hosts, ["mydomain.com"]}.

restart ejabberd server :
$ ejabberdctl restart

now we need to register our modrapi jabber client:
$ ejabberdctl register snake mydomain.com JABBER_PASSWORD

We need to launch snake (login of our client) with system start
Owner of modjabber must be equal to the owner of modrapi configuration.
So...

edit: /etc/rc.local
above "exit 0" place:

su -c "perl /path/to/modjabber.pm" - SYSTEM_LOGIN
4 example:
su -c "perl /my/init/modjabber.pm" - m0d

now edit modjabber.pm (lines 11-16) and place there your data

i think thats all

package (modrapi rc2 + modjabber) download

Please leave me a comment if you are using modrapi, modjabber!