Skip to content

Instantly share code, notes, and snippets.

@xzenf
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save xzenf/d0693a61e734b09a6cb4 to your computer and use it in GitHub Desktop.

Select an option

Save xzenf/d0693a61e734b09a6cb4 to your computer and use it in GitHub Desktop.

Revisions

  1. Alex revised this gist Aug 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Gilded comments
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,4 @@ count = 0
    for comment in sub:
    count += comment.gilded

    print("Total gold is: {}".format(count))
    print("Total gold is: {}".format(count))
  2. Alex created this gist Aug 17, 2014.
    12 changes: 12 additions & 0 deletions Gilded comments
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import praw

    r = praw.Reddit('Counting gilded/1.0')
    sub = r.get_submission(submission_id='28j8cz')
    sub.replace_more_comments(limit=None, threshold=0)
    sub = praw.helpers.flatten_tree(sub.comments)

    count = 0
    for comment in sub:
    count += comment.gilded

    print("Total gold is: {}".format(count))