Skip to content

Instantly share code, notes, and snippets.

@cbartlett
Created June 5, 2013 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbartlett/5710866 to your computer and use it in GitHub Desktop.
Save cbartlett/5710866 to your computer and use it in GitHub Desktop.
$ ruby imdb-bot.rb http://www.imdb.com/title/tt0106856/
Detected IMDB link for movie "Falling Down".
[Can I Stream It?](http://www.canistream.it/search/movie/Falling%20Down)
require 'imdb'
require 'uri'
link = ARGV.first
id = link.match(/\/tt([\d]*)/)[1]
movie = Imdb::Movie.new(id)
title = movie.title
search_link = "http://www.canistream.it/search/movie/" + URI.encode(title)
comment = <<-COMMENT
Detected IMDB link for movie "#{title}".
[Can I Stream It?](#{search_link})
COMMENT
puts comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment