From 4df20e70ed65c079db234984d7949f920a32ee07 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 26 Aug 2021 08:50:46 +0200 Subject: [PATCH] scraper now can translate atom feeds too --- resources/scripts/scrapers/translate-feed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/scripts/scrapers/translate-feed.py b/resources/scripts/scrapers/translate-feed.py index b44079bc2..229aef2b4 100644 --- a/resources/scripts/scrapers/translate-feed.py +++ b/resources/scripts/scrapers/translate-feed.py @@ -1,14 +1,15 @@ # Translates entries of RSS 2.0 feed into different locale. # # Make sure to have all dependencies installed: -# pip3 install googletrans==4.0.0-rc1 +# pip3 install googletrans # pip3 install asyncio (if using parallel version of the script) +# pip3 install hyper (for HTTP/2 support, much faster than default) # # You must provide raw RSS 2.0 UTF-8 feed XML data as input, for example with curl: -# curl 'https://phys.org/rss-feed/' | python ./translate-rss2.py "en" "pt_BR" "true" +# curl 'https://phys.org/rss-feed/' | python ./translate-feed.py "en" "pt_BR" "true" # # You must provide three command line arguments: -# translate-rss2.py [FROM-LANGUAGE] [TO-LANGUAGE] [RUN-PARALLEL] +# translate-feed.py [FROM-LANGUAGE] [TO-LANGUAGE] [RUN-PARALLEL] import json import re