anunes Posted February 13, 2009 Share Posted February 13, 2009 (edited) Hi, I was trying to do a script that copy just a specify text in the SourceCode of a web page... I just have no idea how to start this program, someone can help me? What I want is something like this: 01 - The One With Ross' New Girlfriend - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AL8BH29Q" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=U7UH0IF9" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976717/_Friends_2x01_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976659/_Friends_2x01_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 02 - The One With the Breast Milk - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=B5UP4U6J" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AD0B84LY" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976770/_Friends_2x02_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976586/_Friends_2x02_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 03 - The One Where Heckles Dies - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=IPP85ZXV" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=JX9D4B80" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976752/_Friends_2x03_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976713/_Friends_2x03_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 04 - The One With Phoebe's Husband - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=7AR36UU9" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=BIEQV08R" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976740/_Friends_2x04_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976709/_Friends_2x04_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 05 - The One With Five Steaks and an Eggplant - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=QZPAZ5NJ" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=NBMNVLD6" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976979/_Friends_2x05_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976957/_Friends_2x05_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> Copying just the http:// MegaUpload links with the after "?d=" code... and paste it on a blank notepad... Please, any idea? Thanks Edited February 13, 2009 by anunes Link to comment Share on other sites More sharing options...
Authenticity Posted February 13, 2009 Share Posted February 13, 2009 (edited) Can use be more specific about after which ?d= one you want? Maybe you give a clue about which tag(s) in the source preceding it?Edit:expandcollapse popup#include <Array.au3> Dim $sSource = '02 - The One With the Breast Milk - <a href="http://usercash.com' & _ '/go/1/20643/http://www.megaupload.com/?d=B5UP4U6J" target="_blan' & _ 'k"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="' & _ 'http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AD0B' & _ '84LY" target="_blank"><font color="blue"><b>MegaUpload 2</b></fo' & _ 'nt></a> // <a href="http://usercash.com/go/1/20643/http://rapids' & _ 'hare.com/files/125976770/_Friends_2x02_Up_by_AlienwareRlz_www.pl' & _ 'ayanimes.net.avi.001" target="_blank"><font color="black"><b>Rap' & _ 'idshare 1</b></font></a> / <a href="http://usercash.com/go/1/206' & _ '43/http://rapidshare.com/files/125976586/_Friends_2x02_Up_by_Ali' & _ 'enwareRlz_www.playanimes.net.avi.002" target="_blank"><font colo' & _ 'r="black"><b>Rapidshare 2</b></font></a><br />' & _ '03 - The One Where Heckles Dies - <a href="http://usercash.com/g' & _ 'o/1/20643/http://www.megaupload.com/?d=IPP85ZXV" target="_blank"' & _ '><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="ht' & _ 'tp://usercash.com/go/1/20643/http://www.megaupload.com/?d=JX9D4B' & _ '80" target="_blank"><font color="blue"><b>MegaUpload 2</b></font' & _ '></a> // <a href="http://usercash.com/go/1/20643/http://rapidsha' & _ 're.com/files/125976752/_Friends_2x03_Up_by_AlienwareRlz_www.play' & _ 'animes.net.avi.001" target="_blank"><font color="black"><b>Rapid' & _ 'share 1</b></font></a> / <a href="http://usercash.com/go/1/20643' & _ '/http://rapidshare.com/files/125976713/_Friends_2x03_Up_by_Alien' & _ 'wareRlz_www.playanimes.net.avi.002" target="_blank"><font color=' & _ '"black"><b>Rapidshare 2</b></font></a><br />' & _ '04 - The One With Phoebe''s Husband - <a href="http://usercash.c' & _ 'om/go/1/20643/http://www.megaupload.com/?d=7AR36UU9" target="_bl' & _ 'ank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a hre' & _ 'f="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=' & _ 'BIEQV08R" target="_blank"><font color="blue"><b>MegaUpload 2</b' & _ '></font></a> // <a href="http://usercash.com/go/1/20643/http://' & _ 'rapidshare.com/files/125976740/_Friends_2x04_Up_by_AlienwareRlz' & _ '_www.playanimes.net.avi.001" target="_blank"><font color="black' & _ '"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com' & _ '/go/1/20643/http://rapidshare.com/files/125976709/_Friends_2x04' & _ '_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"' & _ '><font color="black"><b>Rapidshare 2</b></font></a><br />' Dim $sPattern = '(?i)(http://www.megaupload.com/[^"]+)" target' Dim $Arr = StringRegExp($sSource, $sPattern, 3) If IsArray($Arr) Then Local $hFile = FileOpen(@ScriptDir & '\' & @MDAY & '-' & @MON & '-' & @YEAR & '.txt', 1) For $i = 0 To UBound($Arr)-1 FileWriteLine($hFile, $Arr[$i]) Next FileClose($hFile) EndIf Edited February 13, 2009 by Authenticity Link to comment Share on other sites More sharing options...
M a k a v e l ! Posted February 14, 2009 Share Posted February 14, 2009 Hi, I was trying to do a script that copy just a specify text in the SourceCode of a web page... I just have no idea how to start this program, someone can help me? What I want is something like this: 01 - The One With Ross' New Girlfriend - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AL8BH29Q" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=U7UH0IF9" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976717/_Friends_2x01_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976659/_Friends_2x01_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 02 - The One With the Breast Milk - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=B5UP4U6J" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AD0B84LY" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976770/_Friends_2x02_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976586/_Friends_2x02_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 03 - The One Where Heckles Dies - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=IPP85ZXV" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=JX9D4B80" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976752/_Friends_2x03_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976713/_Friends_2x03_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 04 - The One With Phoebe's Husband - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=7AR36UU9" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=BIEQV08R" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976740/_Friends_2x04_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976709/_Friends_2x04_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> 05 - The One With Five Steaks and an Eggplant - <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=QZPAZ5NJ" target="_blank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=NBMNVLD6" target="_blank"><font color="blue"><b>MegaUpload 2</b></font></a> // <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976979/_Friends_2x05_Up_by_AlienwareRlz_www.playanimes.net.avi.001" target="_blank"><font color="black"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com/go/1/20643/http://rapidshare.com/files/125976957/_Friends_2x05_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"><font color="black"><b>Rapidshare 2</b></font></a><br /> Copying just the http:// MegaUpload links with the after "?d=" code... and paste it on a blank notepad... Please, any idea? Thanks Hey ! F.R.I.E.N.D.S episodes ! [font="Lucida Sans Unicode"]M a k. a v e L ![/font] Link to comment Share on other sites More sharing options...
anunes Posted February 14, 2009 Author Share Posted February 14, 2009 (edited) Can use be more specific about after which ?d= one you want? Maybe you give a clue about which tag(s) in the source preceding it? Edit: expandcollapse popup#include <Array.au3> Dim $sSource = '02 - The One With the Breast Milk - <a href="http://usercash.com' & _ '/go/1/20643/http://www.megaupload.com/?d=B5UP4U6J" target="_blan' & _ 'k"><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="' & _ 'http://usercash.com/go/1/20643/http://www.megaupload.com/?d=AD0B' & _ '84LY" target="_blank"><font color="blue"><b>MegaUpload 2</b></fo' & _ 'nt></a> // <a href="http://usercash.com/go/1/20643/http://rapids' & _ 'hare.com/files/125976770/_Friends_2x02_Up_by_AlienwareRlz_www.pl' & _ 'ayanimes.net.avi.001" target="_blank"><font color="black"><b>Rap' & _ 'idshare 1</b></font></a> / <a href="http://usercash.com/go/1/206' & _ '43/http://rapidshare.com/files/125976586/_Friends_2x02_Up_by_Ali' & _ 'enwareRlz_www.playanimes.net.avi.002" target="_blank"><font colo' & _ 'r="black"><b>Rapidshare 2</b></font></a><br />' & _ '03 - The One Where Heckles Dies - <a href="http://usercash.com/g' & _ 'o/1/20643/http://www.megaupload.com/?d=IPP85ZXV" target="_blank"' & _ '><font color="blue"><b>MegaUpload 1</b></font></a> / <a href="ht' & _ 'tp://usercash.com/go/1/20643/http://www.megaupload.com/?d=JX9D4B' & _ '80" target="_blank"><font color="blue"><b>MegaUpload 2</b></font' & _ '></a> // <a href="http://usercash.com/go/1/20643/http://rapidsha' & _ 're.com/files/125976752/_Friends_2x03_Up_by_AlienwareRlz_www.play' & _ 'animes.net.avi.001" target="_blank"><font color="black"><b>Rapid' & _ 'share 1</b></font></a> / <a href="http://usercash.com/go/1/20643' & _ '/http://rapidshare.com/files/125976713/_Friends_2x03_Up_by_Alien' & _ 'wareRlz_www.playanimes.net.avi.002" target="_blank"><font color=' & _ '"black"><b>Rapidshare 2</b></font></a><br />' & _ '04 - The One With Phoebe''s Husband - <a href="http://usercash.c' & _ 'om/go/1/20643/http://www.megaupload.com/?d=7AR36UU9" target="_bl' & _ 'ank"><font color="blue"><b>MegaUpload 1</b></font></a> / <a hre' & _ 'f="http://usercash.com/go/1/20643/http://www.megaupload.com/?d=' & _ 'BIEQV08R" target="_blank"><font color="blue"><b>MegaUpload 2</b' & _ '></font></a> // <a href="http://usercash.com/go/1/20643/http://' & _ 'rapidshare.com/files/125976740/_Friends_2x04_Up_by_AlienwareRlz' & _ '_www.playanimes.net.avi.001" target="_blank"><font color="black' & _ '"><b>Rapidshare 1</b></font></a> / <a href="http://usercash.com' & _ '/go/1/20643/http://rapidshare.com/files/125976709/_Friends_2x04' & _ '_Up_by_AlienwareRlz_www.playanimes.net.avi.002" target="_blank"' & _ '><font color="black"><b>Rapidshare 2</b></font></a><br />' Dim $sPattern = '(?i)(http://www.megaupload.com/[^"]+)" target' Dim $Arr = StringRegExp($sSource, $sPattern, 3) If IsArray($Arr) Then Local $hFile = FileOpen(@ScriptDir & '\' & @MDAY & '-' & @MON & '-' & @YEAR & '.txt', 1) For $i = 0 To UBound($Arr)-1 FileWriteLine($hFile, $Arr[$i]) Next FileClose($hFile) EndIfoÝ÷ Ûú®¢×y¨b·lÂäx/z¼wºØ^ØÜ·ÜÖ¥Ø^èºhiÙbKk,¨¹ìi¨§¶¬)Þr^¶jëh×6Dim $sPattern = '(?i)(http://www.megaupload.com/[^"]+)" target' Thank you very much! Edited February 14, 2009 by anunes Link to comment Share on other sites More sharing options...
Authenticity Posted February 14, 2009 Share Posted February 14, 2009 It's just the pattern for the regular expression engine or function. check the help file for StringRegExp() you'll have a clue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now