Skip to content

Instantly share code, notes, and snippets.

@documentcloud
Created October 25, 2009 22:04
Show Gist options
  • Save documentcloud/218275 to your computer and use it in GitHub Desktop.
Save documentcloud/218275 to your computer and use it in GitHub Desktop.
class Scrape < CloudCrowd::Action
# Extract the title from an HTML page.
def process
html = File.read(input_path)
match = html.match(/<title>(.*)<\/title>/i)
match ? match[1] : "Untitled"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment