impredicative / irc-rss-feed-bot

Dockerized IRC bot to post RSS/Atom and scraped HTML/JSON/CSV feeds to channels
https://hub.docker.com/r/ascensive/irc-rss-feed-bot
GNU Affero General Public License v3.0
28 stars 4 forks source link

Support self-hosted URL shortener #15

Open FingerlessGlov3s opened 5 years ago

FingerlessGlov3s commented 5 years ago

Hi impredicative,

Loving this bot by the way, I was wondering we is possible if you could add another shorter provider? Perhaps https://github.com/shlinkio/shlink support? Then we can self host the bot and the shortner :-)

Just food for thought,

FingerlessGlov3s commented 5 years ago

I've created a Channel on Freenode #SecurityFeed, so people can have one place monitor for new breaches and other security related things. Join it if you like 👍

Doesn't have to be self hosted but then there's no costs to pay when your already running a server for the bot. simpler than creating multiple Bitly accounts. In my eyes anyway.

EDIT: Gonna look at some other selfhost ones, try them out and I'll give you a API call :-)

FingerlessGlov3s commented 5 years ago

After looking for a while, I think the best way forward is to support YOURLS,

API Reference: https://yourls.org/#API

There is an python library for YOURLS https://pypi.org/project/yourls/

or you could use this

import requests 

#api-endpoint 
URL = "https://google.com" 
API_SIGNATURE = "MYSIG34242"#basicly api key
API_URL = "https://hostname/yourls-api.php" 

#Create PARAMS
PARAMS = { 'signature': API_SIGNATURE, 'action': 'shorturl', 'format': 'simple', 'url':URL }

#GetURL 
print (requests.get(url = API_URL, params = PARAMS).text)
impredicative commented 1 year ago

Possible simple Go-lang based self-hosted shortener(s):