Last active
April 9, 2016 00:34
-
-
Save MaxPleaner/94f567450ccc12406e79568bf8b42afb to your computer and use it in GitHub Desktop.
ruby method to get reddit inbox
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
comments = RedditKit::Client.new(REDDIT_USERNAME, REDDIT_PASSWORD).messages.results | |
puts comments.first(5).map(&:attributes).map do |obj| | |
<<-TXT | |
#{obj[:link_title]} (#{obj[:subreddit]}) | |
#{obj[:body]} - #{obj[:author]} | |
http://reddit.com#{obj[:context]} | |
TXT | |
end.join("\n\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment