Skip to content

Instantly share code, notes, and snippets.

@hitode909 hitode909/lgtm
Created Oct 22, 2013

Embed
What would you like to do?
ランダムな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
You can’t perform that action at this time.