Skip to content

Instantly share code, notes, and snippets.

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")