Compare commits
8 commits
5c1b6afed2
...
4a3e3664ad
Author | SHA1 | Date | |
---|---|---|---|
4a3e3664ad | |||
acc98829cc | |||
8b0d5b59ff | |||
|
89518b2478 | ||
|
8de0b229bb | ||
|
9b989f8137 | ||
|
9ae33644e5 | ||
|
475bdae925 |
42 changed files with 114 additions and 55 deletions
CHANGELOGREADME.md
docs/source
feed2toot.pyfeed2toot
__init__.pyaddtags.pycliparse.pyconfparse.py
confparsers
feedcache.pyfilterentry.pyhashtags.pylock.pymain.pymessage.pyremoveduplicates.pyrss.pysortentries.pytootpost.pyscripts
setup.py
|
@ -1,3 +1,8 @@
|
|||
## [0.17] - 2021-03-26
|
||||
### Changed
|
||||
- fix install bug while installing from sources
|
||||
- bump changelog
|
||||
|
||||
## [0.16] - 2020-12-09
|
||||
### Added
|
||||
- scripts/register_feed2toot_app: --client-credentials-file option to change the filename in which the client credentials are stored
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
Feed2toot automatically parses rss feeds, identifies new posts and posts them on the [Mastodon](https://mastodon.social) social network.
|
||||
For the full documentation, [read it online](https://feed2toot.readthedocs.io/en/latest/).
|
||||
|
||||
If you would like, you can [support the development of this project on Liberapay](https://liberapay.com/carlchenet/).
|
||||
Alternatively you can donate cryptocurrencies:
|
||||
If you like Feed2toot, you can donate cryptocurrencies to support the development:
|
||||
|
||||
- BTC: 1AW12Zw93rx4NzWn5evcG7RNNEM2RSLmAC
|
||||
- XMR: 43GGv8KzVhxehv832FWPTF7FSVuWjuBarFd17QP163uxMaFyoqwmDf1aiRtS5jWgCiRsi73yqedNJJ6V1La2joznKHGAhDi
|
||||
- XMR: 82VFaMG55AnW1MDgsmKgwUShT2MaiSi7AUY9DQANf7BWK3HdQBKwz58EcxshAWZGkV2A3KPGN6vqRjjvQWsr4jf6Dhc2kEC
|
||||
|
||||
### Quick Install
|
||||
|
||||
|
@ -20,7 +19,7 @@ Alternatively you can donate cryptocurrencies:
|
|||
[Installation Guide](http://feed2toot.readthedocs.io/en/latest/install.html)*
|
||||
|
||||
|
||||
# tar zxvf feed2toot-0.16.tar.gz
|
||||
# tar zxvf feed2toot-0.17.tar.gz
|
||||
# cd feed2toot
|
||||
# python3 setup.py install
|
||||
# # or
|
||||
|
|
|
@ -48,16 +48,16 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = 'feed2toot'
|
||||
copyright = '2015-2020, Carl Chenet <carl.chenet@ohmytux.com>'
|
||||
copyright = '2015-2021, Carl Chenet <carl.chenet@ohmytux.com>'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.16'
|
||||
version = '0.17'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.16'
|
||||
release = '0.17'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
@ -8,19 +8,19 @@ As a prerequisite to use Feed2toot, you need to authorize a Mastodon app for you
|
|||
Just use the script register_feed2toot_app to register the feed2toot app for your account.::
|
||||
|
||||
$ ./register_feed2toot_app
|
||||
|
||||
|
||||
This script generates the Mastodon application credentials for Feed2toot.
|
||||
feed2toot_clientcred.txt and feed2toot_usercred.txt will be written
|
||||
in the current directory: /home/me/feed2toot.
|
||||
WARNING: previous files with the same names will be overwritten.
|
||||
|
||||
|
||||
A connection is also initiated to create the application.
|
||||
Your password is *not* stored.
|
||||
|
||||
|
||||
Mastodon instance URL (defaults to https://mastodon.social): https://framapiaf.org
|
||||
Mastodon login: toto@titi.com
|
||||
Mastodon password:
|
||||
|
||||
Mastodon password:
|
||||
|
||||
The app feed2toot was added to your Preferences=>Accounts=>Authorized apps page.
|
||||
The file feed2toot_clientcred.txt and feed2toot_usercred.txt were created in the current directory.
|
||||
|
||||
|
@ -68,6 +68,11 @@ In order to configure Feed2toot, you need to create a feed2toot.ini file (or any
|
|||
[media]
|
||||
custom=/var/lib/feed2toot/media/logo.png
|
||||
|
||||
; Optional, if you wish to post to a Pleroma instance
|
||||
[pleroma]
|
||||
; Specify content_type to set the content type of your post on Pleroma.
|
||||
content_type=text/plain
|
||||
|
||||
For the [mastodon] section:
|
||||
|
||||
- instance_url: the url of your Mastodon instance
|
||||
|
@ -94,7 +99,7 @@ For the [rss] section:
|
|||
|
||||
- uri: the url of the rss feed to parse
|
||||
- uri_list: a path to a file with several adresses of rss feeds, one by line. Absolute path is mandatory.
|
||||
- toot: format of the toot you want to post. It should use existing entries of the RSS fields like {title} or {link}. Launch it with this field empty to display all available entries. If you want to shorten the size of a field, you can use the syntax {summary:.100} to cut the field "summary" of the rss feed after the first 100 characters (starting from version 0.10). To add new lines you can use \n (starting from version 0.14)
|
||||
- toot: format of the toot you want to post. It should use existing entries of the RSS fields like {title} or {link}. Launch it with this field empty to display all available entries. If you want to shorten the size of a field, you can use the syntax {summary:.100} to cut the field "summary" of the rss feed after the first 100 characters (starting from version 0.10). To add new lines you can use \\n (starting from version 0.14)
|
||||
- toot_max_len: the max length of a toot can be defined here. If the toot size is longer, the toot is truncated and "..." added at the end. Defaults is 500 characters.
|
||||
- {one field of the rss feed}_pattern: takes a string representing a pattern to match for a specified field of each rss entry of the rss feed, like title_pattern or summary_pattern.
|
||||
- {one field of the rss feed}_pattern_case_sensitive: either the pattern matching for the specified field should be case sensitive or not. Default to true if not specified.
|
||||
|
@ -115,6 +120,10 @@ For the [media] section:
|
|||
|
||||
- custom: the path to a media (should be supported by Mastodon) to be posted with every Mastodon post.
|
||||
|
||||
For the [pleroma] section:
|
||||
|
||||
- content_type: Specify content_type to set the content type of your post on Pleroma. It accepts ‘text/plain’ (default), ‘text/markdown’, ‘text/html’ and ‘text/bbcode'. This parameter is not supported on Mastodon servers, but will be safely ignored if set. Use proper syntax in toot parameter of [rss] section.
|
||||
|
||||
Example of the list of hash tags
|
||||
================================
|
||||
The list of hash tags is a simple text file with one hash tag composed by several words on a single line::
|
||||
|
@ -176,4 +185,3 @@ In you rsslist.txt, just don't give anything else than the needed feed url to ge
|
|||
https://blog.linuxjobs.fr/feed.php?rss
|
||||
|
||||
The last line of the file above only has the url of a rss feed. All entries from this feed will be tooted.
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Alternatively, Setuptools may be installed to a user-local path::
|
|||
|
||||
* Untar the tarball and go to the source directory with the following commands::
|
||||
|
||||
$ tar zxvf feed2toot-0.16.tar.gz
|
||||
$ tar zxvf feed2toot-0.17.tar.gz
|
||||
$ cd feed2toot
|
||||
|
||||
* Next, to install Feed2toot on your computer, type the following command with the root user::
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
@ -24,7 +24,7 @@ import os
|
|||
import os.path
|
||||
import sys
|
||||
|
||||
__version__ = '0.16'
|
||||
__version__ = '0.17'
|
||||
|
||||
class CliParse:
|
||||
'''CliParse class'''
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
@ -34,6 +34,7 @@ from feed2toot.confparsers.hashtags.nohashtags import parsenotagsintoot
|
|||
from feed2toot.confparsers.feedparser import parsefeedparser
|
||||
from feed2toot.confparsers.lock import parselock
|
||||
from feed2toot.confparsers.media import parsemedia
|
||||
from feed2toot.confparsers.pleroma import parsepleroma
|
||||
from feed2toot.confparsers.plugins import parseplugins
|
||||
from feed2toot.confparsers.rss.ignoressl import parseignoressl
|
||||
from feed2toot.confparsers.rss.pattern import parsepattern
|
||||
|
@ -113,6 +114,10 @@ class ConfParse:
|
|||
###########################
|
||||
options['media'] = parsemedia(config)
|
||||
###########################
|
||||
# the pleroma section
|
||||
###########################
|
||||
options['mastodon_feature_set'], options['toot_content_type'] = parsepleroma(config)
|
||||
###########################
|
||||
# the plugins section
|
||||
###########################
|
||||
plugins = parseplugins(config)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
26
feed2toot/confparsers/pleroma.py
Normal file
26
feed2toot/confparsers/pleroma.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/
|
||||
|
||||
# Get values of the pleroma section
|
||||
'''Get values of the pleroma section'''
|
||||
|
||||
def parsepleroma(config):
|
||||
'''Parse configuration values and get values of the pleroma section'''
|
||||
mastodon_feature_set = 'mainline'
|
||||
toot_content_type = None
|
||||
if 'pleroma' in config.sections():
|
||||
mastodon_feature_set = 'pleroma'
|
||||
toot_content_type = config.get('pleroma', 'content_type', fallback='text/plain')
|
||||
return mastodon_feature_set,toot_content_type
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
@ -34,14 +34,15 @@ class TootPost:
|
|||
mastodon = Mastodon(
|
||||
client_id=self.config.get('mastodon', 'client_credentials'),
|
||||
access_token=self.config.get('mastodon', 'user_credentials'),
|
||||
api_base_url=self.config.get('mastodon', 'instance_url')
|
||||
api_base_url=self.config.get('mastodon', 'instance_url'),
|
||||
feature_set=self.options['mastodon_feature_set']
|
||||
)
|
||||
toot_visibility = self.config.get('mastodon', 'toot_visibility', fallback='public')
|
||||
if 'custom' in self.options['media']:
|
||||
mediaid = mastodon.media_post(self.config['media']['custom'])
|
||||
mastodon.status_post(self.toot, media_ids=[mediaid], visibility=toot_visibility)
|
||||
mastodon.status_post(self.toot, media_ids=[mediaid], visibility=toot_visibility, content_type=self.options['toot_content_type'])
|
||||
else:
|
||||
mastodon.status_post(self.toot, visibility=toot_visibility)
|
||||
mastodon.status_post(self.toot, visibility=toot_visibility, content_type=self.options['toot_content_type'])
|
||||
|
||||
def storeit(self):
|
||||
'''Indicate if the tweet should be stored or not'''
|
||||
|
|
15
scripts/__init__.py
Normal file
15
scripts/__init__.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
# vim:ts=4:sw=4:ft=python:fileencoding=utf-8
|
||||
# Copyright © 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright © 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
|
4
setup.py
4
setup.py
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2015-2020 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# Copyright 2015-2021 Carl Chenet <carl.chenet@ohmytux.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
|
@ -31,7 +31,7 @@ CLASSIFIERS = [
|
|||
|
||||
setup(
|
||||
name='feed2toot',
|
||||
version='0.16',
|
||||
version='0.17',
|
||||
license='GNU GPL v3',
|
||||
description='Parse rss feeds and send new posts to Mastodon',
|
||||
long_description='Parse rss feeds and send new posts to the Mastodon social network',
|
||||
|
|
Loading…
Add table
Reference in a new issue