Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for muting user or hashtag #147

Open
ooduor opened this issue Apr 12, 2013 · 2 comments
Open

Support for muting user or hashtag #147

ooduor opened this issue Apr 12, 2013 · 2 comments

Comments

@ooduor
Copy link

ooduor commented Apr 12, 2013

Could you please add support for muting. I presume the extra command could be something ike:

:mute Username or
:mute #HashTag

Then all tweets/retweets from the user or with the hashtag won't be shown in the stream. Then :unmute would reverse the action.

Thank you!

@no6v
Copy link
Collaborator

no6v commented Apr 12, 2013

Here is my draft of mute plugin :).

Earthquake.once do
  @muting_screen_names ||= []
end

Earthquake.init do
  output_filter do |item|
    next unless item["_stream"]
    item["user"] && !@muting_screen_names.include?(item["user"]["screen_name"])
  end

  command :mute do |m|
    (@muting_screen_names << m[1].delete(?@)).uniq!
  end

  command :unmute do
    @muting_screen_names.clear
  end
end

@jugyo
Copy link
Owner

jugyo commented Apr 14, 2013

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants