Created
January 31, 2011 07:06
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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