Project

simplecast

0.01
No commit activity in last 3 years
No release in over 3 years
Simple wrapper for Simplecast podcasting service.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
>= 0

Runtime

~> 0.1
 Project Readme

Simplecast

Note: This gem is untested and currently unmaintained.

With Simplecast being under new leadership, I've spoken with their team about upcoming API changes. Instead of focusing on developing this gem more completely under the current API, I've chosen to wait until the new changes are released. This gem (or a version of it, anyway) powers Spec.fm, but I recommend testing thoroughly. Optionally, use Simplecast's already-supported RSS feed as a reliable (albeit limited) alternative.

Simplecast is awesome. So is Ruby. Use them both. Profit.

Note: Publishing is not currently supported by the Simplecast API, and thus is also not supported by this gem. It probably will be one day. Who knows?

Installation

Add this line to your application's Gemfile:

gem 'simplecast'

And then execute:

$ bundle

Or install it yourself as:

$ gem install simplecast

Usage

Set up the gem in a config file (if you're using Rails, just add something like a simplecast.rb in initializers).

Right now, there are only two config options: api_key and podcast_id. Your API key can be found in your account settings.

Your podcast_id is in the URL for your account, and is likely just a number.

Simplecast.configure do |c|
  c.api_key "Your_api_key_here"
  c.podcast_id "Your_podcast_id_here"
end

Next, you can access Podcasts, Episodes, and Statistics like this:

# Episodes
Simplecast::Client::Episode.all # gets all podcasts, as long as podcast_id was set in the config
Simplecast::Client::Episode.all(podcast_id) # gets all podcasts, as long as podcast_id was set in the config
Simplecast::Client::Episode.find(episode_id)
Simplecast::Client::Episode.find(episode_id, podcast_id)

# Podcast
Simplecast::Client::Podcast.all
Simplecast::Client::Podcast.find(podcast_id)

# Statistics
# the overall method takes timeframe parameters as defined at https://api.simplecast.com - /podcasts/:podcast_id/statistics/overall.json 
Simplecast::Client::Statistic.overall(podcast_id, options:{})

# returns listener stats. /podcasts/:podcast_id/statistics.json
Simplecast::Client::Statistic.all(podcast_id)

# returns stats for a given episode. Takes timeframe params. /podcasts/:podcast_id/statistics/episode.json
Simplecast::Client::Statistic.for_episode(episode_id, podcast_id: nil, opts: {})

Contributing

  1. Fork it ( https://github.com/jcutrell/simplecast/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request