aboutsummaryrefslogtreecommitdiff
path: root/rss_to_gitea/main.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-02-08 23:05:27 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-02-08 23:05:27 +0100
commit259399bc103f61daee068eefcd1f2d205a1c6816 (patch)
tree383ca1ad52f895c19db43fd6df841ef59c140f75 /rss_to_gitea/main.py
parent75556cabf2ad0fd7a136f9f8b0a9d311045c32ba (diff)
downloadatom_to_gitea-259399bc103f61daee068eefcd1f2d205a1c6816.tar.gz
ver 0.1.0
Diffstat (limited to 'rss_to_gitea/main.py')
-rw-r--r--rss_to_gitea/main.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/rss_to_gitea/main.py b/rss_to_gitea/main.py
index c1a4a11..8d31197 100644
--- a/rss_to_gitea/main.py
+++ b/rss_to_gitea/main.py
@@ -16,10 +16,17 @@ USAGE:
def main():
if len(sys.argv) <= 1:
+ print_help()
return 1
config = Config(sys.argv[1])
- api = GiteaAPI("https://gitea.my.cum.re", config.token)
+
+ token = config.token
+ if str.startswith(token, 'env/'):
+ splt = token.split('/',1)
+ token = os.environ[splt[1]]
+
+ api = GiteaAPI(config.url, token)
label_id = api.getLabelId(config.owner, config.repo, config.label)
@@ -35,4 +42,6 @@ def main():
print(f'{issue_title} already exists. Skipping')
continue
- result = api.createIssue(config.owner, config.repo, issue_title, '', feed['assign'], [label_id])
+ print(feed)
+
+ result = api.createIssue(config.owner, config.repo, issue_title, latest['link'], feed['assign'], [label_id])