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.
我正在开发一个PHP脚本来管理我的电子书帐户(用于学习目的),我想知道我们如何远程登录并获取我的网站上的帐户详细信息,api做的事情,流量离开,到期日等详细信息等。
4 个解决方案
#1
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.
不确定你的问题到底是什么,但看看Rapidshare API可能会有所帮助。另外,您可能希望熟悉以下函数/组件:fopen和curl以使用api /加载站点。要从内容中获取特定参数,我建议使用ereg或xml功能。
#2
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.
使用PHP,您可以使用Curl,PHPSimpleHTMLDomParser,Snoopy或phpQuery从远程页面获取内容。请注意,某些网站需要user_agent,在这种情况下,您可以在运行脚本之前通过ini_set设置一个。
#3
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.
您可以使用cURL将脚本中的HTTP请求发送到站点。还有现成的PHP解决方案,例如Snoopy,它可以让您执行诸如发布表单或抓取页面之类的操作,而无需直接使用cURL。
#4
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.
由于Rapidshare不为其服务提供API接口,唯一的方法是使用可用于PHP的HTML解析器,使用脚本登录并解析值。
Update: Rapidshare does provide an API as merkuro has stated in his post.
更新:Rapidshare确实提供了一个API,正如merkuro在他的帖子中所述。
#1
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.
不确定你的问题到底是什么,但看看Rapidshare API可能会有所帮助。另外,您可能希望熟悉以下函数/组件:fopen和curl以使用api /加载站点。要从内容中获取特定参数,我建议使用ereg或xml功能。
#2
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.
使用PHP,您可以使用Curl,PHPSimpleHTMLDomParser,Snoopy或phpQuery从远程页面获取内容。请注意,某些网站需要user_agent,在这种情况下,您可以在运行脚本之前通过ini_set设置一个。
#3
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.
您可以使用cURL将脚本中的HTTP请求发送到站点。还有现成的PHP解决方案,例如Snoopy,它可以让您执行诸如发布表单或抓取页面之类的操作,而无需直接使用cURL。
#4
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.
由于Rapidshare不为其服务提供API接口,唯一的方法是使用可用于PHP的HTML解析器,使用脚本登录并解析值。
Update: Rapidshare does provide an API as merkuro has stated in his post.
更新:Rapidshare确实提供了一个API,正如merkuro在他的帖子中所述。