Giter Club home page Giter Club logo

myimdb's Introduction

myimdb

Utility gem for fetching movie details.

Usage

Command line

Command line info for a movie

~> myimdb
Usage: myimdb [movie name]
    -h, --help                       Displays this help info
    -r, --rottentomatoes             Generates data from Rotten Tomatoes
    -m, --metacritic                 Generates data from Metacritic
    -b, --freebase                   Generates data from Freebase
    -i, --imdb                       Generates data from Imdb
~> myimdb the dark knight -i -b
====================================================
Imdb details for: the dark knight
====================================================
Directors       : Christopher Nolan
Writers         : Jonathan Nolan, Christopher Nolan
Rating          : 8.9
Votes           : 430594
Genres          : Action, Crime, Drama, Thriller
Tagline         : Why So Serious?
Plot            : Batman, Gordon and Harvey Dent are forced to deal with the chaos (truncated)...
Year            : 2008
Release_date    : 2008-07-18
====================================================
Freebase details for: the dark knight
====================================================
Directors       : Christopher Nolan
Writers         : Bob Kane, Christopher Nolan, Jonathan Nolan, Jerry Robinson, Bill Finger
Rating          : 
Votes           : 
Genres          : Superhero, Action, Crime fiction, Evil clown
Tagline         : Welcome to a world without rules.
Plot            : The Dark Knight is a 2008 superhero crime thriller film directed (truncated)...
Year            : 2008
Release_date    : 2008-07-16

Catalogue a movie directory

~/m> ls
the dark knight
~/m> myimdb-catalogue 
Usage: myimdb-catalogue [movie name]
    -h, --help                       Displays this help info
    -f, --force                      Force generate data even if already present
    -m, --metadata                   Generates metadata (renames folders)
    -i, --images                     Generates images (works properly only on windows)
    -r, --recursive                  Generate data on all the directories given in current directory
    -a, --apply-icon                 Finds first jpg or png in the folder and converts it to movie icon
~/m> myimdb-catalogue the\ dark\ knight/ 
Fetching metadata for: the dark knight
Renaming: the dark knight to: the dark knight [2008] [8.9,430594] [Christopher Nolan]
~/m> ls
the dark knight [2008] [8.9,430594] [Christopher Nolan]

As a library

>> require 'myimdb'
=> true
>> search_result = Myimdb::Search::Google.search_text('the dark knight', :restrict_to=> 'imdb.com')[0]
=> {:url=>"http://www.imdb.com/title/tt0468569/", :title=>"The Dark Knight (2008)"}
>> site = Myimdb::Scraper::Imdb.new(search_result[:url])
=> #<Myimdb::Scraper::Imdb:0x10227b160 @url="http://www.imdb.com/title/tt0468569/">
>> site.rating
=> 8.9
>> site.votes
=> 430594
>> site.release_date.to_s
=> "2008-07-18"
>> require 'myimdb'
=> true
>> movie = ImdbMovie.search('the dark knight')
=> #<Myimdb::Scraper::Imdb:0x10225b9f0 @url="http://www.imdb.com/title/tt0468569/">
>> movie.rating
=> 8.9

Copyright © 2009 Gaurav Sharma. See LICENSE for details.

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.