Reputation: 238
I am building a web app where users can post articles. They can also comment, like and share posted articles. Users can follow other users so that they see their activities on their timeline feed.
On their timeline feed, they see the activities of all the users they follow. And just like Facebook, they can access a user's profile page where they see the user's "profile feed". On this feed, they only see this specific user's recent activities.
On a "profile feed", I only want to show some specific actions like "Jack posted a new article" or "Jack shared this article". I don't want to show activities like "Jack commented this article" or "Jack liked this article". But I wan't to show all of these activities on the timeline feeds.
After reading the whole docs, I don't see how I could do this. For the timeline feed, I'm good. For the "profile feed", I think I would need to read the user feed, but this feed will include all of the user's activities including comments, likes, etc. Is there a way to read a feed and ask for only specific verbs?
Upvotes: 1
Views: 211
Reputation: 238
This is how I handled this situation :
Have two user feed groups. One user_profile_actions
for actions that belong on a user's profile and one user_other_actions
for other actions. This way, when I want to display the user's profile, I read the user_profile_actions
feed. And when someone decides to follow a user, I will make his timeline_aggregated
feed follows both user feeds this way:
$follows = [
['source' => 'timeline_aggregated:peter', 'target' => 'user_profile_actions:jack'],
['source' => 'timeline_aggregated:peter', 'target' => 'user_other_actions:jack'],
];
$batcher->followMany($follows);
Upvotes: 1