diff --git a/README.md b/README.md index 03b5ada..2061d1b 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ action: --proxy doesn't fill the articles --newest return the feed items in chronological order (morss ohterwise shows the items by appearing order) --firstlink pull the first article mentioned in the description instead of the default link + --resolve replace tracking links with direct links to articles (not compatible with --proxy) custom feeds: --items XPATH (mandatory to activate the custom feeds function) xpath rule to match all the RSS entries diff --git a/morss/cli.py b/morss/cli.py index 547cb1c..56a7092 100644 --- a/morss/cli.py +++ b/morss/cli.py @@ -44,6 +44,7 @@ def cli_app(): group.add_argument('--proxy', action='store_true', help='doesn\'t fill the articles') group.add_argument('--newest', action='store_true', help='return the feed items in chronological order (morss ohterwise shows the items by appearing order)') group.add_argument('--firstlink', action='store_true', help='pull the first article mentioned in the description instead of the default link') + group.add_argument('--resolve', action='store_true', help='replace tracking links with direct links to articles (not compatible with --proxy)') group = parser.add_argument_group('custom feeds') group.add_argument('--items', action='store', type=str, metavar='XPATH', help='(mandatory to activate the custom feeds function) xpath rule to match all the RSS entries') diff --git a/morss/morss.py b/morss/morss.py index 25a04b3..a41e83a 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -226,6 +226,9 @@ def ItemFill(item, options, feedurl='/', fast=False): if out is not None: item.content = out + if options.resolve: + item.link = req['url'] + return True