6

How do I get a count of the number of times a Twitter hashtag is used or mentioned in a 24-hour period?

An example use is the Livestrong/BreakCancer world record attempt. I'd like to tally the number of times the use of a hashtag is made in order to have some record on its proliferation.

3
  • Do you want to get the list of all the hashtags created in the last 24 hrs?
    – dsr
    Commented Jan 8, 2011 at 5:44
  • @Deepak no I think he wants the number (the count) of mentions a specific hashtag gets in 24 hours.
    – phwd
    Commented Jan 10, 2011 at 0:09
  • This website will work... topsy.com It's the best option I found.
    – user10547
    Commented Apr 29, 2011 at 8:54

4 Answers 4

4
+500

Check out Trendistic or What the Hashtag?! (you need to register for this one but it is free)

EDIT 1

Tredistic has the option to switch between 24hrs, 7 days, 30 days, 90 or 180 days. However, after looking at Trendistic again it appears to only display the percentage not the actual number of tweets. What the Hashtag splits tweets in to days over a 7 day period, displaying the number of tweets on the graph.

EDIT 2

I have been looking at Twitter API documentation and it seems to me that there wouldn't really be a 100% reliable way to get all of the mentions of a hashtag.

These are my observations after reading the API docs:

  • History is only available for 7 days.
  • When using the Search API you can specify dates as parameters but not times. I am presuming that the API would convert 09/01/2011 to 09/01/2011 00:00:00 but I can't be sure
  • Not all tweets are available via the API. Presumably because some of them will be protected.
  • You can only return a certain number of tweets with API calls. So if you have a particularly successful hashtag which spread across Twitter you wouldn't be able to retrieve the actual number of tweets anyway.
3
  • Trendistic gives a graph over a 30 day period (I have not seen any numbers though) on the other hand what the hash tag gives tweet statistics over a 7 day period so you would just have to continuously monitor it.
    – phwd
    Commented Jan 9, 2011 at 22:12
  • @phwd - Tredistic has the option to switch between 24hrs, 7 days, 30 days, 90 or 180 days. However, after looking at Trendistic again it appears to only display the percentage not the actual number of tweets. What the Hashtag splits tweets in to days over a 7 day period, displaying the number of tweets on the graph. Commented Jan 10, 2011 at 7:47
  • @phwd - Just added some observations regarding the Twitter API. Thanks for the previous edit. Commented Jan 10, 2011 at 13:59
2

Check out HashtagBattle

0

Friend of mine built this app called trends24. This one gives you worldwide trends in the past 24 hours along with a hour-by-hour trends

0

You need to do this :

  1. Use twitter's streaming API to get realtime tweets.
  2. Extract the "text" out of the JSON you get from the API
  3. Extract the hashtags from the text, ( if you are using ruby , you can find gems for this)
  4. Convert hashtags to uppercase, so you don't miss hashtags with mixed cases.
  5. Filter these hashtags to find the hashtag you want to parse
  6. Feed these hashtags to a rolling counter which has timewindow buckets which look like this : [bucket] => count. The buckets are cyclic , ie , you'll clear the count in the first bucket and use it as the next bucket if you are switching from the last bucket

You should have processes running with big time concurrency if you are planning to parse the streaming api's that fetch you all the tweets. You can use [Storm] for this.

I've put together an app that does something similar. I've open sourced it and you can find it here: http://www.emilsoman.com/tweetness . I looked at Tweitgeist and made this as my POC, it's basically a fork, removed a few things and added some of my own , like a Sinatra app for web UI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.