[WebDNA] API - get Twitter information & Twitilyzer (before it went $)
This WebDNA talk-list message is from 2011
It keeps the original formatting.
numero = 106438
interpreted = N
texte = This is for an unauthenticated call and is limited to 350 calls an hour.This is the basic call for all unathenticated Twitter calls. Search,hashtag etc.I use it in conjunction with some other api - say - augmenting theprofile of a twitter user - say - location, or description etc.I have a db that I search 350 results on, once appended, I flip avariable so that I skip it for the next update. Set up a trigger to do350 an hour all the time . . .Twitter Call - add an addfields call to all of these types of loops torecord eveything to your db.If the response is in JSON and it's straight forward, then you'relooking at list words with loops to unest the nested name:value pairs.[text]MyTestVariable=[TCPConnect host=twitter.com&port=80][TCPSendskipheader=T]GET /users/show.xml?screen_name=[author_name]HTTP/1.0[UnURL]%0D%0A[/Unurl]Host:twitter.com[UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend][/TCPConnect][/text][xmlparse var=xml_var1][MyTestVariable][/xmlparse][xmlnodes ref=xml_var1&path=named:user][showif [index]=1][text]theID=[value][/text][/showif][hideif [value]=] [replace db=[pagePath]databases/twitterInformation.db&eqIDdatarq=[theID]&append=t]id=[theID]&dateNum=[math]{[date]}[/math]&timeNum=[math]{[time]}[/math]&[name]=[value][/replace]
[index]. [name]: [value]
[/hideif][/xmlnodes] [WaitForFile file=FileToWaitFor.tx&timeout=1] Waiting 1 second, hopefully!
[/WaitForFile] [/showif]------This is a sample funtion for how to take a part a tweet - withoutgiving away the whole farm, you can combine many of these and someother stuff to really dig into what people are saying. Use yourimagination - it really depends on what you are looking for too.[!]---------------Start FunctioncheckForBitly------------------------------------[/!][function name=checkForBitly] [text]bitlyPresent=[FindString source=[theTweet]&find=http://bit.ly][/text] [showif [bitlyPresent]>0] [text]theLink=[MiddleStartAfter=http://bit.ly&EndBefore=][theTweer][/Middle][/text] theLink: http://bit.ly[theLink]
[/showif][/function][!]---------------End FunctioncheckForBitly------------------------------------[/!]This is for twitilyzer - when it was free. It's not free and now is$100 a month - I am sure it has changed since they started chargingfor it.[text]MyTestVariable=[TCPConnect host=twitalyzer.com&port=80][TCPSendskipheader=T]GET/api/v1.asp?k=47CB2C62-F692-45C9-BC3A-B17672AF9E43&u=[screen_name]&f=xmlHTTP/1.0[UnURL]%0D%0A[/Unurl]Host:twitalyzer.com[UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend][/TCPConnect][/text][xmlparse var=xml_var1][MyTestVariable][/xmlparse][xmlnodes ref=xml_var1&path=named:entry][showif [value]^error] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_CheckIT=2&twitalyzer_upDated=[theDateNum][/replace][/showif][hideif [value]^not found]
[name]: [value]
[AddFields db=databases/twitterInformation.db]twitalyzer_CheckIT=&twitalyzer_upDated=[/addfields] &eqIDdatarq=[ID]]twitalyzer_CheckIT=YES&twitalyzer_upDated=[theDateNum]
[replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_CheckIT=2&twitalyzer_upDated=[theDateNum][/replace] [AddFields db=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace] [xmlnodes] - [name]=[value]
[AddFieldsdb=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace] [text]preName=[name][/text] [xmlnodeattributes] -- [name]=[value]
[AddFieldsdb=databases/twitterInformation.db]twitalyzer_[preName]_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[preName]_[name]=[value][/replace] [/xmlnodeattributes] [/xmlnodes]
[/hideif][showif [index]/2] [WaitForFile file=FileToWaitFor.tx&timeout=1] Waiting 1 second, hopefully!
[/WaitForFile] [/showif][/xmlnodes]
Associated Messages, from the most recent to the oldest:
| |
- [WebDNA] API - get Twitter information & Twitilyzer (before it went $) (David Bastedo 2011)
|
This is for an unauthenticated call and is limited to 350 calls an hour.This is the basic call for all unathenticated Twitter calls. Search,hashtag etc.I use it in conjunction with some other api - say - augmenting theprofile of a twitter user - say - location, or description etc.I have a db that I search 350 results on, once appended, I flip avariable so that I skip it for the next update. Set up a trigger to do350 an hour all the time . . .Twitter Call - add an addfields call to all of these types of loops torecord eveything to your db.If the response is in JSON and it's straight forward, then you'relooking at list words with loops to unest the nested name:value pairs.
[text]MyTestVariable=[TCPConnect host=twitter.com&port=80][TCPSendskipheader=T]GET /users/show.xml?screen_name=[author_name]HTTP/1.0
[unurl]%0D%0A[/Unurl]Host:twitter.com
[unurl]%0D%0A%0D%0A[/UnURL][/TCPSend][/TCPConnect][/text][xmlparse var=xml_var1][MyTestVariable][/xmlparse][xmlnodes ref=xml_var1&path=named:user][showif [index]=1]
[text]theID=[value][/text][/showif][hideif [value]=] [replace db=[pagePath]databases/twitterInformation.db&eqIDdatarq=[theID]&append=t]id=[theID]&dateNum=
[math]{
[date]}[/math]&timeNum=
[math]{
[time]}[/math]&[name]=[value][/replace]
[index]. [name]: [value]
[/hideif][/xmlnodes] [WaitForFile file=FileToWaitFor.tx&timeout=1] Waiting 1 second, hopefully!
[/WaitForFile] [/showif]------This is a sample funtion for how to take a part a tweet - withoutgiving away the whole farm, you can combine many of these and someother stuff to really dig into what people are saying. Use yourimagination - it really depends on what you are looking for too.
[!]---------------Start FunctioncheckForBitly------------------------------------[/!][function name=checkForBitly]
[text]bitlyPresent=[FindString source=[theTweet]&find=http://bit.ly][/text] [showif [bitlyPresent]>0]
[text]theLink=[MiddleStartAfter=http://bit.ly&EndBefore=][theTweer][/Middle][/text] theLink: http://bit.ly[theLink]
[/showif][/function]
[!]---------------End FunctioncheckForBitly------------------------------------[/!]This is for twitilyzer - when it was free. It's not free and now is$100 a month - I am sure it has changed since they started chargingfor it.
[text]MyTestVariable=[TCPConnect host=twitalyzer.com&port=80][TCPSendskipheader=T]GET/api/v1.asp?k=47CB2C62-F692-45C9-BC3A-B17672AF9E43&u=[screen_name]&f=xmlHTTP/1.0
[unurl]%0D%0A[/Unurl]Host:twitalyzer.com
[unurl]%0D%0A%0D%0A[/UnURL][/TCPSend][/TCPConnect][/text][xmlparse var=xml_var1][MyTestVariable][/xmlparse][xmlnodes ref=xml_var1&path=named:entry][showif [value]^error] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_CheckIT=2&twitalyzer_upDated=[theDateNum][/replace][/showif][hideif [value]^not found]
[name]: [value]
[AddFields db=databases/twitterInformation.db]twitalyzer_CheckIT=&twitalyzer_upDated=[/addfields] &eqIDdatarq=[ID]]twitalyzer_CheckIT=YES&twitalyzer_upDated=[theDateNum]
[replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_CheckIT=2&twitalyzer_upDated=[theDateNum][/replace] [AddFields db=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace]
[xmlnodes] - [name]=[value]
[AddFieldsdb=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace]
[text]preName=[name][/text] [xmlnodeattributes] -- [name]=[value]
[AddFieldsdb=databases/twitterInformation.db]twitalyzer_[preName]_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[preName]_[name]=[value][/replace] [/xmlnodeattributes] [/xmlnodes]
[/hideif][showif [index]/2] [WaitForFile file=FileToWaitFor.tx&timeout=1] Waiting 1 second, hopefully!
[/WaitForFile] [/showif][/xmlnodes]
David Bastedo
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
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...
Related Readings:
Proposed FormVariables hierarchy (2000)
NT or Mac (1997)
PSC recommends what date format yr 2000??? (1997)
WebCatalog for guestbook ? (1997)
remotely add + sign (1997)
what run level should S90WebCatalog be at? (2003)
Re:Searching for ALL / empty form field *the FINAL answer* (1997)
problems with 2 tags shakur (1997)
taxrate - off by 1 cent (1997)
[WebDNA] FreeBSD (2009)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
Don't tick me off :) [elaspedtime] (1997)
WebCatalog can't find database (1997)
Fun with Dates - revisited (1997)
BBEdit/HTMLcomments/WebCat/[/FONT] (1999)
Attention all list readers (1997)
It just Does't add up!!! (1997)
WCS Newbie question (1997)
WebMerchant when CC network is down - bug? (1998)
Size limit for tmpl editor ? (1997)