You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromfeedly.feed_managers.baseimportFeedlyfromfeedly.feed_managers.baseimportFanoutPriorityfromgruppu.modelsimportContent, Streamfromgruppu.mms_feedimportAggregatedMMSFeed, MMSFeed, \
UserMMSFeedclassMMSFeedly(Feedly):
# this example has both a normal feed and an aggregated feed (more like# how facebook or wanelo uses feeds)feed_classes=dict(
normal=MMSFeed,
aggregated=AggregatedMMSFeed
)
user_feed_class=UserMMSFeeddefadd_mms(self, pin):
activity=pin.create_activity()
# add user activity adds it to the user feed, and starts the fanoutself.add_user_activity(pin.origstream_id, activity)
defremove_mms(self,pin,user):
activity=pin.create_activity()
ifuser==pin.origstream.streamOwner:
# removes the pin from the user's followers feedsself.remove_user_activity(pin.origstream_id, activity)
else:
forfeed_classinself.feed_classes.values():
user_feed=feed_class(user.id)
user_feed.remove(activity)
defget_user_follower_ids(self, activity, user_id):
author=activity.extra_context['owner_id']
ids=list(Stream.objects.filter(pk=user_id).values_list('groupers',flat=True))
ids.append(author)
printidsreturn {FanoutPriority.HIGH:ids}
feedly=MMSFeedly()
The text was updated successfully, but these errors were encountered:
Not sure how and why but I get the timeline of the user normal feed reversed:
Below is the feed for the user with id 2, the first record is with ID 1000000074 while the smallest is actually 1000000064.
redis 127.0.0.1:6379> zrevrange feed:normal:2 0 100
I am using the pinterest example as a base, here is my feedly setup:
And here:
The text was updated successfully, but these errors were encountered: