Skip to content

Instantly share code, notes, and snippets.

@ZuluagaSD
Created December 4, 2012 00:00
Show Gist options
  • Save ZuluagaSD/4199216 to your computer and use it in GitHub Desktop.
Save ZuluagaSD/4199216 to your computer and use it in GitHub Desktop.
FireFilms Script
require 'rubygems'
require 'nokogiri'
require 'open-uri'
@url = "http://www.icefilms.info/"
@doc = Nokogiri::HTML(open(@url))
shows = ["Two and a Half Men", "Undercover Boss US", "The Big Bang Theory", "The Walking Dead"]
def get_shows(shows)
puts @doc.at_css("title").text
puts @doc.xpath('//div[@id="fp_articles"]/h1').text
@doc.xpath('//div[@id="fp_articles"]/p/a/img').each_with_index do |item, i|
break if i == 150
shows.each do |show|
if item['alt'].eql? show
# puts item['alt']
puts item
shows.delete(show)
end
end
end
end
get_shows(shows)
<img src="http://img26.imageshack.us/img26/6670/walkingdead2.png" alt="The Walking Dead">
<img src="http://img696.imageshack.us/img696/5779/tmpb3ed.png" alt="Undercover Boss US">
<img src="http://img801.imageshack.us/img801/6424/twohalfmen.png" alt="Two and a Half Men">
<img src="http://img148.imageshack.us/img148/1307/tmp1b39.png" alt="The Big Bang Theory">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment