@@ -65,13 +65,19 @@ def __init__(self,projection, user):
65
65
66
66
def get_frequencies (self ):
67
67
print "Processing User " + self .userName
68
- for comment in self .userObject .get_comments (limit = self .projection .thing_limit ):
69
- self .subredditFrequencies .add_frequency (str (comment .subreddit .display_name .strip (' ' ).lower ()), 1.0 )
68
+ while True :
69
+ try :
70
+ #for comment in self.userObject.get_comments(limit=100):
71
+ for comment in self .userObject .get_comments (limit = self .projection .thing_limit ):
72
+ self .subredditFrequencies .add_frequency (str (comment .subreddit .display_name .strip (' ' ).lower ()), 1.0 )
73
+ if str (comment .subreddit .display_name .strip (' ' ).lower ()) is str (self .projection .subreddit .display_name .strip (' ' ).lower ()):
74
+ self .projection .totalComments += 1
75
+ self .totalComments += 1
76
+ break
77
+ except :
78
+ print "error..."
70
79
71
- if str (comment .subreddit .display_name .strip (' ' ).lower ()) is str (self .projection .subreddit .display_name .strip (' ' ).lower ()):
72
- self .projection .totalComments += 1
73
80
74
- self .totalComments += 1
75
81
76
82
class Projection :
77
83
def __init__ (self , subredditName , thing_limit ):
@@ -85,7 +91,12 @@ def __init__(self, subredditName, thing_limit):
85
91
self .commentorNames = []
86
92
87
93
def get_comments (self ):
88
- self .comments = list (self .subreddit .get_comments (limit = self .thing_limit ))
94
+ while True :
95
+ try :
96
+ self .comments = list (self .subreddit .get_comments (limit = self .thing_limit ))
97
+ break
98
+ except :
99
+ print "error..."
89
100
90
101
def register_subreddit_frequency (self , subredditName , frequency ):
91
102
if subredditName in self .subredditFrequencies .frequencies :
0 commit comments