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_filetypesconfig setting.
- Configurable with
- Added configuration for AMPutatorBot's "guess and check" function, both a
global setting (
guess_and_check) and a per-channel override (newampguesscommand 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.cfgtopyproject.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
927bca97b1d3dfc002589322fc4c4dd497239eb9b5aa36c16243052d3198f582
|
|
| MD5 |
0f96a237b4761d8f7c29b4f0dc143545
|
|
| BLAKE2b-256 |
ebc1c03096746b87fa7c3ce94846d9dd56064b828a85bf566883604ad9d61387
|
Provenance
The following attestation bundles were made for sopel_amputator-0.3.0.tar.gz:
Publisher:
pypi.yml on dgw/sopel-amputator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sopel_amputator-0.3.0.tar.gz -
Subject digest:
927bca97b1d3dfc002589322fc4c4dd497239eb9b5aa36c16243052d3198f582 - Sigstore transparency entry: 412215859
- Sigstore integration time:
-
Permalink:
dgw/sopel-amputator@74bdedb40de60e7249c744274bf3e70e803560a4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/dgw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@74bdedb40de60e7249c744274bf3e70e803560a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sopel_amputator-0.3.0-py3-none-any.whl.
File metadata
- Download URL: sopel_amputator-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f3a330f659333328a4acba5d905a46b61a7096552a5748469de35c0996a276
|
|
| MD5 |
89849dfac954883337cbf49f687ecd67
|
|
| BLAKE2b-256 |
4ab23012431bab1a9525c9518dbe725c235646a52ae74f8a71600e44d308e52e
|
Provenance
The following attestation bundles were made for sopel_amputator-0.3.0-py3-none-any.whl:
Publisher:
pypi.yml on dgw/sopel-amputator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sopel_amputator-0.3.0-py3-none-any.whl -
Subject digest:
80f3a330f659333328a4acba5d905a46b61a7096552a5748469de35c0996a276 - Sigstore transparency entry: 412215864
- Sigstore integration time:
-
Permalink:
dgw/sopel-amputator@74bdedb40de60e7249c744274bf3e70e803560a4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/dgw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@74bdedb40de60e7249c744274bf3e70e803560a4 -
Trigger Event:
release
-
Statement type: