kramerc / irc-url-title-bot

Dockerized IRC bot to post titles of URLs posted in channels
GNU Affero General Public License v3.0
1 stars 0 forks source link

irc-url-title-bot

irc-url-title-bot is a dockerized Python 3.9 based IRC URL title posting bot. It essentially posts the page titles of the URLs that are posted in the configured channels on an IRC server. As a disclaimer, note that SSL verification is disabled, and that the posted titles are not guaranteed to be accurate due to a number of factors.

Links

Caption Link
Code https://github.com/impredicative/irc-url-title-bot
Changelog https://github.com/impredicative/irc-url-title-bot/releases
Image https://hub.docker.com/r/ascensive/irc-url-title-bot

Examples

<Adam> For the mathematics of deep learning, see https://arxiv.org/abs/2105.04026 and https://arxiv.org/pdf/2104.14033
<TitleBot> ⤷ [2105.04026] The Modern Mathematics of Deep Learning | PDF: https://arxiv.org/pdf/2105.04026
<TitleBot> ⤷ [2104.14033] A Study of the Mathematics of Deep Learning | Abstract: https://arxiv.org/abs/2104.14033
<Eve> Is github.com/visinf/n3net a good project? I've been studying bugs.python.org/file47781/Tutorial_EDIT.pdf
<TitleBot> ⤷ GitHub - visinf/n3net: Neural Nearest Neighbors Networks (NIPS*2018)
<TitleBot> ⤷ Python Tutorial

For more examples, see urltitle.

Usage

The bot can work in multiple channels but on only one server. To use with multiple servers, use an instance per server.

Configuration

Prepare a private secrets.env environment file using the sample below.

IRC_PASSWORD=YourActualPassword

Prepare a version-controlled config.yaml file using the sample below. A full-fledged real-world example is also available.

# Mandatory:
host: irc.libera.chat
port: 6697
ssl: true
nick: MyTitleBot
channels:
  - '#some_chan1'
  - '##some_chan2 somekey'

# Optional:
blacklist:
  title:
    - Invalid host
    - Untitled
  url:
    - model.fit
    - tf.app
ignores:
  - some_user1
  - some_user2
mode:

# Site-specific (optional):
sites:
  arxiv.org:
    format:
      - re:
          url: /pdf/(?P<url_id>.+?)(?:\.pdf)*$
        str:
          title: '{title} | https://arxiv.org/abs/{url_id}'
      - re:
          url: /abs/(?P<url_id>.+?)$
        str:
          title: '{title} | https://arxiv.org/pdf/{url_id}'
  bpaste.net:
    blacklist:
      title: show at bpaste
  imgur.com:
    blacklist:
      title: 'Imgur: The magic of the Internet'
  paste.ee:
    blacklist:
      title_re: ^Paste\.ee\ \-\ View\ paste\b
  youtube.com:
    blacklist:
      channels:
        - '##some_chan2'

Global settings

Mandatory
Optional

Site-specific settings

The site of a URL is as defined and returned by the urltitle package. Refer to the examples contained in the Customizations section of its readme.

Site-specific settings are specified under the top-level sites key. The order of execution of the interacting operations is: blacklist, format. Refer to the sample configuration for usage examples.

Deployment

Maintenance