Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Function : InternetFileRead() aka UrlDownLoadToVar()


  • Please log in to reply
161 replies to this topic
JakeW
  • Members
  • 210 posts
  • Last active: Jul 11 2013 05:27 PM
  • Joined: 16 Jul 2011
Hey SKAN, pretty cool function, found out about it through Frankie when I had a problem searching for the first link from a google search automatically. Thing is, when searching for (just three quick examples), n00p, geekycode, or "getchar stupid" (which someone searched just to check).

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Thing is,


.. It is done!
I tested with all 3 :

MsgBox,% GoogleGetRedirect( "GetChar Stupid" )
MsgBox,% GoogleGetRedirect( "n00p" )
MsgBox,% GoogleGetRedirect( "geekycode" )

Posted Image

JakeW
  • Members
  • 210 posts
  • Last active: Jul 11 2013 05:27 PM
  • Joined: 16 Jul 2011
Oh I'm sorry. I should of looked through this before, the version Frankie gave me (that specifically says modified by Frankie) didn't work. I was just told to post in here about it. But yes, that one does work :p.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

I should of looked through this before


It was not working before. I fixed it for (lucky) you. :p

JakeW
  • Members
  • 210 posts
  • Last active: Jul 11 2013 05:27 PM
  • Joined: 16 Jul 2011

I should of looked through this before


It was not working before. I fixed it for (lucky) you. :p


Haha thanks :p. I don't want you to do it for me, but is there a way to get the page title also? For example, if you google "test" Test.com Web Based Testing and Certification Software v2.0 is the title of the page. If it is possible, what would I need to change?

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

is there a way to get the page title also?


I have already answered to that a few posts above. It is not simple and may not work always.

nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
So tell me SKAN, what fixed it?

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
@nimda

Yours:
<!-- m -->http://www.google.co...hl=en&btnI=1&q=<!-- m -->

Mine, rectified:
http://www.google.co...</span>&btnI&q=

nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
Thanks :)
I would never have found that

ibko
  • Members
  • 5 posts
  • Last active: Dec 11 2011 12:07 PM
  • Joined: 09 Sep 2011
Many thanks to author!
Can somebody tell me how to modify this script: i need to download only part of file, i.e. 350 very first bytes.
Thank you in advance.

Zod
  • Members
  • 214 posts
  • Last active: Jan 26 2012 08:02 PM
  • Joined: 06 Jul 2011
I dont think thats a capability of winninet. You can of course exclude it after you get it with substr(content,1,350) but simply not downloading it all, I dont think you have that sort of control

Actually i am unaware of a way to do this with any API but I suppose such exists some where
Posted Image Stolen from SKAN

ibko
  • Members
  • 5 posts
  • Last active: Dec 11 2011 12:07 PM
  • Joined: 09 Sep 2011
Thank you.
[off]
Posted the same question in another topic, sorry...
[/off]

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

i need to download only part of file, i.e. 350 very first bytes


Here is an example:

InternetFileRead( Data, "http://www.autohotkey.com/forum/rss.php" , 350, 350, "" )
MsgBox, 0, % StrLen(Data), % Data


ibko
  • Members
  • 5 posts
  • Last active: Dec 11 2011 12:07 PM
  • Joined: 09 Sep 2011
Yes, it works, but downloads whole file. It's not exact what I want. Download mus be aborted after 350 bytes to save traffic - it's critical.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

Yes, it works, but downloads whole file..


It will not.