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)