%Gettweet: A New SAS Macro to Fetch and Summarize Tweets

From sasCommunity
Jump to: navigation, search

Abstract

The role of Twitter as a source of valuable information for spotting trends has been much talked about in the popular press. The open API in Twitter makes it one of the most sought after platforms for textual data analysis. While SAS® Text Miner provides a robust method for analyzing textual data, the challenge remains to fetch customized Tweets and clean textual data before any text mining. This paper develops and discusses a new SAS® macro that can be used easily to fetch the Tweets a researcher wants from Twitter. The macro uses the search API in Twitter and the HTTP procedure in SAS to create a data set of Tweets that are customized using parameters such as combination of keywords, exact phrases, omission of specific words, and so on. The macro also purges terms such as http tags and URLs that might create problems in text mining. This paper also shows a visual analysis of “retweets” to identify influencers via network visualization graphs that are available in SAS/GRAPH® software.

Online Materials

View the pdf for %Gettweet: A New SAS Macro to Fetch and Summarize Tweets.

After SAS Global Forum 2011, I used the macro to collect tweets for the hash word #SASGF11 between 04-07 Apr. SAS Datasets of Tweets and the summary reports generated by the %gettweet macro on a daily basis can be accessed from File:SASGF11 Tweets.zip You can use the tweets in your analysis or use the macro to fetch tweets on any other topic using custom search terms.

You can also access the presentation used for this paper from File:324-2011.ppt

Further resources

Contact Info

Visit Satish Garla's user page.