Created
June 5, 2013 00:55
-
-
Save cbartlett/5710866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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