summaryrefslogtreecommitdiff
path: root/app/utils
diff options
context:
space:
mode:
Diffstat (limited to 'app/utils')
-rw-r--r--app/utils/util.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/utils/util.py b/app/utils/util.py
index 6678fc9..714403b 100644
--- a/app/utils/util.py
+++ b/app/utils/util.py
@@ -110,3 +110,14 @@ def parse_video(s):
if soup.find('video'):
return True
return False
+
+def parse_reg_bio_page():
+ content = requests.get("https://www.theregister.co.uk/Author/Scott-Gilbertson/")
+ soup = BeautifulSoup(content, 'html.parser')
+ try:
+ image = soup.find_all('img')[0]['id']
+ img_pk = image.split('image-')[1]
+ return apps.get_model('photos', 'LuxImage').objects.get(pk=img_pk)
+ except IndexError:
+ return None
+