AuToItItAlIaNlOv3R Posted December 12, 2009 Share Posted December 12, 2009 Hi to all!, I'm writing a link manager for the most important hosting file. I would like to create a url link scanner for megaupload. For esample i've this site : http:www.exsamplesitewithlink./linksformegaupoad.html This site contains megaupload links on that page, now i would grab that link: Megaupload link links are formed in this way : http://www.megaupload.com/?d=xxxxxxxx Or http://www.megaupload.com/?f=xxxxxxxx Or http://www.megaupload.com/regionalcode/?d=xxxxxxxx for example : http://www.megaupload.com/en/?d=xxxxxxxx Or http://www.megaupload.com/regionalcode/?f=xxxxxxxx for example: http://www.megaupload.com/en/?f=xxxxxxxx Regional code is formed by 2 letters The x's are combinations of numbers and letters How can i grab the megaupload link contain in a web page? I've write this code but I can not continue it #include <GUIConstants.au3> #Include <String.au3> #include <Array.au3> #include <INet.au3> $input = InputBox ("Link","Insert link") $source = _INetGetSource ($input) $control = StringRegExp($source,"http://www.megaupload.com/?d=[-a-zA-Z0-9]",3) ;How can i scan also other types of links ? (http://www.megaupload.com/?f=xxxxxxx,eccc..) If IsArray($control) Then MsgBox (0,"Done","There are MegaUpload Link in this page") ;How can i write on a file the link contained in a web page? ElseIf Not IsArray ($control) Then MsgBox (0,"Fail","No MegaUpload link found in this page") EndIf Thank's for the attention! HI! Link to comment Share on other sites More sharing options...
Authenticity Posted December 12, 2009 Share Posted December 12, 2009 When you want to match the character but it's considered a metacharacter you must escape it: #include <GUIConstants.au3> #Include <String.au3> #include <Array.au3> #include <INet.au3> $input = InputBox ("Link","Insert link") $source = _INetGetSource ($input) $control = StringRegExp($source,"(?i)http://www\.megaupload\.com/(?:regionalcode/|en/)?\?[fd]=[-a-zA-Z0-9]+",3) ;How can i scan also other types of links ? (http://www.megaupload.com/?f=xxxxxxx,eccc..) If IsArray($control) Then MsgBox (0,"Done","There are MegaUpload Link in this page") ;How can i write on a file the link contained in a web page? ElseIf Not IsArray ($control) Then MsgBox (0,"Fail","No MegaUpload link found in this page") EndIf ...as with \?. Link to comment Share on other sites More sharing options...
AuToItItAlIaNlOv3R Posted December 12, 2009 Author Share Posted December 12, 2009 When you want to match the character but it's considered a metacharacter you must escape it: #include <GUIConstants.au3> #Include <String.au3> #include <Array.au3> #include <INet.au3> $input = InputBox ("Link","Insert link") $source = _INetGetSource ($input) $control = StringRegExp($source,"(?i)http://www\.megaupload\.com/(?:regionalcode/|en/)?\?[fd]=[-a-zA-Z0-9]+",3) ;How can i scan also other types of links ? (http://www.megaupload.com/?f=xxxxxxx,eccc..) If IsArray($control) Then MsgBox (0,"Done","There are MegaUpload Link in this page") ;How can i write on a file the link contained in a web page? ElseIf Not IsArray ($control) Then MsgBox (0,"Fail","No MegaUpload link found in this page") EndIf ...as with \?. Thank's for example but the script does not work at all. This megaupload link : http://www.megaupload.com/regionalcode/?d=xxxxxxxx for example : http://www.megaupload.com/en/?d=xxxxxxxx Don't contain the string "regionalcode" but is For english people : http://www.megaupload.com/en/?d=xxxxxxxx For italian people : http://www.megaupload.com/it/?d=xxxxxxxx For uk people http://www.megaupload.com/us/?d=xxxxxxxx Ecc... http://www.megaupload.com/regionalcode/?d=xxxxxxxx "regionalcode" is only an esample Now... How can i write in a file the link checked, becouse this script told only if there are megaupload link, but it don't write me the checked link Thank's for the help Link to comment Share on other sites More sharing options...
ProgAndy Posted December 12, 2009 Share Posted December 12, 2009 This script creates an array with all found links. I modified it, so any 2 character-code regioncode is allowed: #include <GUIConstants.au3> #Include <String.au3> #include <Array.au3> #include <INet.au3> $input = InputBox ("Link","Insert link") $source = _INetGetSource ($input) $control = StringRegExp($source,"(?i)http://www\.megaupload\.com/?[^\?]{0,3}\?[fd]=[-a-zA-Z0-9]+",3) ;How can i scan also other types of links ? (http://www.megaupload.com/?f=xxxxxxx,eccc..) If IsArray($control) Then MsgBox (0,"Done","There are MegaUpload Link in this page") _ArrayDisplay($control, "Megaupload links") ElseIf Not IsArray ($control) Then MsgBox (0,"Fail","No MegaUpload link found in this page") EndIf *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
AuToItItAlIaNlOv3R Posted December 12, 2009 Author Share Posted December 12, 2009 Thank's a lot the script work great, but i've another question. I saw that the program also captures the links that have only 1 letter in the regional code, but the regionalcode in megaupload is always formed by two letters. It's possible to esclude the link with 1 letter in regional code? Just one question, i saw that program grab only pages that do not require registration. It's possible to grab forum pages that require the registration, maybe putting the site's cookies in the program by logging? If yes, how can do it? Thank's a lot! Link to comment Share on other sites More sharing options...
smartee Posted December 12, 2009 Share Posted December 12, 2009 Thank's a lot the script work great, but i've another question. I saw that the program also captures the links that have only 1 letter in the regional code, but the regionalcode in megaupload is always formed by two letters. It's possible to esclude the link with 1 letter in regional code? Just one question, i saw that program grab only pages that do not require registration. It's possible to grab forum pages that require the registration, maybe putting the site's cookies in the program by logging? If yes, how can do it? Thank's a lot! ok heres the whole lot, it should even grab those links from pages that require registration (providing you are logged in using Internet Explorer).. expandcollapse popup#include <Array.au3> #include <INet.au3> #include <File.au3> #include <IE.au3> Dim $uniqueLinks[1] $uniqueLinks[0] = 0 $linksFile = @ScriptDir & "\links.txt" $webURL = InputBox("Link", "Insert link", "", " M", "-1", "125", "-1", "-1") If @error = 1 Then Exit ;The Cancel button was pushed SplashTextOn("Status","Loading page..","300","25","-1","-1",34,"Calibri","10","400") $ieObject=_IECreate($webURL,0,0,1,0) $pageSource=_IEDocReadHTML($ieObject) _IEQuit($ieObject) SplashTextOn("Status","Page Loaded. Extracting links..","300","25","-1","-1",34,"Calibri","10","400") $rawLinksArray = StringRegExp($pageSource, "(?i)http://www\.megaupload\.com/(?:\w\w/)?\?[fd]=[-a-zA-Z0-9]+", 3) If IsArray($rawLinksArray) Then _ArrayAdd($uniqueLinks, $rawLinksArray[0]) $uniqueLinks[0] += 1 For $i = 1 To UBound($rawLinksArray) - 1 If (_ArraySearch($uniqueLinks, $rawLinksArray[$i]) == -1) Then _ArrayAdd($uniqueLinks, $rawLinksArray[$i]) $uniqueLinks[0] += 1 EndIf Next _FileWriteFromArray($linksFile, $uniqueLinks, 1) SplashOff() MsgBox(0, "Process completed", $uniqueLinks[0] & " MegaUpload links were found on: " & @CRLF & $webURL & @CRLF & "Links saved to: """ & $linksFile & """.") Else SplashOff() MsgBox(0, "Process completed", "No MegaUpload links were found on this page.") EndIf Link to comment Share on other sites More sharing options...
AuToItItAlIaNlOv3R Posted December 13, 2009 Author Share Posted December 13, 2009 Ok thanks a lot, i've modified your script and work fine thank's a lot.Now i've a new question, i would like to set my program on trayicon when is pressed minimize button.For example I've this try code #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Try", 116, 26, 268, 227) $Label1 = GUICtrlCreateLabel("This is a test", 24, 8, 63, 17) GUISetState(@SW_SHOW) Opt("TrayMenuMode", 1) Opt("TrayOnEventMode",1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE Minimize() EndSwitch WEnd Func Minimize() GUISetState(@SW_HIDE) TraySetState(1) $Ripristina = TrayCreateItem("resume") TrayItemSetOnEvent(-1,"resume") $Escitray = TrayCreateItem("exit") TrayItemSetOnEvent(-1,"exits") EndFunc Func resume() GUISetState(@SW_SHOW) EndFunc Func exits() exit endfuncBut when i minimize and then i resume the program, the tray menu is doubles, this is a photo :How can i fix it? Sorry for my bad english, but it isn't my native language.Hi! 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