diff --git a/misc/gather_media_files.py b/misc/gather_media_files.py index 3b376ad..a22d7e0 100644 --- a/misc/gather_media_files.py +++ b/misc/gather_media_files.py @@ -1,6 +1,5 @@ import sys -from webbrowser import get -sys.path.append("../app") +sys.path.append("/app/auto_news/") import runner import logging logger = logging.getLogger() @@ -8,6 +7,7 @@ import json from rich.console import Console from rich.table import Table +import subprocess, os console = Console() logger.info("Overwriting production values for single time media-fetch") @@ -55,13 +55,17 @@ def show(): for e in entries: t.add_column(e, justify = "right") - sel = runner.models.ArticleDownload.select() + sel = runner.models.ArticleDownload.select().order_by(runner.models.ArticleDownload.pub_date) for s in sel: - c = [getattr(s, e) for e in entries]# + c = [getattr(s, e) for e in entries] # c[-1] = str([a.author for a in c[-1]]) - print(c) + # print(c) t.add_row(*c) + path = os.path.join(s.save_path, s.file_name).replace("..", "/code") + subprocess.Popen(["evince", f"file://{path}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + input("go on?") + console.print(t) diff --git a/misc/sample_config/nas_login.config b/misc/sample_config/nas_login.config new file mode 100644 index 0000000..78aa566 --- /dev/null +++ b/misc/sample_config/nas_login.config @@ -0,0 +1,3 @@ +user=remoll +domain=D +password=************** diff --git a/misc/sample_config/nas_sync.config b/misc/sample_config/nas_sync.config new file mode 100644 index 0000000..b5f8a61 --- /dev/null +++ b/misc/sample_config/nas_sync.config @@ -0,0 +1,12 @@ +settings { + logfile = "/tmp/lsyncd.log", + statusFile = "/tmp/lsyncd.status", + nodaemon = true, +} + +sync { + default.rsync, + source = "/sync/local_files", + target = "/sync/remote_files", + init = false, +} diff --git a/misc/sample_config/news_fetch.config.ini b/misc/sample_config/news_fetch.config.ini new file mode 100644 index 0000000..6dfc5fc --- /dev/null +++ b/misc/sample_config/news_fetch.config.ini @@ -0,0 +1,33 @@ +[MAIL] +smtp_server: smtp.ethz.ch +port: 587 +sender: remoll@ethz.ch +recipient: dirk.helbing@gess.ethz.ch +uname: remoll +password: **************+ + + +[SLACK] +bot_id: U02MR1R8UJH +responsible_id: U01AC9ZEN2G +archive_id: C02MM7YG1V4 +debug_id: C02NM2H9J5Q +api_wait_time: 90 +auth_token: xoxb-1339422048646-2739059300629-4pFDsNtHTgoOnX6punPXZcfq +app_token: xapp-1-A02MDABPHBR-2741993006290-487109066f65f3463961aaa7f9109addbe40958f83989942ea9809dd23bf69e8 + + +[DATABASE] +download_db_name: downloads.db +chat_db_name: messages.db +db_path_prod: /app/containerdata +db_path_dev: /code/.dev +db_backup: /app/containerdata/backups + + +[DOWNLOADS] +local_storage_path: /app/containerdata/files +default_download_path: /app/containerdata/tmp +remote_storage_path: /helbing_support/Files RM/Archiving +browser_profile_path: /app/containerdata/dependencies/7hlyfqxt.Auto News +blacklisted_href_domains: ["google.", "facebook."] \ No newline at end of file diff --git a/misc/sample_config/vpn.config b/misc/sample_config/vpn.config new file mode 100644 index 0000000..9311e73 --- /dev/null +++ b/misc/sample_config/vpn.config @@ -0,0 +1,4 @@ +OPENCONNECT_URL=sslvpn.ethz.ch/student-net +OPENCONNECT_USER=remoll@student-net.ethz.ch +OPENCONNECT_PASSWORD=************** +OPENCONNECT_OPTIONS=--authgroup student-net \ No newline at end of file