Coder Social home page Coder Social logo

twittertop's Introduction

Twitter Topword Tracker

This tool follows a twitter stream and prints out the most frequently encountered words over the given reporting frequency.

This is related to a concept we gave to a customer who wanted to solve this problem a while back. This is a significantly scaled down version, but it can exercise a server pretty hard by doing the following:

What it Does

Count Words

Every tweet that comes in is split into the words that make it up and those words are counted within the tweet. Each word is then incremented against the current time window.

Maintain Top Lists

Also after each tweet, we maintain the top 1,000 words. In order to do this, we do a cas loop where we get the current list, do a giant multi-get of the union of all of the words currently in the list and all of the words we just found to find their current counts, then update the list with this value. The cas frequently fails, and will likely fail more with more -workers.

Reporting

Based on the -interval parameter, a report will be sent to stdout showing the top of the top list. That's currently just a simple get and in-memory ops.

Doing More

In general, twitter only provides a 1% stream of tweets. Using the -multiplier parameter, you can send every tweet through multiple times such that -multipler=100 should approximately equal the traffic of all of twitter (though the words being processed would vary, etc...).

twittertop's People

Contributors

dustin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.