Skip to content

Instantly share code, notes, and snippets.

@Pringley
Created November 29, 2012 21:28
Show Gist options
  • Save Pringley/4172029 to your computer and use it in GitHub Desktop.
Save Pringley/4172029 to your computer and use it in GitHub Desktop.
Reddit Maitred Applicance
import reddit
# Connect to Reddit API.
r = reddit.Reddit(user_agent='maitred-reddit')
while True:
# Get request from user.
words = raw_input().split()
subreddit = words[1]
amount = int(words[2]) if len(words) >= 3 else 5
# Print results from the specified subreddit.
results = r.get_subreddit(subreddit).get_hot(limit=amount)
for result in results:
print(str(result))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment