From: Colin Watson Date: Tue, 1 Oct 2024 12:58:14 +0000 (+0100) Subject: Enable automatic posting to Mastodon X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=5580c18b7234203c855fddd5010d189d564d98a4;p=blog.git Enable automatic posting to Mastodon --- diff --git a/.gitignore b/.gitignore index afbc722e..7437236e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc cache +mastodoncreds.py output diff --git a/fediverse/fediverse.py b/fediverse/fediverse.py index 3aed43e9..7c28f6dc 100644 --- a/fediverse/fediverse.py +++ b/fediverse/fediverse.py @@ -103,7 +103,7 @@ def post_updates(generator, writer): articlecleantext = html.fromstring(articlehtmltext) summary_to_publish = articlecleantext.text_content().strip() + '\n' read_more = 'Read more... ' + article.get_siteurl() + '/' + article.url + '\n\n' - if hasattr(article, 'tags'): + if False and hasattr(article, 'tags'): # cjwatson: my tags aren't sensible for fedi taglist = article.tags new_taglist = [] for i in taglist: diff --git a/posted_on_Mastodon.txt b/posted_on_Mastodon.txt new file mode 100644 index 00000000..4464923b --- /dev/null +++ b/posted_on_Mastodon.txt @@ -0,0 +1,84 @@ +# Not actually posted, but I don't want to post lots of old articles. +activity-2024-02.html +activity-2024-03.html +activity-2024-04.html +activity-2024-05.html +activity-2024-06.html +activity-2024-07.html +activity-2024-08.html +apt-resolver-bugs.html +automatic-installability-checking.html +binfmt-support-2.2.0.html +brainstorm-review.html +bug-triage-rants.html +bug-triage-redux.html +buster-upgrade.html +bzr-shelve.html +catching-up.html +code_swarm.html +cve-2015-1336.html +debconf-cdebconf-coinstallable.html +debhelper-statistics-redux.html +debhelper-statistics.html +deploying-swift.html +desktop-automount-pain.html +env-chdir.html +going-freelance.html +grub2-boot-problems.html +grub2-with-luck.html +gsoc-d-i-hurd-started.html +gsoc-ubiquity-migration-started.html +hacking-on-grub2.html +hello.html +keysigning-bits.html +keysigning-psa.html +kitten-block-equivalent-for-firefox-57.html +libpipeline-1.1.0-released.html +libpipeline-1.2.1-released.html +libpipeline-released.html +lp-new-ssh-features.html +lp-python3-progress.html +lp-python3.html +man-db-2.6.0.html +man-db-2.8.7.html +man-db-K.html +man-db-encodings.html +man-db-on-fedora.html +moving-conffiles.html +moving-on-but-not-too-far.html +mysterious-bug-with-twisted-plugins.html +new-address-book.html +no-more-hash-sum-mismatch-errors.html +ntp-synchronisation-problems.html +odd-test-failure.html +openssh-5.5p1-for-lucid.html +openssh-6.0p1.html +openssh-iutf8.html +openuk-new-years-honours.html +parted-2.2-transition.html +pipeline-library.html +playing-with-rich.html +porting-ghc-a-tale-of-two-architectures.html +python-sigpipe.html +quality-in-12-04.html +re-signing-ppas.html +reply-perl-is-strange.html +reproducible-man-db-databases.html +safe-upgrade.html +single-stage-installer.html +sponge.html +ssh-keygen.html +ssh-quoting.html +ssh-sha-2-support-in-twisted.html +storm-py3.html +task-management.html +testing-wanted-grub-2.02-beta2.html +thoughts-on-3.0-quilt-format.html +tissue-of-lies.html +totem-bbc-plugin.html +ubuntu-install-everything.html +utf-8-manual-pages.html +vim-lpbug-omnicomplete.html +windows-applications-making-grub2-unbootable.html +wubi-bug-693671.html + diff --git a/publishconf.py b/publishconf.py index 5c216e6b..79d67e5a 100644 --- a/publishconf.py +++ b/publishconf.py @@ -8,7 +8,8 @@ from __future__ import unicode_literals import os import sys sys.path.append(os.curdir) -from pelicanconf import * +from pelicanconf import * # noqa: E402,F403 +from mastodoncreds import * # noqa: E402,F403 SITEURL = 'https://www.chiark.greenend.org.uk/~cjwatson/blog' RELATIVE_URLS = False @@ -18,6 +19,9 @@ CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' DELETE_OUTPUT_DIRECTORY = True +PLUGIN_PATHS = [*PLUGIN_PATHS, 'fediverse'] # noqa: F405 +PLUGINS = [*PLUGINS, 'fediverse'] # noqa: F405 + # Following items are often useful when publishing #DISQUS_SITENAME = ""