Jump to content

Read text file from web


Recommended Posts

Hi, I'm trying to read informations from a .txt stored file (i'm using drive to store the file, but i accept suggestions), I dont wanna use _IE because it is VERY slow for me, i've tried using InetRead and WinHTTP without success, here is my attempts: 

 

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "https://drive.google.com/open?id=1Cmk5-Mr10CwDcie37sb4AmhHj6D8S9C5", False)

$oHTTP.Send()
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
ConsoleWrite($oReceived)
ConsoleWrite(BinaryToString(InetRead("https://drive.google.com/open?id=1Cmk5-Mr10CwDcie37sb4AmhHj6D8S9C5",1)))
$oIE = _IECreate("https://drive.google.com/open?id=1Cmk5-Mr10CwDcie37sb4AmhHj6D8S9C5")
ConsoleWrite(_IEDocReadHTML($oIE)) <<<<< WORKING, BUT VERY SLOW

 Thanks!

Link to comment
Share on other sites

It's because it's being hosted on Google Docs. Like I was saying, you will prob need to find a new method of storing the text online if you're wanting to do this without having to spend a lot more effort on parsing and getting the data.

#include <Inet.au3>

ConsoleWrite(_INetGetSource('http://xcrov.com/autoit/test.txt'))

 

Link to comment
Share on other sites

There is a UDF around here for google drive. I'm not sure if it still works because the last time I used it was like 5 years ago but you could try that. If you're not wanting to purchase a domain and hosting service then you could look at hosting a apache server on your computer or something. I'm sure there are free hosting sites somewhere. 

Link to comment
Share on other sites

Hello. this should work.

 

Local $sText=BinaryToString(InetRead("https://drive.google.com/uc?id=1Cmk5-Mr10CwDcie37sb4AmhHj6D8S9C5&export=download"))
ConsoleWrite($sText & @CRLF)

Saludos

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...