Beispiel #1
0
rdb = RedditDB("mciot", "r3dd1tmorgane", "blacksun.cs.mcgill.ca", 31050, "reddit_topics")

### subreddit_collection ####
print "=========subreddit_collection========="
num_subreddits = rdb.num_subreddits()
print "Total number of subreddits:", num_subreddits
print ""

#### submission_collection ####
print "=========submission_collection========="
num_submissions = rdb.num_submissions()
print "Total number of submissions:", num_submissions
print "Average number of submissions/subreddit:", (float(num_submissions) / float(num_subreddits))
print ""
print "Number of cross-posted submissions:", rdb.num_xposts()
print "Number of subreddits involved in xposts: TODO" 
print ""
print "Number of submissions with links:", rdb.num_linked_submissions()
print "Number of submissions with links and no text:", rdb.num_only_linked_submissions()
print "Number of submissions with links where link content was crawled:", rdb.num_followed_submissions()
print ""
print "Stats by month: TODO"
print ""

#### comment_collection #### 
print "=========comment_collection========="
num_comments = rdb.num_comments()
print "Total number of comments:", num_comments
print "Average number of comments/submission:", (float(num_comments) / float(num_submissions))
print ""