tags:

views:

133

answers:

4

Hello,

I am developing a script in php to manage my rapidshare accounts (for learning purposes), i wanted to know how can we login remotely and get accounts details on my site, something that api does, the details like traffic left, expiry date, etc.

A: 

Since Rapidshare does not provide an API interface to their service, the only way is to use an HTML parser available for PHP, login with the script, and parse the values.

Update: Rapidshare does provide an API as merkuro has stated in his post.

Alan Haggai Alavi
+1  A: 

With PHP you could use either Curl, PHPSimpleHTMLDomParser, Snoopy, or phpQuery to grab the contents from the remote page. Be mindful that some websites require a user_agent, in which case you could setup one through ini_set prior to running your script.

Jonathan Sampson
+1  A: 

You could use cURL to send HTTP requests from your script to the site. There are also ready-made solutions for PHP, such as Snoopy, which will let you do things like posting a form or scraping a page, without having to use cURL directly.

Daniel Vandersluis
++ for Snoopy. It saved my life (okay, slight fib) a few months ago.
Jonathan Sampson
+1  A: 

Uncertain what exactly your question is, but it probably helps to take a look at the Rapidshare API. Additionally you probably want to make yourself familiar with the following functions/ components: fopen and curl to use the api/load the site. To get specific parameters out of the content I suggest using ereg or the xml functionality.

merkuro
wow... thats really great i didnt knew this ever existed, Thank You, very much.
Shishant
I did not know that an API existed for Rapidshare. Thank you.
Alan Haggai Alavi
you are welcome. they even have an "upload script" on the site written in perl. since there are certain similarities between perl/php you will find it easy to understand. btw. this api is brand new and was released about 10 days ago afaik.
merkuro
Shishant
shishant, that's a new question ;)
Jonathan Sampson