Skip to content

Instantly share code, notes, and snippets.

Created Aug 17, 2012
What would you like to do?
gistの貼り付けタグのScriptからHTMLにする。 ref:
#!/usr/bin/env ruby
require 'openssl'
require 'open-uri'
require 'rubygems'
require 'json'
if ARGV.size < 1 || ! (/([0-9]+)/ =~ ARGV[0])
puts "Usage : Gist のIDを指定。"
puts "以下のように指定"
puts " #{__FILE__} "
puts " #{__FILE__} "
puts " #{__FILE__} "
puts " #{__FILE__} 3033059 "
id = $1
json = open("{id}.json").read
data = JSON.load json
puts '<style>'
puts 'div.highlight{ background-color: #FFFFFF !important;}' #はてなダイアリーとかぶるので。
puts open('').read
puts '</style>'
puts data["div"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment