An app to pull the now-playing data from Sirius XM and provide Spotify links for the songs. It uses a Postgres database with Sphinx for searching.
To regularly (every 2 minutes) pull the Sirius XM timestamp, there's a Sidekiq (which is backed by Redis) worker that is run by Clockwork. This worker gets the current playlist and saves it to the database, then rebuilds the search indices if needed. So, to run the app, you need to:
- Start Solr
- Start Redis
- Start Sidekiq
- Start Clockwork
Instructions on each are below.
To start Solr:
bundle exec rake sunspot:solr:start
...and to stop it (obviously):
bundle exec rake sunspot:solr:stop
To reindex all object (only needed if you changes to an object's 'searchable' schema):
bundle exec rake sunspot:solr:reindex
To launch Redis (after installing it with Homebrew)
redis-server /usr/local/etc/redis.conf
To start Sidekiq
bundle exec sidekiq
To flush the Sidekiq queue (from rails console on Heroku):
Heroku run rails console
Sidekiq.redis {|r| r.flushall }
To start clockwork
clockwork lib/clockwork.rb
- Why does most recent sometimes come up blank?
Add Sidekiq interface so you can check the queue, make sure workers are stacking up.
Confirm that workers are failing quietly and not hammering the Sirius XM servers.
Add time-specific searching for tracks
Sometimes most_recent tracks comes up blank.
Refactor lots of the view stuff into partials (like the track listing)
jbuilder? memcache?
Google analytics
Make tables sortable