* 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]:
|
def get_meta_tags(source:str, base_url: str) -> list[OpenGraphTag]:
|
||||||
'''
|
'''
|
||||||
Extract's the <head> section from a given HTML string
|
Extracts the opengraph meta tags from a <head> section and returns a list
|
||||||
Returns None if no <head> section is found
|
of OpenGraphTag
|
||||||
'''
|
'''
|
||||||
parser = Parser()
|
parser = Parser()
|
||||||
parser.feed(source)
|
parser.feed(source)
|
||||||
@ -85,6 +85,14 @@ def get_meta_tags(source:str, base_url: str) -> list[OpenGraphTag]:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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:
|
if len(sys.argv) == 1:
|
||||||
print('No url given!', file=sys.stderr)
|
print('No url given!', file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user