summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-03-13 17:35:21 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-03-13 17:35:21 +0100
commit5cab689180436fb430f0526ff42ad6ba9f12c483 (patch)
tree7b7936119dfb25b00905d6322a4863792e5517e8 /scripts
parent6d96705b15bf57991640f5f10d65f81e8e291057 (diff)
downloadishtar-pergamon-5cab689180436fb430f0526ff42ad6ba9f12c483.tar.bz2
ishtar-pergamon-5cab689180436fb430f0526ff42ad6ba9f12c483.zip
Add visit_site script to force CACHE update
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/visit_site.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/visit_site.py b/scripts/visit_site.py
new file mode 100755
index 0000000..abd6a21
--- /dev/null
+++ b/scripts/visit_site.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python3
+
+from bs4 import BeautifulSoup
+import requests
+
+
+def main(url):
+ if not url.startswith("http"):
+ url = "http://" + url
+ if not url.endswith("/"):
+ url += "/"
+ response = requests.get(url)
+ soup = BeautifulSoup(response.text, "html.parser")
+ for link in soup.find_all("a", "link-browse"):
+ href = link["href"]
+ try:
+ requests.get(url + href)
+ except Exception:
+ pass
+
+
+if __name__ == '__main__':
+ from pergamon.settings.local import BASE_URL
+ main(BASE_URL) \ No newline at end of file