GithubHelp home page GithubHelp logo

mbilotti / hashtag_aggregator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twitter-archive/commons

1.0 1.0 0.0 107.17 MB

Simple demo counting hashtags on the public stream

Home Page: https://github.com/mbilotti/hashtag_aggregator

License: Other

Shell 0.21% CSS 0.61% JavaScript 0.88% Java 54.46% Python 43.00% Smalltalk 0.26% Scala 0.58%

hashtag_aggregator's Introduction

Hashtag aggregator demo

== Usage  ==

To bundle the app, drop your config file in hashtag_aggregator/conf, then:
$ ./pants goal clean-all bundle -- hashtag_aggregator --bundle-archive=zip

Please note that the first time you bundle or create the IntelliJ project, it may take a long time to download all the dependencies.

To open the project in IntelliJ:
$ ./pants goal clean-all idea -- tests/java/com/twitter/hashtag_aggregator:: --idea-project-name=hashtag_aggregator

To run the unit tests:
$ ./pants goal clean-all test tests/java/com/twitter/hashtag_aggregator::

To run using the streaming API:

$ cd dist/hashtag_aggregator-bundle
$ java -jar hashtag_aggregator.jar -http_port=8080 -config_file=conf/<your file>

To run using a local snapshot file:

$ cd dist/hashtag_aggregator-bundle
$ java -jar hashtag_aggregator.jar -http_port=8080 -replay_snapshot_file=<snapshot file>

To test the rest API, point your browser at:

  http://localhost:8080/api/model.json

You may notice that there's a ton of noise, near-duplicates, etc.
That's the part you need to figure out!

Additonal useful command-line switches:

  -tweet_log_interval=N : logs every Nth tweet consumed to the screen
  -snapshot_replay_tps=N : control speed of snapshot replay, in tweets per second

== Process Stats ==

To view the process' stats, go to http://localhost:8080/vars
Some interesting stats include:

  msg_queue_depth : number of tweets consumed from the stream (or snapshot) waiting to be processed
  tweets_consumed : total count of tweets consumed

== Static assets ==

The in-process HTTP server can serve static assets for you, for example: http://localhost:8080/public/static.txt
Files should be placed under src/resources/com/twitter/hashtag_aggregator/api (alongside static.txt)
See src/java/com/twitter/hashtag_aggregator/api/ApiModule.java for how to bind the resources to paths.

By default, the in-process HTTP server will also serve Bootstrap and JQuery for you, for example: http://localhost:8080/js/jquery.min.js
See src/java/com/twitter/common/webassets/bootstrap/BootstrapModule.java and
src/java/com/twitter/common/webassets/jquery/JQueryModule.java for more the complete list of paths.
See http://getbootstrap.com/2.3.2/ and http://api.jquery.com/ for useful documentation on these libraries.

== Config file format ==

A Java Properties file having the following keys:

consumerKey=
consumerSecret=
token=
secret=

hashtag_aggregator's People

Contributors

jsirois avatar ryan-williams avatar benjyw avatar foursquare-markcc avatar florianleibert avatar wickman avatar leothekim avatar kushal avatar eric avatar lowasser avatar danielatdattrixdotcom avatar orsenthil avatar wfarner avatar yashnan avatar jonboulle avatar

Stargazers

Vasu avatar

Watchers

Matthew Bilotti 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.