typeleven Posted May 29, 2008 Posted May 29, 2008 I want to use curl to make and get twitter updates. There is a command line version of curl that will return the results I want. Is it possible to run a dos program and then stick the results into a variable? Can I use the libcurl.dll? if I can use the dll how do I find out what commands the dll will process?Lib curl:http://curl.haxx.se/libcurl/Twitter api:http://groups.google.com/group/twitter-dev...ntation#EasyWay
PsaltyDS Posted May 29, 2008 Posted May 29, 2008 I want to use curl to make and get twitter updates. There is a command line version of curl that will return the results I want. Is it possible to run a dos program and then stick the results into a variable? Can I use the libcurl.dll? if I can use the dll how do I find out what commands the dll will process?Lib curl:http://curl.haxx.se/libcurl/Twitter api:http://groups.google.com/group/twitter-dev...ntation#EasyWayYou can Run() with the $STDOUT_CHILD flag and then read it with StdOutRead(). See the help file.You can also RunWait() and redirect the output to a file with " > FileName.txt" in the command line, then parse the file. See the help file.See the help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
nobbe Posted June 2, 2008 Posted June 2, 2008 i have done something similar using wget to retrieve a webpage and then store results into a variable (search in example scripts for it) . i am shure it can be adapted to curl too.http://www.autoitscript.com/forum/index.ph...925&hl=wget
NiVZ Posted January 23, 2009 Posted January 23, 2009 (edited) Realise this is an old post, but I've only recently used Twitter. You could use the XMLHTTP object to do this. This way you get the status code back to know if it's worked or not and the data is returned in the .ResponseText It's also pure AutoIT code so no need for a command line tool. Here's a quick example: ; Setup HTTP object $objHTTP = ObjCreate("Microsoft.XMLHTTP") ; Setup a GET to retrieve data from Twitter (you can use POST to send data)- in this case search for posts with 'twitter' and return in Atom format $objHTTP.open ("GET", "http://search.twitter.com/search.atom?q=twitter", false) ; Execute the Request $objHTTP.send () ; Check the status code of the request $StatusCode = $objHTTP.status ; If everything is OK then If $StatusCode = 200 Then ; Get the data that is returned - in this case xml of search results $strReturn = $objHTTP.responseText MsgBox(0, "Result", $strReturn) Else ; Something went wrong MsgBox(16, "Error", "HTTP Status Code: " & $StatusCode) EndIf NiVZ Edited January 23, 2009 by NiVZ
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