Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import time
- import praw
- START = time()
- reddit = praw.Reddit(
- password='______',
- username='______',
- client_id='______',
- client_secret='______',
- user_agent='script:pentest.bot.script:v0.0.1:/u/______',
- )
- """
- from pprint import pprint
- pprint(dir(submission))
- ['approved_by',
- 'archived',
- 'author',
- 'author_flair_css_class',
- 'author_flair_text',
- 'banned_by',
- 'clear_vote',
- 'clicked',
- 'comment_limit',
- 'comment_sort',
- 'comments',
- 'contest_mode',
- 'created',
- 'created_utc',
- 'delete',
- 'distinguished',
- 'domain',
- 'downs',
- 'downvote',
- 'duplicates',
- 'edit',
- 'edited',
- 'flair',
- 'fullname',
- 'gild',
- 'gilded',
- 'hidden',
- 'hide',
- 'hide_score',
- 'id',
- 'id_from_url',
- 'is_self',
- 'likes',
- 'link_flair_css_class',
- 'link_flair_text',
- 'locked',
- 'media',
- 'media_embed',
- 'mod',
- 'mod_reports',
- 'name',
- 'num_comments',
- 'num_reports',
- 'over_18',
- 'parse',
- 'permalink',
- 'post_hint',
- 'preview',
- 'quarantine',
- 'removal_reason',
- 'reply',
- 'report',
- 'report_reasons',
- 'save',
- 'saved',
- 'score',
- 'secure_media',
- 'secure_media_embed',
- 'selftext',
- 'selftext_html',
- 'shortlink',
- 'spoiler',
- 'stickied',
- 'subreddit',
- 'subreddit_id',
- 'suggested_sort',
- 'thumbnail',
- 'title',
- 'unhide',
- 'unsave',
- 'ups',
- 'upvote',
- 'url',
- 'user_reports',
- 'visited']
- """
- def handle(submission):
- """
- Disposition the content however you need.
- See comment block above for available methods
- and attributes on the submission object
- Example:
- print(submission.author.name)
- :param submission: PRAW submission object
- :return: None
- """
- pass
- def main():
- for submission in reddit.subreddit('openpentesting').stream.submissions():
- if submission.created_utc < START:
- continue
- handle(submission)
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment