TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to graph total tweets about "bitcoin" in given timeframe?

3 pointsby vjvjover 11 years ago
I&#x27;m not a coder (undergrad economics) but can learn fast.<p>What I want to do is find a way of tracking tweets about bitcoin on an hourly basis.<p>The idea is to compare this with a graph of the price of bitcoin over time and see if there is any relationship between the two.<p>Why am I doing this? Mainly curiousity and improving my technical skills.<p>Any points appreciated. So far I have started learning about APIs and JSON and am trying to figure out how to use JSON feeds in a program that is good at manipulating data (i.e not my browser).

3 comments

AznHisokaover 11 years ago
Use the Twitter Search API. Yes, yes I know people say it&#x27;s not as complete as the hose, but it&#x27;s actually quite close to complete if you query it constantly without sleeping between requests. Just keep track of the MAX Tweet ID, and get tweets &gt; this ID for every request.<p>Especially for queries where there aren&#x27;t more than XXX results per minute (yes, even for terms like Bitcoin as u can see here: <a href="https://twitter.com/search?q=bitcoin&amp;src=typd&amp;f=realtime" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;search?q=bitcoin&amp;src=typd&amp;f=realtime</a>)<p>Then map those tweets to the specific hour (in epoch time for something), or even specific minute, or second if you want more granular detail. Index them to a search index like ElasticSearch or SOLR, and then do a faceted search, which will return the # of results for each time period. You can then graph this fairly easily.<p>The flaw I see in your experiment is that there&#x27;s a TON of noise in Twitter. Maybe filter out tweets by obvious spam bots (ie looking at follower&#x2F;following ratio, ignoring users who only tweet hashtags, or URLs, etc).
dylzover 11 years ago
You&#x27;ll want to use the Twitter public timeline firehose - <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/firehose" rel="nofollow">https:&#x2F;&#x2F;dev.twitter.com&#x2F;docs&#x2F;api&#x2F;1.1&#x2F;get&#x2F;statuses&#x2F;firehose</a><p>Insert any matching bitcoin into your database with the associated time. Then you can sum&#x2F;avg&#x2F;aggregate it by time (within [epoch seconds] - [epoch seconds + 3600])
评论 #6861821 未加载
makeropsover 11 years ago
There is no mechanism for search &quot;completeness&quot; without access to the fire hose.<p><a href="http://blog.cloudera.com/blog/2012/09/analyzing-twitter-data-with-hadoop/" rel="nofollow">http:&#x2F;&#x2F;blog.cloudera.com&#x2F;blog&#x2F;2012&#x2F;09&#x2F;analyzing-twitter-data...</a><p>^ that is a good resource if you ever get access to the firehose.<p>Shoot me an email anthony@makerops.com, and when I get home I can shoot you an email with some example code that Ive written in the past.