Background Tasks & Rails – A Sidekiq Example

This post involves a little bit of everything–queuing (Sidekiq), JSON, API calls, redis, database manipulation. Enjoy!

The latest feature I am pushing to Dotawithme is listing the players by who is currently online. This is an oft requested feature (with good reason – DOTA players are impatient) but I wasn’t entirely sure what the best way to go about this was.

Of course I couldn’t just hammer Valve’s Steam API or I would quickly hit my daily limit. This means I need to create a background process to run at set intervals and update the database accordingly. There are many different gems to help your Rails app out with this and I settled on Sidekiq (‘Sidekick’) because it’s fast and (supposedly) simple to use.

Continue reading

Tweet Random Quotes with Ruby

I recently started using Buffer with my Twitter account in the hopes that I would be more active by queuing up my tweets in advance.  One of the great things about Buffer is that it offers suggestions on things you might want to post.  Often times they have quotes in their suggestions and since I am a big fan of quotes I decided to write my own tool to just publish quotes.

Continue reading