Created
August 11, 2012 17:20
-
-
Save kristianfreeman/3325844 to your computer and use it in GitHub Desktop.
App.net backup
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
# requires "appnet.json" (exported from ADN) in the same folder | |
require 'json' | |
require 'date' | |
json = File.read('appnet.json') | |
parsed = JSON.parse(json) | |
f = File.new("appdotnet.txt", "a") | |
parsed["posts"].each { |elem| | |
date = DateTime.parse(elem["created_at"]) | |
text = <<-eos | |
#{elem["text"]} | |
#{date.strftime('%B %e, %Y at %I:%M')} | |
https://alpha.app.net/#{elem["user"]["username"]}/post/#{elem["id"]} | |
- - - - - | |
eos | |
f << text | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment