Skip to content

Instantly share code, notes, and snippets.

@mbuckbee
Created January 31, 2011 07:06
Show Gist options
  • Save mbuckbee/803729 to your computer and use it in GitHub Desktop.
Save mbuckbee/803729 to your computer and use it in GitHub Desktop.
Parses the BoingBoing JSON data dump pulling post titles and writing them to a new file.
require 'rubygems'
require 'yajl'
file = File.new('bbPosts.json', 'r') # file with more than one json
# Boing Boing Titles
parser = Yajl::Parser.new
parser.parse(file) do |file|
file.each do |post|
puts post["title"].to_s
open('boingboing_titles.txt', 'a') { |f|
f.puts post["title"].to_s
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment