Hopefully someone (RokuChris?) has messed with this and can help a little. I am trying to send a tweet. I am able to retrieve tweets from a home_timeline or a certain #hashtag no problem. The main difference in sending is its POST instead of GET, and I am not yet able to translate/get the Oauth functions from the SDK Twitter example to attach the authorization the way it does for retrieving timelines.
Here is the working part that gets the timeline:
http = NewHttp("https://api.twitter.com/1.1/statuses/home_timeline.json")
oa = Oauth()
oa.sign(http,true)
rsp = http.getToStringWithTimeout(10)
And here is what i have so far that POSTs without the Oauth attached
strx = screen.GetText()
oa = Oauth()
GT = CreateObject("roUrlTransfer")
GT.SetPort(m.port)
GT.SetURL("https://api.twitter.com/1.1/statuses/update.json" )
http = NewHttp(GT.GetURL())
oa.sign(http,true)
out= GT.AsyncPostFromString( "status=" + strx)
print out
print http
In the above example "print out" returns "true" and "print http" returns an array with "base:
https://api.twitter.com/1.1/statuses/update.json" as the first item.
I am having trouble understanding what NewHttp() is in the above examples, it looks like a function, but i cant find it anywhere, just references to it.
Kind of stuck, would appreciate any ideas, thanks
here is the complete return from "print http"
base: https://api.twitter.com/1.1/statuses/update.json
checktimeout: <bsTypedValue: Function>
gettostringwithretry: <bsTypedValue: Function>
retries: 1
dump: <bsTypedValue: Function>
callbackprep: <bsTypedValue: Function>
sync: <bsTypedValue: Function>
protected: true
getparams: <bsTypedValue: Function>
parse: <bsTypedValue: Function>
timer: <Component: roTimespan>
prep: <bsTypedValue: Function>
port: invalid
go: <bsTypedValue: Function>
gettostringwithtimeout: <bsTypedValue: Function>
retry: <bsTypedValue: Function>
receive: <bsTypedValue: Function>
ok: <bsTypedValue: Function>
paramgroup: <bsTypedValue: Function>
addallparams: <bsTypedValue: Function>
removeparam: <bsTypedValue: Function>
anchor:
accessverifier: false
postfromstringwithtimeout: <bsTypedValue: Function>
timestamp: <Component: roTimespan>
wait: <bsTypedValue: Function>
timeout: 5000
addparam: <bsTypedValue: Function>
cancel: <bsTypedValue: Function>
geturl: <bsTypedValue: Function>
label: init
method: GET
"
Kinetics Screensavers