phergie / phergie-irc-plugin-react-url

Phergie plugin for displaying information about URLs
MIT License
0 stars 4 forks source link

Feature Request: Ignore some URLs #11

Closed elazar closed 8 years ago

elazar commented 8 years ago

When third-party bots co-exist in the same channel as Phergie, the URL plugin can contribute to the noise-to-signal ratio.

travis-ci
12:58 phergie/plugin-dns#14 (version-2-updates - 672b7b9 : Joe Ferguson): The build passed.
12:58 Change view : https://github.com/phergie/plugin-dns/compare/a8c7322d1833...672b7b9d0af8
12:58 Build details : https://travis-ci.org/phergie/plugin-dns/builds/99308672
12:58 travis-ci left the room.
Phergie
12:58 [http://gsc.io/u/11] Travis CI - Test and Deploy Your Code with Confidence
12:58 [http://gsc.io/u/10] Comparing a8c7322d1833...672b7b9d0af8 · phergie/plugin-dns · GitHub

It would be nice if it was possible to ignore some URLs based on specific components (e.g. hostname). This could be done by implementing a FilterInterface with a single method that accepts a URL and returns a boolean value indicating whether that URL should be handled or not. To maintain BC, a default that returns true for all URLs could be implemented. This would allow for maximum flexibility and customization by the end-user.

WyriHaximus commented 8 years ago

:+1:

WyriHaximus commented 8 years ago

Also been thinking, it should accept the sender and channel as well, that way we can ignore travis and github but keep handing on github and travis URL's not from them

elazar commented 8 years ago

True! Sending the original event object along with the extracted URL would offer all of the above options. :)

WyriHaximus commented 8 years ago

Just more work, but worth it :)

WyriHaximus commented 8 years ago

Been thinking about this some more and I'm currently researching using https://github.com/phergie/phergie-irc-plugin-react-eventfilter#userfilter to achieve this

elazar commented 8 years ago

Only thing I don't like about that idea is the dependency it introduces. Adding it would have to be handled carefully with respect to BC. Otherwise, I agree it's a good approach. :smile:

WyriHaximus commented 8 years ago

Judging by the diff between 1.0 and 2.0 I doubt that is going to be an API problem with the the current, lowest, highest setup we can test against mutiple versions when we target ^1.0||^2.0 :smile:

WyriHaximus commented 8 years ago

@elazar here is a think though, https://github.com/phergie/phergie-irc-plugin-react-eventfilter/compare/1.0.0...2.0.0#diff-8442cbb1e96da0737be107e4002519deL27 Right now I'm only letting messages pass if the result is true. But readying that diff it might be better if I just pass everything !== false. What is your 2cents on this?

elazar commented 8 years ago

@WyriHaximus I think that makes sense. See also: the related section of the README.

WyriHaximus commented 8 years ago

PR is up #14