w0uter Posted May 27, 2005 Share Posted May 27, 2005 (edited) ;=============================================================================== ; ; Function Name: _INetGetSource() ; Description: Gets the source from an URL without writing a temp file. ; Parameter(s): $s_URL = The URL of the site. ; Requirement(s): A beta version w/ COM ; Return Value(s): On Success - Returns the source code. ; On Failure - 0 and sets @ERROR = 1 ; Author(s): KIX: Lonkero. ; BASE CONVERSION: SvenP. ; UDF: Wouter van Kesteren. ; ;===============================================================================_INetGetSource.zip Edited May 30, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
layer Posted May 27, 2005 Share Posted May 27, 2005 Sorry for being picky, but maybe you should rename it to "_URLGetSource" or "INetGetSource" or some such to keep up with the consistent namespace type things we have so far... BTW, Good work! FootbaG Link to comment Share on other sites More sharing options...
w0uter Posted May 27, 2005 Author Share Posted May 27, 2005 i agree. done. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted May 30, 2005 Author Share Posted May 30, 2005 soo is this so damn good ? cuz i dont see any criticism ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
therks Posted May 30, 2005 Share Posted May 30, 2005 This isn't necessarily a good idea..If StringLeft($s_URL, 7) <> 'http://' Then $s_URL = 'http://' & $s_URLWhat if they are using an https:// URL? This line will change the URL they sent to http://https://www.etc.comOtherwise it works fine. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
w0uter Posted May 30, 2005 Author Share Posted May 30, 2005 (edited) thank you Saunders. how do you like it like this ? ;add 'http://' if 'http(s)://' is not present If StringLeft($s_URL, 7) <> 'http://' AND StringLeft($s_URL, 8) <> 'https://' Then $s_URL = 'http://' & $s_URL and yer link will end up @ paypal Edited May 30, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted June 2, 2005 Author Share Posted June 2, 2005 sooo anything else ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
layer Posted June 2, 2005 Share Posted June 2, 2005 Looks pretty good to me, but I was never good at finding problems in code... But from what I see, there are none FootbaG Link to comment Share on other sites More sharing options...
w0uter Posted June 3, 2005 Author Share Posted June 3, 2005 after looking at it again. it noticed that it has no error handeling what so ever. i was wondering, would it be possible to: get the current autoit.error function. change it to a new function. detect if there is an error. change it back to the old function. (hope you catch my drift) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted June 5, 2005 Author Share Posted June 5, 2005 anyone ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
flyingboz Posted June 7, 2005 Share Posted June 7, 2005 anyone ?<{POST_SNAPBACK}>I'd recommend for cross-platform / future version compatibility that you grab the appropriate winhttp.winhttprequest.5.1 method from the registry - This will prevent object not found errors.... While global variables are very bad, in a case like this I might use one, such that I'd put the regread in a if not defined structure, so that I didn't have to do a regread every time the func was called. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
w0uter Posted June 7, 2005 Author Share Posted June 7, 2005 i am sorry but i do not get what you mean. could you explain it a bit more ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
flyingboz Posted June 8, 2005 Share Posted June 8, 2005 icould you explain it a bit more ?<{POST_SNAPBACK}>For portability, you [c|sh]ould check the registry keys that match the following,and use the most desired version available... Your script will fail w/ a com error ifan older IE is being run.HKEY_CLASSES_ROOT\WinHttp.WinHttpRequest.5 Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
memnon Posted June 11, 2005 Share Posted June 11, 2005 i have troubles with the errorhandling ....if a url is not valid, like http://w.a i get an error:Line 34...$o_HTTP.send()$0_HTTP.send()^ERRORError: The requested action with this object has failed.Why i dont get the MsGBox with "...error" ?$webadresse=_INetGetSource($sInputBoxAnswer) Select Case @ERROR = 0 Msgbox(0,"Url-Prüfung",$sInputBoxAnswer & "...ok") Case @ERROR = 1 Msgbox(0,"Url-Prüfung",$sInputBoxAnswer & "...error") EndSelect das beste Windows Support Forum: Windows 2000 Helpline und tschüss den WindowsfehlernProgrammieren: Autoit 3 - wer braucht noch VBS ?!Programmieren: Autoit 3 Forum? Link to comment Share on other sites More sharing options...
w0uter Posted June 11, 2005 Author Share Posted June 11, 2005 since it is working with COM. i am not able to check if the error occurs, without adding a custom errorhandeler wich will overwrite the old one. untill they change the objevent to return the old func in like a byref var. there is not really much i can do about this. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
SvenP Posted June 12, 2005 Share Posted June 12, 2005 since it is working with COM. i am not able to check if the error occurs,without adding a custom errorhandeler wich will overwrite the old one.untill they change the objevent to return the old func in like a byref var.there is not really much i can do about this.<{POST_SNAPBACK}>W0uter,I have added an option to retrieve the current name of the COM Error Handler function, using ObjEvent. However a running Error Handler can not be stopped, because it's too difficult to retrieve the variable it had been assigned to.The modifications will be uploaded soon (need to rewrite the documentation first).Regards,-Sven Link to comment Share on other sites More sharing options...
w0uter Posted June 12, 2005 Author Share Posted June 12, 2005 sweet. your teh My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
w0uter Posted June 14, 2005 Author Share Posted June 14, 2005 k heres my first try @ it._INetGetSource_NEW.au3 My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
jdickens Posted June 14, 2005 Share Posted June 14, 2005 I get Unknown function name.: on ObjCreate. How do I determine what version I have, and is that the prob? J If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
w0uter Posted June 14, 2005 Author Share Posted June 14, 2005 I get Unknown function name.: on ObjCreate.How do I determine what version I have, and is that the prob?J<{POST_SNAPBACK}>you need the latest beta version.http://www.autoitscript.com/autoit3/files/beta/autoit/ My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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