From 5e42433f3d1ed02492a661624979e86924229920 Mon Sep 17 00:00:00 2001 From: shockrah Date: Fri, 24 Sep 2021 21:13:33 -0700 Subject: [PATCH] * Fixed docstrings that werent being helpful --- scripts/check-og-tags.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/check-og-tags.py b/scripts/check-og-tags.py index 671bc52..b221288 100644 --- a/scripts/check-og-tags.py +++ b/scripts/check-og-tags.py @@ -70,8 +70,8 @@ class Parser(HTMLParser): def get_meta_tags(source:str, base_url: str) -> list[OpenGraphTag]: ''' - Extract's the section from a given HTML string - Returns None if no section is found + Extracts the opengraph meta tags from a section and returns a list + of OpenGraphTag ''' parser = Parser() parser.feed(source) @@ -85,6 +85,14 @@ def get_meta_tags(source:str, base_url: str) -> list[OpenGraphTag]: if __name__ == '__main__': + ''' + This main section basically makes sure that any og:image tags' "content" + is actually available by GET'ing the image content to avoid publishing + code that has typos which affect auto-embeds on many social media websites + Example: + Given: + Ensure that "website.com/image.jpg" can be fetched normally + ''' if len(sys.argv) == 1: print('No url given!', file=sys.stderr) exit(1)