Can now fetch link and comment karma of user
Link and comment karma of user can be fetched with {link_karma} and {comment_karma} if username is set.
This commit is contained in:
parent
4e8dd82792
commit
f696cb5989
@ -28,6 +28,8 @@ class Reddit(IntervalModule):
|
||||
* {message_author}
|
||||
* {message_subject}
|
||||
* {message_body}
|
||||
* {link_karma}
|
||||
* {comment_karma}
|
||||
|
||||
"""
|
||||
|
||||
@ -131,6 +133,14 @@ class Reddit(IntervalModule):
|
||||
title = fdict["submission_title"][:(self.title_maxlen - 3)] + "..."
|
||||
fdict["submission_title"] = title
|
||||
|
||||
if self.username:
|
||||
u = r.get_redditor(self.username)
|
||||
fdict["link_karma"] = u.link_karma
|
||||
fdict["comment_karma"] = u.comment_karma
|
||||
else:
|
||||
fdict["link_karma"] = ""
|
||||
fdict["comment_karma"] = ""
|
||||
|
||||
full_text = self.format.format(**fdict)
|
||||
self.output = {
|
||||
"full_text": full_text,
|
||||
|
Loading…
Reference in New Issue
Block a user