Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
doc = Nokogiri::XML(data)
@vinodkd
vinodkd / import.rb
Last active December 17, 2015 11:19 — forked from ngauthier/import.rb
Since my posts had single and double quotes AND colons in the title, the original import.rb would fail when jekyll tried to read the yaml frontmatter. So instead of using an array and a string template, I changed the code to use a map and .to_yaml'd it. to_yaml produces the leading --- by default, so I appended the trailing one :)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'yaml'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@vinodkd
vinodkd / about.md
Created August 10, 2011 05:04 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer