Code Monkey home page Code Monkey logo

congressional-tweets's People

Contributors

ghing avatar

Watchers

 avatar  avatar

congressional-tweets's Issues

Stream tweets from the API

It's my understanding that the timeline endpoints give you a subset of tweets while the streaming API lets you capture all (or more?) of the tweets.

Besides, don't we want to be informed in real time?

To do:

  • Better handling of killing the app, probably using signal
  • Use systemd to supervise and optionally restart the tweet streamer and loader
  • Write command to stream tweets
  • Write command to display streamed tweets
  • Write command to load streamed tweets
  • Deploy everything

search_tweets command is slow

Running the search_tweets command takes a long time:

time congressional_tweets search_tweets ".*Town Hall.*"
real    1m30.557s
user    0m2.980s
sys     0m0.168s

Even when specifying the --since-id option, it's pretty slow:

time congressional_tweets search_tweets --since-id 869255179597697024  ".*Town Hall.*" 
real    0m34.698s
user    0m0.388s
sys     0m0.060s

Proposed solution

At this point, I think using Text Search will offer better performance than using an index.

Tasks

  • Create a text index. Migrations help make this explicit, so do this using migrations
  • Update search_tweets command to use a $search query instead of a regex.

Add date or id filter for search_tweets command

Once a significant number of tweets start appearing in the database, the performance of search_tweets degrades since it returns all matching tweets in the database. Add a way to filter on date, or if that doesn't work, on tweet ID since they're incremental to speed up searches and limit the number of results.

Tweets not being saved in database

Searching the tweets of Appalachian reps shows the latest Tweet as being May 25. I first noticed this on Friday or Saturday of last week (May 26 or May 27).

I've tried restarting the services:

sudo service stream_tweets restart
sudo service load_streamed_tweets restart

I also confirmed that the stream_tweets service was running by running the display_streamed_tweets command and got output.

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.