From 3f3b720b6dac1f9332e99162fe7d2a0f93303c5a Mon Sep 17 00:00:00 2001 From: Matthew Ma Date: Mon, 2 Apr 2018 12:50:47 -0700 Subject: [PATCH] added MyBot.py and praw.ini --- MyBot.py | 10 ++++++++++ praw.ini | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 MyBot.py create mode 100644 praw.ini diff --git a/MyBot.py b/MyBot.py new file mode 100644 index 0000000..875e1aa --- /dev/null +++ b/MyBot.py @@ -0,0 +1,10 @@ +import praw + +reddit = praw.Reddit('bot1') +subreddit = reddit.subreddit("learnpython") + +for submission in subreddit.hot(limit=5): + print("Title: ", submission.title) + print("Text: ", submission.selftext) + print("Score: ", submission.score) + print("---------------------------------\n") \ No newline at end of file diff --git a/praw.ini b/praw.ini new file mode 100644 index 0000000..d1f2653 --- /dev/null +++ b/praw.ini @@ -0,0 +1,19 @@ +[DEFAULT] +# A boolean to indicate whether or not to check for package updates. +check_for_updates=True + +# Object to kind mappings +comment_kind=t1 +message_kind=t4 +redditor_kind=t2 +submission_kind=t3 +subreddit_kind=t5 + +# The URL prefix for OAuth-related requests. +oauth_url=https://oauth.reddit.com + +# The URL prefix for regular requests. +reddit_url=https://www.reddit.com + +# The URL prefix for short URLs. +short_url=https://redd.it -- GitLab