Commit bf5caf6a authored by Matthew Ma's avatar Matthew Ma

finished part 1

parent 3f3b720b
Guide:
http://pythonforengineers.com/build-a-reddit-bot-part-1/
To install Python 2.7:
https://www.python.org/downloads/release/python-2714/
To install pip:
https://pip.pypa.io/en/stable/installing/
-> download get-pip.py
To install praw, use the following command:
pip install praw
\ No newline at end of file
#!/usr/bin/python
import praw
reddit = praw.Reddit('bot1')
subreddit = reddit.subreddit("learnpython")
for submission in subreddit.hot(limit=5):
print("Title: ", submission.title)
for submission in subreddit.hot(limit=2):
print("Title: ", submission.title)
print("Text: ", submission.selftext)
print("Score: ", submission.score)
print("---------------------------------\n")
\ No newline at end of file
......@@ -17,3 +17,10 @@ reddit_url=https://www.reddit.com
# The URL prefix for short URLs.
short_url=https://redd.it
[bot1]
client_id=1Vx7MiwBKAvqOA
client_secret=TWC1yH1t_9pYivUmDUw0vitO8d4
password=P2.71828182i
username=IneffableApophasis
user_agent=PyEng Bot 0.1
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment