Created
October 3, 2013 02:06
-
-
Save loganhasson/6803589 to your computer and use it in GitHub Desktop.
reddit.formatting
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
while true | |
system("clear") | |
longest_upvote = 0 | |
Post::POSTS.each do |post| | |
if post.upvotes.to_s.length > longest_upvote | |
longest_upvote = post.upvotes.to_s.length | |
end | |
end | |
Post::POSTS.each do |post| | |
puts post.id.red + ' ' + post.upvotes.to_s.center(longest_upvote, " ").green + ' ' + post.title[0..60].black | |
end | |
path = $stdin.gets.chomp | |
if path == 'exit' | |
break | |
else | |
Post.launch_story(path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment