PDA

View Full Version : How to make a copy-paste program for rapidshare.com links?


xMasterBlasterx
08-24-08, 12:51 PM
I want to make a copy-paste program, that copys all rapidshare.com links from any website i want (so if i add to search box "rapidshare.com" then program copys all the other part of the links - http://rapidshare.com/4532887/example.rar). How hard is it to make? Any tips for making?

stevebakh
08-24-08, 05:24 PM
You should be able to create something like this in PHP. I recently coded a small application that did something similar, but was more general and retrieved information from a page pertaining to it's search engine friendliness.

You look at using cURL in PHP. You'll be able to create a small interface which will allow you to enter a URL and it will scrape all the rapidshare links from it. Once you've retrieved the page with cURL, you can use regular expressions to grab the specific information you need. You should able to have something up and running within a few hours + a few more hours study time if all of this is new to you.

Take a stab at it and come back and ask for help if you're still having trouble with it.

Make http://php.net/ your bible whilst you're doing this. Good luck. :)

TonyT
08-24-08, 07:15 PM
http://simplehtmldom.sourceforge.net/

stevebakh
08-24-08, 08:59 PM
http://simplehtmldom.sourceforge.net/

I think using that kind of library would be overkill for this task. Even using a html2dom type solution, the OP would still need to use cURL or one of the other file retrieval methods (file_get_contents & co) of PHP to get the content in the first place. After that, it would be much simpler to run preg_match_all with a simple regexp, rather than feeding the content into that library, then parsing all links in the document, checking if the href attributes match rapidshare... Kind of makes that stage in the whole process redundant.

[edit]
Ah, taking a quick glance, I notice this library actually has a file retrieval method built in - probably does the cURL stuff in the background for you. Suppose that would make the task even easier. Retrieve, traverse links, scrape data. :)

devunion
02-03-09, 02:30 PM
You can take a look at BRapid Toolbar for Firefox (https://addons.mozilla.org/en-US/firefox/addon/9029).