[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:
Major Security Hole (solution with Welcome) (1998)
Showif, Hideif reverse logic ? (1997)
WebCat2b12plugin - [search] is broken ... not! (1997)
WebDNA error. (2006)
creating a 60 fields database (1997)
too many nested [xxx] (1997)
HomePage Caution (1997)
Running _every_ page through WebCat ? (1997)
WebDNA 5.1 and Mac OS X Server v10.3 - Working ??? (2003)
Press Release hit the NewsWire!!! (1997)
Running on Empty (1999)
Why do extra quotation marks sometimes appear in my databases? (1998)
WebCat2b13MacPlugIn - More limits on [include] (1997)
creating an email message (1998)
OFF TOPIC: help wanted (1997)
unique ascending numbers (2003)
[OT] Robust order processing (2003)
CyberCash, Authorize.net, or ??? (2000)
WebCatalog NT beta 18 problem (1997)
Combining search criteria (2000)