CloudBotIRC / CloudBot

CloudBot - The simple, fast, expandable, open-source Python IRC Bot!
GNU General Public License v3.0
273 stars 249 forks source link

[Plugin Request] Automatic URL shortening #81

Open TheFiZi opened 9 years ago

TheFiZi commented 9 years ago

Would be great if the bot would auto-shorten all URLs in a channel automatically.

Beyond supporting all of the big URL shortening services it would be awesome if it could work with a self-hosted YOURLS (http://yourls.org/) deployment as well.

foxlet commented 9 years ago

RoboCop originally had this with the LinkParse library. One issue might be that automated bot actions might get annoying in some channels.

An excerpt is linked here. (Github GIST)

dmptrluke commented 9 years ago

I do plan to add an automatic link parser, but it will not be enabled by default

On Wed, Jan 21, 2015 at 2:33 PM, Foxlet notifications@github.com wrote:

RoboCop originally had this with the LinkParse library. One issue might be that automated bot actions might get annoying in some channels.

An excerpt is linked here. https://gist.github.com/foxlet/7ff5e4f7ea105860033d#file-shrt-py

— Reply to this email directly or view it on GitHub https://github.com/CloudBotIRC/CloudBot/issues/81#issuecomment-70774703.

foxlet commented 9 years ago

@lukeroge - The excerpt is for shrt.py, which shortens links, but is not a link parser itself (as in metadata or title).

dmptrluke commented 9 years ago

@foxlet, yeah, but you do also have a full link parser, and @zarthus has some useful code for it too, and cloudbot had one in the past so it will be trivial to add!

On Wed, Jan 21, 2015 at 3:19 PM, Foxlet notifications@github.com wrote:

@lukeroge https://github.com/lukeroge - The excerpt is for shrt.py, which shortens links, but is not a link parser itself (as in metadata or title).

— Reply to this email directly or view it on GitHub https://github.com/CloudBotIRC/CloudBot/issues/81#issuecomment-70778237.

BlaneyXYZ commented 9 years ago

This works for Auto Shorten https://gist.github.com/Mu5tank05/7c54f6398dbb0f2e2a09 and this is for YOURLS https://gist.github.com/Mu5tank05/e2113b6e98dedee8fa4c

TheFiZi commented 9 years ago

@Mu5tank05 Tried your YOURLS gist and it doesn't appear to be working. Doesn't appear Cloudbot is even loading it...

@foxlet I'd envisioned disabled by default and opt-in for those of us who want to use it

BlaneyXYZ commented 9 years ago

Sorry my fault YOURLS needs to go in web.py with the other shortners, fill it in with all the details and go to the top web.py and replace the DEFAULT_SHORTNER with your own.You can view my web.py here https://github.com/Mu5tank05/Walter/blob/master/cloudbot/util/web.py

Have you given Auto_shorten ago?