aboutsummaryrefslogtreecommitdiff
path: root/mongodb.py
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-03-03 21:06:26 +0100
committercedricbonhomme <devnull@localhost>2012-03-03 21:06:26 +0100
commita4678efc5cd96e57c462a57be02194916c9311cd (patch)
tree9d21d9acb825d48574f2704b64a9a6acfefb13e0 /mongodb.py
parentFavorite page is now working with MongoDB. (diff)
downloadnewspipe-a4678efc5cd96e57c462a57be02194916c9311cd.tar.gz
newspipe-a4678efc5cd96e57c462a57be02194916c9311cd.tar.bz2
newspipe-a4678efc5cd96e57c462a57be02194916c9311cd.zip
Like/Unlike an article is now working with MongoDB.
Diffstat (limited to 'mongodb.py')
-rw-r--r--mongodb.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mongodb.py b/mongodb.py
index 2360d1a1..3c03c8ed 100644
--- a/mongodb.py
+++ b/mongodb.py
@@ -122,7 +122,12 @@ class Articles(object):
return unread_articles
-
+ def like_article(self, like, feed_id, article_id):
+ """
+ Like or unlike an article.
+ """
+ collection = self.db[str(feed_id)]
+ collection.update({"article_id": article_id}, {"$set": {"article_like": like}})
def list_collections(self):
"""
bgstack15