Spotify::Charts
A Ruby wrapper for the public Spotify Charts API to retrieve the
top 50 viral or streamed tracks on Spotify.
Installation
Add this line to your application's Gemfile:
gem 'spotify-charts'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spotify-charts
And then require:
require 'spotify/charts'
Usage
Retrieve Available Countries
Spotify::Charts.available_countries
Retrieve Available Time Window Types for a given country. The country needs to be in the format returned
by available_countries
method.
Spotify::Charts.available_time_window_types(country)
Retrieve Available Dates for a given country and time window type. The country and time window type need to be in the format returned
by .available_countries
and .available_time_window_types
methods.
Spotify::Charts.available_dates(country, time_window_type)
Retrieve Most Viral tracks for a given country, time window type and date. The country, time window type and date need to be in the
format returned by .available_countries
, .available_time_window_types
and .availabe_dates
methods.
Spotify::Charts.most_viral(country, time_window_type, date)
Retrieve Most Streamed tracks for a given country, time window type and date. The country, time window type and date need to be in
the format returned by .available_countries
, .available_time_window_types
and .availabe_dates
methods.
Spotify::Charts.most_streamed(country, time_window_type date)
Testing
The default rake
task is configured to run all tests.
rake
ZenTest
is used for continous testing. Run autotest
to start.
simplecov
is used for test coverage. Run open coverage/index.html
to open the results.
Contributing
- Fork it (https://github.com/murphyslaw/spotify-charts/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request