Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created October 22, 2013 06:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitode909/7096161 to your computer and use it in GitHub Desktop.
Save hitode909/7096161 to your computer and use it in GitHub Desktop.
ランダムなLGTMをクリップボードにコピーするやつ
#! /usr/bin/env ruby
# Copy random LGTM to clipboard
require 'open-uri'
require 'nokogiri'
require 'shellwords'
doc = Nokogiri open('http://www.lgtm.in/g')
lgtm = doc.at('textarea').text
if `which pbcopy`.length > 0
system "echo #{Shellwords.escape(lgtm)} | pbcopy"
end
puts lgtm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment