Compare commits

...

5 Commits

Author SHA1 Message Date
Matthew Lorentz 03bd0cd89b Merge branch 'filter-by-tags' into 'master'
Added ability to filter entries by tag

Closes #26

See merge request chaica/feed2toot!11
2023-01-21 21:38:43 +00:00
Carl Chenet 89518b2478 Merge branch 'master' into 'master'
fix: escape \

See merge request chaica/feed2toot!19
2022-12-30 12:35:25 +00:00
Carl Chenet 8de0b229bb update xmr address 2022-12-29 23:34:25 +01:00
t_aus_m 9b989f8137
fix: escape \ 2022-02-17 13:03:31 +01:00
Matthew Lorentz e0b601b37a Added ability to filter entries by tag 2018-02-15 19:36:11 -05:00
3 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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.
@ -94,7 +94,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.
@ -176,4 +176,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.

View File

@ -67,7 +67,7 @@ class FilterEntry:
# not case sensitive, so we compare the lower case
for pattern in self.options['patterns'][patternlist]:
finalpattern = pattern.lower()
finaltitle = self.entry[patternlist.split('_')[0]].lower()
finaltitle = str(self.entry[patternlist.split('_')[0]]).lower()
if finalpattern in finaltitle:
self.matching[i] = self.entry[i]
else: