Jump to content

use cURL to make and get twitter updates


Recommended Posts

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

Link to comment
Share on other sites

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

You 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
Link to comment
Share on other sites

  • 7 months later...

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 by NiVZ
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...