Coder Social home page Coder Social logo

tmdb_party's Introduction

tmdb_party

Simple ruby wrapper to themoviedb.org (api.themoviedb.org/2.0/docs/) using HTTParty

usage:

gem install tmdb_party
require 'rubygems'
require 'tmdb_party'

example:

@tmdb = TMDBParty::Base.new('key')
results = @tmdb.search('transformers')

results.length
  # => 5

transformers = results.detect{|m| m.name == "Transformers"}

transformers.popularity
  # => 31
transformers.score
  # => 1.0
transformers.imdb_id
  # => 'tt0418279'

# some attributes don't come back with the search result, they are lazily loaded on demand
transformers.homepage
  # => "http://www.transformersmovie.com/"
transformers.trailer.url
  # => "http://www.youtube.com/watch?v=eduwcuq1Exg"

transformers.genres.collect{|cat| cat.name}.include?("Adventure")
  # => true

recent additions:

# Support for browsing movies http://api.themoviedb.org/2.1/methods/Movie.browse
@tmdb.browse({:query => 'Transformers')

# Support for looking up Media info based on the file hash
# http://api.themoviedb.org/2.1/methods/Media.getInfo
@tmdb.get_file_info(file)

# Support for Language Tags http://api.themoviedb.org/2.1/language-tags
# All methods support an optional locale as the final method parameter
@tmdb.search('transformers', 'fr')

what is themoviedb.org?

It’s a movie database, kind of like IMDB except it’s more of a community wiki. They also have an api that they’re cool with people using. More on the api here: api.themoviedb.org/2.1

Contributors

Jon Maddox (github.com/maddox)

Magnus Bergmark (github.com/Mange)

Brian Lopez (github.com/brianmario)

Federico Ravasio (github.com/razielgn)

Copyright © 2011 John Duff. See LICENSE for details.

tmdb_party's People

Contributors

brianmario avatar jduff avatar maddox avatar mange avatar razielgn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.