progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
622 stars 174 forks source link

RSS plugin #1492

Closed refriedfood closed 3 years ago

refriedfood commented 3 years ago

It's a great plugin, but the urls it displays are far too long. There needs to be an option to shorten these urls beforehand using some sort of url shortener. Example of a typical googlenews rss link:

https://news.google.com/__i/rss/rd/articles/CBMipAFodHRwczovL3d3dy5pbnZlc3RvcnMuY29tL21hcmtldC10cmVuZC9zdG9jay1tYXJrZXQtdG9kYXkvZG93LWpvbmVzLWZ1dHVyZXMtbWFya2V0LXJhbGx5LWF0dGVtcHQtYmVnaW5zLW5ldGZsaXgtbGVhZHMtc3RvY2tzLXNob3dpbmctc3RyZW5ndGgtdGVzbGEtZGVsaXZlcmllcy1sb29tL9IBAA?oc=5

That's just nutty.

jlu5 commented 3 years ago

If you load the ShrinkUrl plugin and enable plugins.ShrinkUrl.outFilter, the bot will automatically shorten long URLs.

(But honestly, it's not our fault that Google News uses long links, or that IRC UIs exaggerate long URLs to begin with..)

refriedfood commented 3 years ago

Oh, I'm not trying to imply that, but there is no way within the actual plugin itself to truncate the url. ShrinkUrl causes more problems as it becomes a secondary action rather than taking place at once with RSS, which is what I think would make this plugin all the better if it did that on its own.

progval commented 3 years ago

ShrinkUrl causes more problems as it becomes a secondary action rather than taking place at once with RSS

What problems?

refriedfood commented 3 years ago

Well, I can't speak for everyone, but mine doubles up if you can get one of the 3 shorteners to work. So, say you have a gnews rss, the feed will be something like the above, then you'll have under that another line of the shortened url. If there is a way to by pass this and modify the rss to display the shortenurl that I'm unaware of, please let me know and problem solved.

progval commented 3 years ago

ShrinkUrl can replace URLs directly in the bot's output: https://docs.limnoria.net/use/plugins/ShrinkUrl.html#conf-supybot-plugins-shrinkurl-outfilter

refriedfood commented 3 years ago

ShrinkUrl can replace URLs directly in the bot's output: https://docs.limnoria.net/use/plugins/ShrinkUrl.html#conf-supybot-plugins-shrinkurl-outfilter

I got this to work. Thank you. What you linked was not working at first. Apparently is was conflicting with someone else's url eggdrop bot. What it was doing before was dropping a tinyurl as an additional line beneath the results. Thanks again!