CloudBot icon indicating copy to clipboard operation
CloudBot copied to clipboard

[Plugin Request] Automatic URL shortening

Open TheFiZi opened this issue 10 years ago • 7 comments

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.

TheFiZi avatar Jan 20 '15 23:01 TheFiZi

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)

foxlet avatar Jan 21 '15 02:01 foxlet

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 [email protected] 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.

dmptrluke avatar Jan 21 '15 02:01 dmptrluke

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

foxlet avatar Jan 21 '15 03:01 foxlet

@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 [email protected] 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.

dmptrluke avatar Jan 21 '15 04:01 dmptrluke

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

BlaneyXYZ avatar Jan 21 '15 05:01 BlaneyXYZ

@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

TheFiZi avatar Jan 22 '15 18:01 TheFiZi

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?

BlaneyXYZ avatar Jan 22 '15 22:01 BlaneyXYZ