Skip to content

Instantly share code, notes, and snippets.

%% Alexander Napper
clear all;
clc;
MIN_CHOICE = 15; % Really shouldn't hard code
load Water_Data;
choices_ = Water_Data.Properties.VarNames(3:end);
choices_betternames = {'Freshwater suppled (million cubic meters)', 'Yearly precipitation (million cubic meters)', 'Renewable fresh water (million cuic meters)', 'Population percent with water', 'Population percent connected to waste water collection', 'Population percent conneted to water treatment'};
assert(length(choices_) == length(choices_betternames));
choice = menu('Data choices:', choices_betternames);
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