Skip to content
Pulling "now playing" data from Sirius XM
Ruby CSS JavaScript Other
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
autotest
config
db
doc
features
lib
log
public
script
solr/conf
spec
vendor/assets
.env
.gitignore
.rspec
.ruby-gemset
.ruby-version
Capfile
Gemfile
Gemfile.lock
Guardfile
Procfile
README.md
Rakefile
clock.rb
config.ru

README.md

SpotXM

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:

  1. Start Solr
  2. Start Redis
  3. Start Sidekiq
  4. Start Clockwork

Instructions on each are below.

Solr and Sunspot

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

Redis

To launch Redis (after installing it with Homebrew)

redis-server /usr/local/etc/redis.conf

Sidekiq

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 }

Clockwork

To start clockwork

clockwork lib/clockwork.rb

Development Notes

Outstanding Issues / To Dos

  • 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

Something went wrong with that request. Please try again.