[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:
Expected Behavior? (1999)
Error: SQL not supported (2001)
Associative lookup style? + bit more (1997)
[WebDNA] Build Name for 6.1 (2008)
Server slowing down. (1997)
Feature Request: [moverecord] (2003)
Multiple shipping databases (1997)
[WebDNA] Barcode (2014)
WebCat2 - [format thousands] (1997)
More on the email templates (1997)
suggestions for a Windows based text editor? (2004)
WebCatalog for guestbook ? (1997)
Form based Redirect (2001)
[movefile] create stationery files (1998)
taxrate - off by 1 cent (1997)
Search returns all, not 20 (1997)
Another form question (2000)
syntax question, not in online refernce (1997)
[WebDNA] WebDNA hosting (2012)
4.51 Triggers (2003)