This is a simple and easy Ruby wrapper for YIFY's API.
Add this line to your application's Gemfile:
gem 'yify', github: 'juangesino/yify'
And then execute:
$ bundle
# Use methods to generate your query:
y = Yify.parameter_method('YOUR-PARAMETER-VALUE').other_parameter_method('YOUR-OTHER-PARAMETER-VALUE')
# Send the query and get a response:
r = y.go
# Create an object with the parameters you want:
y = Yify.search('Social')
# Now get the response:
r = y.go
# How many matches for that search?
r.movie_count
# => 3
# So let's print the names of the movies:
r.movies.each do |movie|
puts movie.title_long
end
# => "Antisocial (2013)"
# => "Social Nightmare (2013)"
# => "The Social Network (2010)"
# All in one line:
Yify.search('Social Network').go.movies.first.title_long
# => "The Social Network (2010)"
For a list of parameters check the API docs
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Created by Juan Gesino
- Fork it ( https://github.com/juangesino/yify/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