Help us understand the problem. What is going on with this article?


More than 5 years have passed since last update.

Gistの貼り付けタグは で、 document.writeオン・パレードです。これでは、検索にインデックスに反映されないし、なによりdocument.writeは嫌過ぎるので、gistの貼り付けタグから、貼り付け用のHTMLタグを生成することにした。

!/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 '<link rel="stylesheet" href=""/>'
 puts data["div"]
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away