Viral Heat is a Social Listening platform that I use to gather research and data - in this example tweets. It has a free api, but I use the pay service.--------------070706040309000000000805-- Associated Messages, from the most recent to the oldest:
Connecting to and parsing the api is pretty straight forward. Here's the code if you want to try it out ever.
Here's my post: http://www.bastedo.com/2011/03/api-viralheat-twitter-data-pipe/
Here's the info on the API: http://www.viralheat.com/api/mentions_api
Here is a sample of the output: http://www.tenplusone.com/apis/viralHeat_twitterMentions.html
All the other Viral Heat api's are similar though each has a different slightly different path structure and output and you'll have to adjust the parsing. The is a dynamic way to create and add fields based on the parsed xml coming soon as well - probably covered before
Here is a sample of the xml that the api outputs:
<entry> <profile> <id>XXXXXX</id> <expression>XXXXXXXXX</expression> <name>XXXXXXXX</name> </profile> <tweets><tweet> <message>Suchard Hot Chocolate, T-Discs for Tassimo Coffeemakers, 8-Count Packages http://bit.ly/fzQndP</message> <platform>Twitter</platform> <date_published>Mon Mar 21 12:01:55 UTC 2011</date_published> <author>sandrahayes2010</author> <author_display_name>sandra hayes</author_display_name><link>http://twitter.com/sandrahayes2010/statuses/49802915870806016</link> <profile_link>http://twitter.com/sandrahayes2010</profile_link> <profile_image_link>http://a1.twimg.com/sticky/default_profile_images/default_profile_0_normal.png</profile_image_link> <record_hash>796b85f2-8d97-3244-af90-023290a7257e</record_hash> <positive_score>1</positive_score> <negative_score>0</negative_score><language>en</language> <tweet_contains_link>true</tweet_contains_link> </tweet></tweets></entry>
Here's the code for the archives.:
[text]errorCatch=1[/text]
[text]showVariables=1[/text]
[!]--------Function Variables-------[/!]
[text]theDOMAIN=www.viralheat.com[/text]
[text]thePATH=/api/[/text]
[text]theMethod=twitter/mentions[/text]
[text]profile_id=XXXXXXX[/text]
[text]theAPIkey=XXXXXXXXXX[/text]
[text]MyTestVariable=[!]
[/!][TCPConnect host=[theDOMAIN]][TCPSend skipheader=T]GET [thePATH][theMethod]?profile_id=[profile_id]&api_key=[theAPIkey] HTTP/1.0[UnURL]%0D%0A[/Unurl]Host: [theDOMAIN][UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend]
[/TCPConnect][/text]
[xmlparse var=xml_var2][MyTestVariable][/xmlparse]
[xmlnodes ref=xml_var2&path=named:entry]
[!]---
[name]=[value]<br />
--[/!]
[xmlnodes]
[!]---
- [name]=[value]<br />
--[/!]
[xmlnodes]
[!]---
-- [name]=[value]<br />
--[/!]
[!]-----VH_T_message----[/!]
[showif [name]=message]
[text]VH_T_message=[value][/text]
[/showif]
[!]-----VH_T_platform----[/!]
[showif [name]=platform]
[text]VH_T_platform=[value][/text]
[/showif]
[!]-----VH_T_date_published----[/!]
[showif [name]=date_published]
[text]VH_T_date_published=[value][/text]
[/showif]
[!]-----VH_T_author----[/!]
[showif [name]=author]
[text]VH_T_author=[value][/text]
[/showif]
[!]-----VH_T_author_display_name----[/!]
[showif [name]=author_display_name]
[text]VH_T_author_display_name=[value][/text]
[/showif]
[!]-----VH_T_link----[/!]
[showif [name]=link]
[text]VH_T_link=[value][/text]
[/showif]
[!]-----VH_T_profile_link----[/!]
[showif [name]=profile_link]
[text]VH_T_profile_link=[value][/text]
[/showif]
[!]-----VH_T_profile_image_link----[/!]
[showif [name]=profile_image_link]
[text]VH_T_profile_image_link=[value][/text]
[/showif]
[!]-----VH_T_record_hash----[/!]
[showif [name]=record_hash]
[text]VH_T_record_hash=[value][/text]
[/showif]
[!]-----VH_T_positive_score----[/!]
[showif [name]=positive_score]
[text]VH_T_positive_score=[value][/text]
[/showif]
[!]-----VH_T_negative_score----[/!]
[showif [name]=negative_score]
[text]VH_T_negative_score=[value][/text]
[/showif]
[!]-----VH_T_language----[/!]
[showif [name]=language]
[text]VH_T_language=[value][/text]
[/showif]
[!]-----VH_T_tweet_contains_link----[/!]
[showif [name]=tweet_contains_link]
[text]VH_T_tweet_contains_link=[value][/text]
[/showif]
[/xmlnodes]
[showif [name]=tweet]
[showif [showVariables]=1]
[!]------Show Variables----[/!]
[!]----Record to database here or do more api work -------[/!]
<strong>VH_T_message</strong>: [VH_T_message]<br />
<strong>VH_T_platform</strong>: [VH_T_platform]<br />
<strong>VH_T_date_published</strong>: [VH_T_date_published]<br />
<strong>VH_T_author</strong>: [VH_T_author]<br />
<strong>VH_T_author_display_name</strong>: [VH_T_author_display_name]<br />
<strong>VH_T_link</strong>: [VH_T_link]<br />
<strong>VH_T_profile_link</strong>: [VH_T_profile_link]<br />
<strong>VH_T_profile_image_link</strong>: [VH_T_profile_image_link]<br />
<strong>VH_T_record_hash</strong>: [VH_T_record_hash]<br />
<strong>VH_T_positive_score</strong>: [VH_T_positive_score]<br />
<strong>VH_T_negative_score</strong>: [VH_T_negative_score]<br />
<strong>VH_T_language</strong>: [VH_T_language]<br />
<strong>VH_T_VH_T_tweet_contains_link</strong>: [VH_T_tweet_contains_link]<br />
<br />
------------------------------------------------------------------------------------------------------------------<br />
[/showif]
[/showif]
[/xmlnodes]
[/xmlnodes]
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list. To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
|
Viral Heat is a Social Listening platform that I use to gather research and data - in this example tweets. It has a free api, but I use the pay service.--------------070706040309000000000805-- Olin Lagon
Connecting to and parsing the api is pretty straight forward. Here's the code if you want to try it out ever.
Here's my post: http://www.bastedo.com/2011/03/api-viralheat-twitter-data-pipe/
Here's the info on the API: http://www.viralheat.com/api/mentions_api
Here is a sample of the output: http://www.tenplusone.com/apis/viralHeat_twitterMentions.html
All the other Viral Heat api's are similar though each has a different slightly different path structure and output and you'll have to adjust the parsing. The is a dynamic way to create and add fields based on the parsed xml coming soon as well - probably covered before
Here is a sample of the xml that the api outputs:
<entry> <profile> <id>XXXXXX</id> <expression>XXXXXXXXX</expression> <name>XXXXXXXX</name> </profile> <tweets><tweet> <message>Suchard Hot Chocolate, T-Discs for Tassimo Coffeemakers, 8-Count Packages http://bit.ly/fzQndP</message> <platform>Twitter</platform> <date_published>Mon Mar 21 12:01:55 UTC 2011</date_published> <author>sandrahayes2010</author> <author_display_name>sandra hayes</author_display_name><link>http://twitter.com/sandrahayes2010/statuses/49802915870806016</link> <profile_link>http://twitter.com/sandrahayes2010</profile_link> <profile_image_link>http://a1.twimg.com/sticky/default_profile_images/default_profile_0_normal.png</profile_image_link> <record_hash>796b85f2-8d97-3244-af90-023290a7257e</record_hash> <positive_score>1</positive_score> <negative_score>0</negative_score><language>en</language> <tweet_contains_link>true</tweet_contains_link> </tweet></tweets></entry>
Here's the code for the archives.:
[text]errorCatch=1[/text]
[text]showVariables=1[/text]
[!]--------Function Variables-------[/!]
[text]theDOMAIN=www.viralheat.com[/text]
[text]thePATH=/api/[/text]
[text]theMethod=twitter/mentions[/text]
[text]profile_id=XXXXXXX[/text]
[text]theAPIkey=XXXXXXXXXX[/text]
[text]MyTestVariable=[!]
[/!][TCPConnect host=[theDOMAIN]][TCPSend skipheader=T]GET [thePATH][theMethod]?profile_id=[profile_id]&api_key=[theAPIkey] HTTP/1.0[unurl]%0D%0A[/Unurl]Host: [theDOMAIN][unurl]%0D%0A%0D%0A[/UnURL][/TCPSend]
[/TCPConnect][/text]
[xmlparse var=xml_var2][MyTestVariable][/xmlparse]
[xmlnodes ref=xml_var2&path=named:entry]
[!]---
[name]=[value]<br />
--[/!]
[xmlnodes]
[!]---
- [name]=[value]<br />
--[/!]
[xmlnodes]
[!]---
-- [name]=[value]<br />
--[/!]
[!]-----VH_T_message----[/!]
[showif [name]=message]
[text]VH_T_message=[value][/text]
[/showif]
[!]-----VH_T_platform----[/!]
[showif [name]=platform]
[text]VH_T_platform=[value][/text]
[/showif]
[!]-----VH_T_date_published----[/!]
[showif [name]=date_published]
[text]VH_T_date_published=[value][/text]
[/showif]
[!]-----VH_T_author----[/!]
[showif [name]=author]
[text]VH_T_author=[value][/text]
[/showif]
[!]-----VH_T_author_display_name----[/!]
[showif [name]=author_display_name]
[text]VH_T_author_display_name=[value][/text]
[/showif]
[!]-----VH_T_link----[/!]
[showif [name]=link]
[text]VH_T_link=[value][/text]
[/showif]
[!]-----VH_T_profile_link----[/!]
[showif [name]=profile_link]
[text]VH_T_profile_link=[value][/text]
[/showif]
[!]-----VH_T_profile_image_link----[/!]
[showif [name]=profile_image_link]
[text]VH_T_profile_image_link=[value][/text]
[/showif]
[!]-----VH_T_record_hash----[/!]
[showif [name]=record_hash]
[text]VH_T_record_hash=[value][/text]
[/showif]
[!]-----VH_T_positive_score----[/!]
[showif [name]=positive_score]
[text]VH_T_positive_score=[value][/text]
[/showif]
[!]-----VH_T_negative_score----[/!]
[showif [name]=negative_score]
[text]VH_T_negative_score=[value][/text]
[/showif]
[!]-----VH_T_language----[/!]
[showif [name]=language]
[text]VH_T_language=[value][/text]
[/showif]
[!]-----VH_T_tweet_contains_link----[/!]
[showif [name]=tweet_contains_link]
[text]VH_T_tweet_contains_link=[value][/text]
[/showif]
[/xmlnodes]
[showif [name]=tweet]
[showif [showVariables]=1]
[!]------Show Variables----[/!]
[!]----Record to database here or do more api work -------[/!]
<strong>VH_T_message</strong>: [VH_T_message]<br />
<strong>VH_T_platform</strong>: [VH_T_platform]<br />
<strong>VH_T_date_published</strong>: [VH_T_date_published]<br />
<strong>VH_T_author</strong>: [VH_T_author]<br />
<strong>VH_T_author_display_name</strong>: [VH_T_author_display_name]<br />
<strong>VH_T_link</strong>: [VH_T_link]<br />
<strong>VH_T_profile_link</strong>: [VH_T_profile_link]<br />
<strong>VH_T_profile_image_link</strong>: [VH_T_profile_image_link]<br />
<strong>VH_T_record_hash</strong>: [VH_T_record_hash]<br />
<strong>VH_T_positive_score</strong>: [VH_T_positive_score]<br />
<strong>VH_T_negative_score</strong>: [VH_T_negative_score]<br />
<strong>VH_T_language</strong>: [VH_T_language]<br />
<strong>VH_T_VH_T_tweet_contains_link</strong>: [VH_T_tweet_contains_link]<br />
<br />
------------------------------------------------------------------------------------------------------------------<br />
[/showif]
[/showif]
[/xmlnodes]
[/xmlnodes]
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list. To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
DOWNLOAD WEBDNA NOW!
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...