Jump to content



Photo

_GetSource()


  • Please log in to reply
19 replies to this topic

#1 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 27 May 2005 - 08:57 PM

;=============================================================================== ; ; 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. ; ;===============================================================================

Attached Files


Edited by w0uter, 30 May 2005 - 08:22 PM.

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll





#2 layer

layer

    i love skateboarding

  • Active Members
  • PipPipPipPipPipPip
  • 2,470 posts

Posted 27 May 2005 - 09:15 PM

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

#3 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 27 May 2005 - 09:23 PM

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

#4 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 30 May 2005 - 06:36 PM

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

#5 therks

therks

    Witty quote

  • Active Members
  • PipPipPipPipPipPip
  • 2,163 posts

Posted 30 May 2005 - 08:09 PM

This isn't necessarily a good idea..
If StringLeft($s_URL, 7) <> 'http://' Then $s_URL = 'http://' & $s_URL


What if they are using an https:// URL? This line will change the URL they sent to http://https://www.etc.com

Otherwise it works fine.

#6 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 30 May 2005 - 08:23 PM

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 by w0uter, 30 May 2005 - 08:53 PM.

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#7 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 02 June 2005 - 10:14 AM

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

#8 layer

layer

    i love skateboarding

  • Active Members
  • PipPipPipPipPipPip
  • 2,470 posts

Posted 02 June 2005 - 08:24 PM

Looks pretty good to me, but I was never good at finding problems in code... But from what I see, there are none :(
FootbaG

#9 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 03 June 2005 - 10:59 AM

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

#10 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 05 June 2005 - 12:42 PM

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

#11 flyingboz

flyingboz

    The Network Is All

  • Active Members
  • PipPipPipPipPipPip
  • 768 posts

Posted 07 June 2005 - 01:47 AM

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.

#12 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 07 June 2005 - 01:27 PM

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

#13 flyingboz

flyingboz

    The Network Is All

  • Active Members
  • PipPipPipPipPipPip
  • 768 posts

Posted 08 June 2005 - 02:23 PM

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 if
an 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.

#14 memnon

memnon

    Adventurer

  • Active Members
  • PipPip
  • 120 posts

Posted 11 June 2005 - 07:17 AM

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()^ERROR

Error: 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?

#15 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 11 June 2005 - 10:09 PM

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

#16 SvenP

SvenP

    AutoIt COMposer

  • Developers
  • 639 posts

Posted 12 June 2005 - 10:20 PM

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

#17 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 12 June 2005 - 10:33 PM

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

#18 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 14 June 2005 - 02:00 PM

k heres my first try @ it.

Attached Files


My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

#19 jdickens

jdickens

    Prodigy

  • Active Members
  • PipPipPip
  • 150 posts

Posted 14 June 2005 - 02:36 PM

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.

#20 w0uter

w0uter

    resreveR nA

  • Active Members
  • PipPipPipPipPipPip
  • 2,262 posts

Posted 14 June 2005 - 02:59 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users