Skip to content

Commit

Permalink
added new tweet component types
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Sep 8, 2023
1 parent eeeb9fd commit 5ddb96e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bad_pigeon/elements/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module BadPigeon
module Component
# normal tweet in e.g. home/latest or a user's timeline
ORGANIC_FEED_TWEET = "suggest_ranked_organic_tweet"
NORMAL_TWEET = "tweet"

# tweet in the latest timeline
FOLLOWING = "following_in_network"

# tweet in a list timeline
ORGANIC_LIST_TWEET = "suggest_organic_list_tweet"
Expand All @@ -19,6 +23,7 @@ module Component

# promoted tweet (ad)
PROMOTED_TWEET = "suggest_promoted"
FOLLOWING_PROMOTED = "following_promoted"

# "Who to follow" block
FOLLOW_SUGGESTIONS = "suggest_who_to_follow"
Expand Down
3 changes: 3 additions & 0 deletions lib/bad_pigeon/entry_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def include_entry?(entry)
case entry.component
when Component::ORGANIC_FEED_TWEET,
Component::ORGANIC_LIST_TWEET,
Component::NORMAL_TWEET,
Component::FOLLOWING,
Component::PINNED_TWEET,
Component::EXTENDED_REPLY,
Component::SOCIAL_CONTEXT,
Expand All @@ -17,6 +19,7 @@ def include_entry?(entry)
then true

when Component::PROMOTED_TWEET,
Component::FOLLOWING_PROMOTED,
Component::FOLLOW_SUGGESTIONS
then false

Expand Down

0 comments on commit 5ddb96e

Please sign in to comment.