mirror of
https://codeberg.org/Yael-II/ArXtic.git
synced 2026-03-15 06:16:26 +01:00
2025-09-15: First commit
This commit is contained in:
53
src/arxtic.py
Normal file
53
src/arxtic.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
#[TLP:AMBER] LIMITED DISTRIBUTION: WORK IN PROGRESS
|
||||
"""
|
||||
ArXtic:
|
||||
|
||||
ArXtic queries arXiv and filters the output.
|
||||
|
||||
@ Author: Moussouni, Yaël (MSc student; yael.moussouni@etu.unistra.fr)
|
||||
@ Institution: Université de Strasbourg, CNRS, Observatoire astronomique
|
||||
de Strasbourg, UMR 7550, F-67000 Strasbourg, France
|
||||
@ Date: 2025-09-15
|
||||
|
||||
Licence:
|
||||
ArXtic
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
|
||||
arxtic.py
|
||||
Copyright (C) 2025 Yaël Moussouni (yael.moussouni@etu.unistra.fr)
|
||||
|
||||
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
|
||||
(at your option) 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 www.gnu.org/licenses/.
|
||||
"""
|
||||
import os
|
||||
import feedparser as fp
|
||||
|
||||
QUERY_URL = os.environ.get("QUERY_URL")
|
||||
RSS_URL = os.environ.get("RSS_URL")
|
||||
|
||||
COLOUR_DEFAULT="\033[0m"
|
||||
COLOUR_INPUT="\033[36m"
|
||||
COLOUR_OUTPUT="\033[32m"
|
||||
COLOUR_INFO="\033[34m"
|
||||
COLOUR_WARNING="\033[93m"
|
||||
COLOUR_ERROR="\033[91m"
|
||||
|
||||
d = fp.parse(RSS_URL)
|
||||
|
||||
fields = list(d)
|
||||
entries = d["entries"]
|
||||
|
||||
for i in range(len(entries)):
|
||||
print(entries[i]["published"] + ": " + entries[i]["id"])
|
||||
|
||||
Reference in New Issue
Block a user