Feed date scraper for Gemini (protocol)
zachwalk: separate main function
Zach DeCook 2021-02-06
parent fb1a7fc · commit a77672f
-rwxr-xr-xzachwalk.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/zachwalk.py b/zachwalk.py
index ad16746..9584cef 100755
--- a/zachwalk.py
+++ b/zachwalk.py
@@ -32,7 +32,8 @@ def getnewestdate(url):
pass
return '1970-01-01'
-with open(sys.argv[1]) as f:
+def main(argv):
+ with open(argv[1]) as f:
for line in f:
if line[0:2] == '=>':
# plz don't use multiple spaces.
@@ -40,3 +41,6 @@ with open(sys.argv[1]) as f:
desc = line[3+len(url):].strip()
newestdate = getnewestdate(url)
print(f'=> {url} {newestdate} - {desc}')
+
+if __name__ == '__main__':
+ main(sys.argv)