Skip to content

Instantly share code, notes, and snippets.

@adyrcz
Last active November 26, 2015 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adyrcz/ff6f54b777b82ff455d2 to your computer and use it in GitHub Desktop.
Save adyrcz/ff6f54b777b82ff455d2 to your computer and use it in GitHub Desktop.
Ruby: Grab webpage title
#!/usr/bin/env ruby
#Usage: "ruby mechtest.rb http://testsite.com"
require 'mechanize'
input_url = ARGV.first
mechanize = Mechanize.new
page = mechanize.get(input_url)
puts page.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment