[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 the profile of a twitter user - say - location, or description etc. I have a db that I search 350 results on, once appended, I flip a variable so that I skip it for the next update. Set up a trigger to do 350 an hour all the time . . . Twitter Call - add an addfields call to all of these types of loops to record eveything to your db. If the response is in JSON and it's straight forward, then you're looking at list words with loops to unest the nested name:value pairs. [text]MyTestVariable=[TCPConnect host=twitter.com&port=80][TCPSend skipheader=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 - without giving away the whole farm, you can combine many of these and some other stuff to really dig into what people are saying. Use your imagination - it really depends on what you are looking for too. [!]---------------Start Function checkForBitly------------------------------------[/!] [function name=checkForBitly] [text]bitlyPresent=[FindString source=[theTweet]&find=http://bit.ly][/text] [showif [bitlyPresent]>0] [text]theLink=[Middle StartAfter=http://bit.ly&EndBefore=][theTweer][/Middle][/text] theLink: http://bit.ly[theLink]
[/showif] [/function] [!]---------------End Function checkForBitly------------------------------------[/!] 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 charging for it. [text]MyTestVariable=[TCPConnect host=twitalyzer.com&port=80][TCPSend skipheader=T]GET /api/v1.asp?k=47CB2C62-F692-45C9-BC3A-B17672AF9E43&u=[screen_name]&f=xml HTTP/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]
[AddFields db=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace] [text]preName=[name][/text] [xmlnodeattributes] -- [name]=[value]
[AddFields db=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:

    
  1. [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 the profile of a twitter user - say - location, or description etc. I have a db that I search 350 results on, once appended, I flip a variable so that I skip it for the next update. Set up a trigger to do 350 an hour all the time . . . Twitter Call - add an addfields call to all of these types of loops to record eveything to your db. If the response is in JSON and it's straight forward, then you're looking at list words with loops to unest the nested name:value pairs. [text]MyTestVariable=[TCPConnect host=twitter.com&port=80][TCPSend skipheader=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 - without giving away the whole farm, you can combine many of these and some other stuff to really dig into what people are saying. Use your imagination - it really depends on what you are looking for too. [!]---------------Start Function checkForBitly------------------------------------[/!] [function name=checkForBitly] [text]bitlyPresent=[FindString source=[theTweet]&find=http://bit.ly][/text] [showif [bitlyPresent]>0] [text]theLink=[Middle StartAfter=http://bit.ly&EndBefore=][theTweer][/Middle][/text] theLink: http://bit.ly[theLink]
[/showif] [/function] [!]---------------End Function checkForBitly------------------------------------[/!] 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 charging for it. [text]MyTestVariable=[TCPConnect host=twitalyzer.com&port=80][TCPSend skipheader=T]GET /api/v1.asp?k=47CB2C62-F692-45C9-BC3A-B17672AF9E43&u=[screen_name]&f=xml HTTP/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]
[AddFields db=databases/twitterInformation.db]twitalyzer_[name]=[/addfields] [replace db=databases/twitterInformation.db&eqIDdatarq=[ID]]twitalyzer_[name]=[value][/replace] [text]preName=[name][/text] [xmlnodeattributes] -- [name]=[value]
[AddFields db=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:

StoreBuilder and PayPal (2002) Navigator 4.01 (1997) Search Result refinement help (2003) mac hack (1997) Documentation Feedback (1997) Quick ShowIf question (1997) Re[2]: Weird [blank] interpretation (1999) Re:Emailer and encryption (1997) WebCatalog for Postcards ? (1997) Location of Webcat site in folder hierarchy (1997) apparent variable variable display? (2000) ImageMap (1997) emailer (1997) [WebDNA] Sending 100 mails an hour then pausing (2010) pulldown menu differences (2005) WebCat2 beta 11 - new prefs ... (1997) international time (1997) One other big addition... (1997) Multiple Pulldowns (1997) WebCat for mass emailings (1997)