Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Forked from Sinceretear/gist:9700945
Last active August 29, 2015 13:57
Show Gist options
  • Save luckyruby/9700975 to your computer and use it in GitHub Desktop.
Save luckyruby/9700975 to your computer and use it in GitHub Desktop.
class FooController < ApplicationController
require 'rubygems'
require 'mechanize'
require 'open-uri'
def scrape
url = 'http://www.hotnewhiphop.com/archive/'
agent = Mechanize.new
page = agent.get(url)
render text: page.links.map(&:to_html).join("\n")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment