Skip to main content

Sopel plugin that detects AMP links and finds their canonical forms using AmputatorBot

Project description

sopel-amputator

Sopel plugin that detects AMP links and finds their canonical forms using AmputatorBot

Installing

Releases are hosted on PyPI, so after installing Sopel, all you need is pip:

$ pip install sopel-amputator

Configuring

The easiest way to configure sopel-amputator is via Sopel's configuration wizard—simply run sopel-plugins configure amputator and enter the values for which it prompts you.

Individual settings are described below.

ignore_domains (list[str])

This is a list of hostnames which sopel-amputator will ignore, even if they match one of the common AMP substrings it looks for. By default it contains a set of ignored domains from the AmputatorBot project.

Setting this value overrides the default, so make sure to also enter any entries that you would like to keep from the default list.

guess_and_check (bool, default true)

The default behavior for AMPutatorBot's "guess and check" feature, which tries to guess canonical URLs when the page doesn't provide one in its HTML.

Behavior can be changed per-channel by chanops and bot admins using the .ampguess command on IRC.

skip_safe_filetypes (bool, default true)

Whether to skip AMP-checking links that look like they point to safe MIME types, e.g. media files.

Changelog

0.3.0

  • Guess MIME type of links (by file extension, if present) and skip "safe" types that are probably not wrapped in AMP [#3]
    • Configurable with skip_safe_filetypes config setting.
  • Added configuration for AMPutatorBot's "guess and check" function, both a global setting (guess_and_check) and a per-channel override (new ampguess command for chanops and bot admins) [#2]

Under the hood:

  • Require stable Sopel 8.x, no more pre-releases
  • Updated package metadata & release workflow

0.2.1

  • Added Twitter/X domains to default ignore list

0.2.0

Under-the-hood improvements:

  • More robust domain matching against ignore list
    • Includes distinct log messages for exact matches vs. subdomain matches
  • More granular error handling
  • Better error logging
  • Migrated package metadata from setup.py+setup.cfg to pyproject.toml

0.1.0

Initial release.

Pending conversion from setup.py+setup.cfg template to newer style package using pyproject.toml—plus some other features on the todo list—but the basics are here:

  • Detect likely AMP links
  • Call AmputatorBot API for the canonical URL of each suspected AMP link
  • Skip links from a configurable list of ignored domains
  • Silently fail if no better URL is found

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sopel_amputator-0.3.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sopel_amputator-0.3.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file sopel_amputator-0.3.0.tar.gz.

File metadata

  • Download URL: sopel_amputator-0.3.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sopel_amputator-0.3.0.tar.gz
Algorithm Hash digest
SHA256 927bca97b1d3dfc002589322fc4c4dd497239eb9b5aa36c16243052d3198f582
MD5 0f96a237b4761d8f7c29b4f0dc143545
BLAKE2b-256 ebc1c03096746b87fa7c3ce94846d9dd56064b828a85bf566883604ad9d61387

See more details on using hashes here.

Provenance

The following attestation bundles were made for sopel_amputator-0.3.0.tar.gz:

Publisher: pypi.yml on dgw/sopel-amputator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sopel_amputator-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sopel_amputator-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80f3a330f659333328a4acba5d905a46b61a7096552a5748469de35c0996a276
MD5 89849dfac954883337cbf49f687ecd67
BLAKE2b-256 4ab23012431bab1a9525c9518dbe725c235646a52ae74f8a71600e44d308e52e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sopel_amputator-0.3.0-py3-none-any.whl:

Publisher: pypi.yml on dgw/sopel-amputator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page