# Stream of user like events

**URL:** <https://meta.discourse.org/t/stream-of-user-like-events/96772>\
**Category:** Product Support\
**Created:** [09.Сентябрь.2018 02:29:41 UTC](https://meta.discourse.org/t/stream-of-user-like-events/96772 "2018-09-09T02:29:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)\
**Post date:** [09.Сентябрь.2018 02:43:45 UTC](https://meta.discourse.org/t/stream-of-user-like-events/96772/2 "2018-09-09T02:43:45Z")

</div>

There’s no current event for this. However, you can include one as part of a plugin.

```plaintext
# plugin.rb
class ::PostAction
  module ListenForLikes
    def act(user, post, post_action_type_id, opts = {})
      super(user, post, post_action_type_id, opts).tap do |action|
        DiscourseEvent.trigger(:post_liked, action) if action.persisted? && action.is_like?
      end
    end
  end
  singleton_class.prepend ListenForLikes
end

on :post_liked do |action|
  # do some stuff
end

```

---

_[View the full topic](https://meta.discourse.org/t/stream-of-user-like-events/96772)._
