Skip to content

Commit

Permalink
review requests
Browse files Browse the repository at this point in the history
  • Loading branch information
csu committed Aug 10, 2014
1 parent 87422c3 commit 0aa4666
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 6 additions & 1 deletion quora/pyquora.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
Expand Down

0 comments on commit 0aa4666

Please sign in to comment.