diff --git a/feed2toot/confparse.py b/feed2toot/confparse.py index dcf6ee1..af31575 100644 --- a/feed2toot/confparse.py +++ b/feed2toot/confparse.py @@ -40,6 +40,7 @@ from feed2toot.confparsers.rss.toot import parsetoot from feed2toot.confparsers.rss.uri import parseuri from feed2toot.confparsers.rss.urilist import parseurilist from feed2toot.confparsers.rss.addtags import parseaddtags +from feed2toot.confparsers.rss.tootmaxlen import parsetootmaxlen class ConfParse: '''ConfParse class''' @@ -67,6 +68,7 @@ class ConfParse: # the rss section ########################### self.tweetformat = parsetoot(config) + options['tootmaxlen'] = parsetootmaxlen(config) ################################################# # pattern and patter_case_sensitive format option ################################################# diff --git a/feed2toot/confparsers/rss/tootmaxlen.py b/feed2toot/confparsers/rss/tootmaxlen.py new file mode 100644 index 0000000..f975469 --- /dev/null +++ b/feed2toot/confparsers/rss/tootmaxlen.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Copyright © 2015-2019 Carl Chenet +# 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 tootmaxlen: + return ''.join([finaltweet[0:-3], '...']) + else: + return finaltweet def send_message_dry_run(config, entrytosend, finaltweet): '''simulate sending message using dry run mode'''