* Fixed docstrings that werent being helpful
This commit is contained in:
parent
02a0e26dd1
commit
5e42433f3d
@ -70,8 +70,8 @@ class Parser(HTMLParser):
|
||||
|
||||
def get_meta_tags(source:str, base_url: str) -> list[OpenGraphTag]:
|
||||
'''
|
||||
Extract's the <head> section from a given HTML string
|
||||
Returns None if no <head> section is found
|
||||
Extracts the opengraph meta tags from a <head> 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: <meta property="og:image" content="website.com/image.jpg">
|
||||
Ensure that "website.com/image.jpg" can be fetched normally
|
||||
'''
|
||||
if len(sys.argv) == 1:
|
||||
print('No url given!', file=sys.stderr)
|
||||
exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user