[jsonResponse][/showif][!]>>> ------------------------------------> ### Set up Json Parse Convert table ###>> [/!][table name=jsonParseConvert&fields=from,to]> "> : => [/table][!]>>> ------------------------------------> ### Parse Json ###>> [/!][listwords> words=[url][jsonResponse][/url]&delimiters={},][text][convertwords> table=jsonParseConvert][word][/convertwords][/text][/listwords][!]>>> ## debug info ##> [/!][showif [debug]=T]
[access_token][/showif][!]>>> ------------------------------------> ### Connect and pull down tweets - write to json file ###>> [/!][writefile file=client.json][!]>> [/!][TCPConnect host=api.twitter.com&port=443&ssl=T][!]> [/!][TCPSend skipheader=T]GET> /1.1/statuses/user_timeline.json?screen_name=[screen_name]&count=[count]&include_rts=[include_rts]> HTTP/1.1[CRLF][!]> [/!]Host: api.twitter.com[CRLF][!]> [/!]User-Agent: DigRevs Twitter App v1[CRLF][!]> [/!]Authorization: Bearer [access_token][CRLF][CRLF][/TCPSend][!]> [/!][/TCPConnect][!]>> [/!][/writefile][!]>>> ------------------------------------> ### Close restrict to 15 mins showif ###>> [/!][/showif]>>> Complete>> --------------------------------------------------------- This message is> sent to you because you are subscribed to the mailing list **. To> unsubscribe, E-mail to: ** archives:> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us>-- David BastedoTen Plus One Communications Inc.http://www.10plus1.com416.277.4499--485b3970d220fc489304e34b4f32Content-Type: text/html; charset=ISO-8859-1Content-Transfer-Encoding: quoted-printable
David,H=i - here you go. =A0 It's very slow (maybe Twitter are rate limiting) s=o I use a trigger it to periodically write a json file to disk. =A0 You'=;ll need to set up a Twitter App on their developer site and get a key/secr=et.- Tom[!]<!-- HAS_WEBDNA_TAGS -->[/!][!] ------------------------------------### =A0Restrict trigger t=o 15 minute intervals =A0###[/!][showif [time %M]=\15][!]------------------------------------### =A0Set Variables =A0#=##[/!][text]con_key=3D[url]xxxxxxxxx[/url][/text]=[!] App Consumer Key[/!][text]con_secret=3D[url]xxxxxxxxx[/url][=/text][!] App Consumer Secret[/!][text]screen_name=3D[url]target-handle[/url][/text]=[!] Twitter account we are targeting[/!][text]count=3D6[/text][!=] Number of Tweets to return[/!][text]include_rts=3D1[/text][!] =Set to 1 if retweets are to be included[/!][text]CRLF=3D[unurl]%0D%0A[/unurl][/text][!] CRLF V=ariable[/!][text]debug=3DF[/text][!] Show debug fields------------------------------------### =A0Get OAuth Credenti=als =A0###[/!][text]content=3Dgrant_type=3Dclient=_credentials[/text][!][/!][text]jsonResponse=3D[T=CPConnect host=3Dapi.t=witter.com&port=3D443&ssl=3DT][!][/!][tcpsend skipheader=3DF]POST /oauth2/token HTTP/1.1[CRLF][!]=[/!]Host: api.twi=tter.com[CRLF][!][/!]User-Agent: Your-Twitter-App-Name[CRLF]=[!][/!]Authorization: Basic [encrypt method=3DBase64][con_key]:[con_secre=t][/encrypt][CRLF][!][/!]Content-type: application/x-www-form-urlencoded;charset=3DUTF-8[CR=LF][!][/!]Content-Length: [countchars][content][/countchars][CRL=F][CRLF][!]Accept-Encoding: gzip[crlf][crlf][/!][!][/!][content][CRLF][!][/!][/tcpsend][/tcpconnect][/text][!]## debug info ##[/!][showif [debug]=3DT]<=;h3>OAuth Json Response</h3><pre>[jsonResponse]&l=t;/pre>[/showif][!]=span>------------------------------------### =A0Set up Json Parse Convert table =A0###[/!][table name=3DjsonParseConvert&fields=3Dfrom,to=]":==3D[/table][!]=span>------------------------------------### =A0Parse Json =A0###[/!][listwords words=3D[url][jsonResponse][/url]&delimiters=3D{},][text=][convertwords table=3DjsonParseConvert][word][/convertwords][/text][/listw=ords][!]## debug info ##[/!][showif [debug]=3DT]<h3>OAuth Access Token</h3><pre>[access_token]</pre>[/showif][!]=----------=--------------------------=### =A0Connect and pull down tweets - write to json file =A0###[/!][writefile file=3Dclient.json][!][/!][TCPConnect host==3Dapi.twitter.com=&port=3D443&ssl=3DT][!][/!][TCPSend skipheader==3DT]GET /1.1/statuses/user_timeline.json?screen_name=3D[screen_name]&c=ount=3D[count]&include_rts=3D[include_rts] HTTP/1.1[CRLF][!]=[/!]Host: api.twitter.com[CRLF][!][/!]User-Agent: DigRevs =Twitter App v1[CRLF][!]=span>[/!]Authorization: Bearer [access_token][CRLF][CRLF][/TCPSend][!][/!][/TCPConnect][!][/!][/writefile][!]------------------------=------------### =A0Close restrict to =15 mins showif =A0###[/!][/showif]
=Complete ---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: suppo=rt@webdna.us
Ten Plus One Communic=ations Inc.
http://=www.10plus1.com
416.277.4499
|
[jsonResponse][/showif][!]>>> ------------------------------------> ### Set up Json Parse Convert table ###>> [/!][table name=jsonParseConvert&fields=from,to]> "> : => [/table][!]>>> ------------------------------------> ### Parse Json ###>> [/!][listwords> words=[url][jsonResponse][/url]&delimiters={},][text][convertwords> table=jsonParseConvert][word][/convertwords][/text][/listwords][!]>>> ## debug info ##> [/!][showif [debug]=T]
[access_token][/showif][!]>>> ------------------------------------> ### Connect and pull down tweets - write to json file ###>> [/!][writefile file=client.json][!]>> [/!][TCPConnect host=api.twitter.com&port=443&ssl=T][!]> [/!][TCPSend skipheader=T]GET> /1.1/statuses/user_timeline.json?screen_name=[screen_name]&count=[count]&include_rts=[include_rts]> HTTP/1.1[CRLF][!]> [/!]Host: api.twitter.com[CRLF][!]> [/!]User-Agent: DigRevs Twitter App v1[CRLF][!]> [/!]Authorization: Bearer [access_token][CRLF][CRLF][/TCPSend][!]> [/!][/TCPConnect][!]>> [/!][/writefile][!]>>> ------------------------------------> ### Close restrict to 15 mins showif ###>> [/!][/showif]>>> Complete>> --------------------------------------------------------- This message is> sent to you because you are subscribed to the mailing list **. To> unsubscribe, E-mail to: ** archives:> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us>-- David BastedoTen Plus One Communications Inc.http://www.10plus1.com416.277.4499--485b3970d220fc489304e34b4f32Content-Type: text/html; charset=ISO-8859-1Content-Transfer-Encoding: quoted-printable
David,H=i - here you go. =A0 It's very slow (maybe Twitter are rate limiting) s=o I use a trigger it to periodically write a json file to disk. =A0 You'=;ll need to set up a Twitter App on their developer site and get a key/secr=et.- Tom------------------------------------### =A0Restrict trigger t=o 15 minute intervals =A0###[/!][showif [time %M]=\15][!]------------------------------------### =A0Set Variables =A0#=##[/!][text]count=3D6[/text][!=] Number of Tweets to return------------------------------------### =A0Get OAuth Credenti=als =A0###[/!][tcpsend skipheader=3DF]POST /oauth2/token HTTP/1.1[CRLF][!]=[/!]Host: api.twi=tter.com[CRLF][!][/!]User-Agent: Your-Twitter-App-Name[CRLF]=[!][/!]Authorization: Basic [encrypt method=3DBase64][con_key]:[con_secre=t][/encrypt][CRLF][!][/!]Content-type: application/x-www-form-urlencoded;charset=3DUTF-8[CR=LF][!][/!]Content-Length: [countchars][content][/countchars][CRL=F][CRLF][!]Accept-Encoding: gzip[crlf][crlf][/!][!][/!][content][CRLF][!][/!][/tcpsend][/tcpconnect][/text][!]## debug info ##[/!][showif [debug]=3DT]<=;h3>OAuth Json Response</h3><pre>[jsonResponse]&l=t;/pre>[/showif][!]=span>------------------------------------### =A0Set up Json Parse Convert table =A0###[/!][table name=3DjsonParseConvert&fields=3Dfrom,to=]":==3D[/table][!]=span>------------------------------------### =A0Parse Json =A0###[/!][listwords words=3D[url][jsonResponse][/url]&delimiters=3D{},][text=][convertwords table=3DjsonParseConvert][word][/convertwords][/text][/listw=ords][!]## debug info ##[/!][showif [debug]=3DT]<h3>OAuth Access Token</h3><pre>[access_token]</pre>[/showif][!]=----------=--------------------------=### =A0Connect and pull down tweets - write to json file =A0###[/!][writefile file=3Dclient.json][!][/!][TCPConnect host==3Dapi.twitter.com=&port=3D443&ssl=3DT][!][/!][TCPSend skipheader==3DT]GET /1.1/statuses/user_timeline.json?screen_name=3D[screen_name]&c=ount=3D[count]&include_rts=3D[include_rts] HTTP/1.1[CRLF][!]=[/!]Host: api.twitter.com[CRLF][!][/!]User-Agent: DigRevs =Twitter App v1[CRLF][!]=span>[/!]Authorization: Bearer [access_token][CRLF][CRLF][/TCPSend][!][/!][/TCPConnect][!][/!][/writefile][!]------------------------=------------### =A0Close restrict to =15 mins showif =A0###[/!][/showif]
=Complete ---------------------------------------------------------This message is sent to you because you are subscribed tothe mailing list .To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.usBug Reporting: suppo=rt@webdna.us
Ten Plus One Communic=ations Inc.
http://=www.10plus1.com
416.277.4499
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...