Skip to content

Instantly share code, notes, and snippets.

@hyuki
Last active March 10, 2020 00:20
Embed
What would you like to do?
url-markdown.rb - URL to Markdown
#! /usr/bin/env ruby
require 'mechanize'
if ARGV.length != 1
abort("Usage: url-markdown URL")
end
url = ARGV[0]
if !url.match(/^http/)
url = "https://" + url
end
agent = Mechanize.new
page = agent.get(url)
puts "- [#{page.title}](#{url})"
# vim: set filetype=ruby:
@hyuki
Copy link
Author

hyuki commented Mar 9, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment