Skip to content

Instantly share code, notes, and snippets.

@zakwilson
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakwilson/bbeea90610e454d116af to your computer and use it in GitHub Desktop.
Save zakwilson/bbeea90610e454d116af to your computer and use it in GitHub Desktop.
import praw
r = Reddit(user_agent = 'Test app by /u/zak with PRAW')
r.login(username=username, password=password)
messages = r.get_inbox()
with open('inbox.txt', 'rw') as outfile:
while message = messages.next():
outfile.write("Author: %s\n" % message.author.name)
outfile.write("Subject: %s\n" % message.subject)
outfile.write("Body:\n%s\n\n" % message.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment