From 59962b30d2f2ac900ae336d4c63b5ac0e147796e Mon Sep 17 00:00:00 2001 From: "[Maurizio Paglia]" <[maurizio@mauriziopaglia.it]> Date: Tue, 19 Dec 2023 22:50:43 +0100 Subject: [PATCH] Fixed typo Now fediverse is called and no more pelican_toot --- __init__.py | 2 +- pelican-fediverse.py => fediverse.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename pelican-fediverse.py => fediverse.py (90%) diff --git a/__init__.py b/__init__.py index 32cb56e1..04eab133 100644 --- a/__init__.py +++ b/__init__.py @@ -1 +1 @@ -from .pelican_toot import * +from .fediverse import * diff --git a/pelican-fediverse.py b/fediverse.py similarity index 90% rename from pelican-fediverse.py rename to fediverse.py index dd2a97ec..3aed43e9 100644 --- a/pelican-fediverse.py +++ b/fediverse.py @@ -43,15 +43,15 @@ def post_on_mastodon(settings, new_posts): # check if config file has been duly filled or print an error message and exit if mt_base_url == '' or mt_username == '' or mt_password == '': - logger.warning('Pelican_toot: Mastodon access credentials not configured...') + logger.warning('Pelican_fediverse: Mastodon access credentials not configured...') sys.exit(9) # if pelicantoot_clientcred.secret does not exist it means we have to create the app on Mastodon - if os.path.exists('pelicantoot_clientcred.secret') == False: + if os.path.exists('pelicanfediverse_clientcred.secret') == False: Mastodon.create_app( - 'PelicanToot', + 'PelicanFediverse', api_base_url = mt_base_url, - to_file = 'pelicantoot_clientcred.secret' + to_file = 'pelicanfediverse_clientcred.secret' ) # Advise the user with an on-screen message. We are ready to publish! @@ -79,16 +79,16 @@ def post_updates(generator, writer): if new_posts: if post_on_mastodon(generator.settings, new_posts): mastodon = Mastodon( - client_id = 'pelicantoot_clientcred.secret', + client_id = 'pelicanfediverse_clientcred.secret', api_base_url = mt_base_url ) mastodon.log_in( mt_username, mt_password, - to_file = 'pelicantoot_usercred.secret' + to_file = 'pelicanfediverse_usercred.secret' ) mastodon = Mastodon( - access_token = 'pelicantoot_usercred.secret', + access_token = 'pelicanfediverse_usercred.secret', api_base_url = mt_base_url ) # Actually build the post structure @@ -102,7 +102,7 @@ def post_updates(generator, writer): articlehtmltext = article.summary articlecleantext = html.fromstring(articlehtmltext) summary_to_publish = articlecleantext.text_content().strip() + '\n' - read_more = 'Leggi tutto: ' + article.get_siteurl() + '/' + article.url + '\n\n' + read_more = 'Read more... ' + article.get_siteurl() + '/' + article.url + '\n\n' if hasattr(article, 'tags'): taglist = article.tags new_taglist = [] -- 2.30.2