[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:
Upgrading old WebCat Database Files (1997)
Almost a there but..bye bye NetCloak (1997)
SQLCONNECT (2005)
form data submission gets truncated (1997)
modified storedbuilder (was: show me your store) (2003)
What do you charge? (1998)
Nested tags count question (1997)
RE: Signal Raised (1997)
Appending Record Prob (2001)
Convert Chars Q (2000)
BW in a search (2007)
Expected Behavior? (1999)
WebCat2b12 forgets serial # (1997)
WebCatalog [FoundItems] Problem - AGAIN - (1997)
Re:2nd WebCatalog2 Feature Request (1996)
Better Stability, Better Performance, Bugs are dead/ Gone (2000)
Am I going senile? (Price recalc based on quantity) (1997)
Copyright that puppy (1998)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
WebCat2b13MacPlugIn - [shownext method=post] ??? (1997)