From 0aa466632177ab89708f00838a1ec2ef90681bf4 Mon Sep 17 00:00:00 2001 From: Christopher Su Date: Sun, 10 Aug 2014 01:06:21 -0700 Subject: [PATCH] review requests --- CHANGES.txt | 1 + quora/pyquora.py | 7 ++++++- setup.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 15fa901..e0496a5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,4 @@ +v0.1.3, 26 July 2014 -- Added review requests to activity. v0.1.2, 26 July 2014 -- Fixed to work with new Quora UI. v0.1.1, 26 July 2014 -- Readme. v0.1.0, 26 July 2014 -- Initial release. \ No newline at end of file diff --git a/quora/pyquora.py b/quora/pyquora.py index 4c0a0dd..cab9374 100644 --- a/quora/pyquora.py +++ b/quora/pyquora.py @@ -13,7 +13,7 @@ def enum(*sequential, **named): enums['reverse_mapping'] = reverse return type('Enum', (), enums) -ACTIVITY_ITEM_TYPES = enum(UPVOTE=1, USER_FOLLOW=2, QUESTION_FOLLOW=3, ANSWER=4, QUESTION=5) +ACTIVITY_ITEM_TYPES = enum(UPVOTE=1, USER_FOLLOW=2, QUESTION_FOLLOW=3, ANSWER=4, QUESTION=5, REVIEW_REQUEST=6) #################################################################### # Helpers @@ -50,6 +50,8 @@ def check_activity_type(description): return ACTIVITY_ITEM_TYPES.ANSWER elif 'added a question' in tag.string: return ACTIVITY_ITEM_TYPES.QUESTION + elif 'requested reviews.' in tag.string: + return ACTIVITY_ITEM_TYPES.REVIEW_REQUEST else: # hopefully. return ACTIVITY_ITEM_TYPES.USER_FOLLOW @@ -138,6 +140,8 @@ def get_activity(user): activity.answers.append(build_feed_item(entry)) elif type == ACTIVITY_ITEM_TYPES.QUESTION: activity.questions.append(build_feed_item(entry)) + elif type == ACTIVITY_ITEM_TYPES.REVIEW_REQUEST: + activity.review_requests.append(build_feed_item(entry)) return activity @staticmethod @@ -151,3 +155,4 @@ def __init__(self, upvotes=[], user_follows=[], question_follows=[], answers=[], self.question_follows = question_follows self.answers = answers self.questions = questions + self.review_requests = review_requests diff --git a/setup.py b/setup.py index 0524eae..e425c1c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='quora', - version='0.1.2', + version='0.1.3', description='Fetches and parses data from Quora.', author='Christopher Su', author_email='christophersu9@gmail.com',