Wednesday, August 8, 2012

Using Twitter Search Results for #babies

Our newest project Budding Baby, includes a tab with Twitter comments from the public that contains this hashtag, #babies. Not surprisingly, when you perform a generic Twitter search about babies almost anything could come back and does.  For instance, I just performed a search using the following:

[code]http://search.twitter.com/search.json?q=%23babies[/code]

Here is one of the many results:
"U will *neva knw until *dere* is a tragedy..eii so old people also cry *lyk* #babies"

Now that's not quite what we were going for, and that tweet really isn't very positive either.  So what can we do?

Twitter to the rescue...the Search API allows you to append an extra parameter to your query to filter out negative tweets. Wonderful!  So if I run the query again, this time using the "smiley face" parameter, I get much happier tweets.

Here is the new search query:

[code]http://search.twitter.com/search.json?q=%23babies%20:)[/code]

Much happier results:
"baby love. :) #babies #cute #love #life #motherhood http://t.co/mnhrqmlL"

Have you worked with the Twitter Search API?  Leave comments below.

No comments:

Post a Comment