Advertisement
Guest User

Untitled

a guest
Nov 1st, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. #!/usr/bin/env python
  2. print "Content-type: text/html\n\n"
  3. print "Hello CGI\n"
  4.  
  5. import praw
  6.  
  7. reddit = praw.Reddit(client_id='client-id' ,
  8.                      client_secret='clientsecret' ,
  9.                      username='username' ,
  10.                      password='password' ,
  11.                      user_agent='useragent')
  12.  
  13.  
  14. subreddit = reddit.subreddit('futurology')
  15.  
  16. hot_futurology = subreddit.hot(limit=20)
  17.  
  18. for submission in hot_futurology:
  19.     if not submission.stickied:
  20.        print('Title: {}, url: {} '                              .format (submission.title,
  21.                                                                          submission.url))
  22. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement