Skip to content

Instantly share code, notes, and snippets.

@rupansh
Created July 4, 2020 20:12
Show Gist options
  • Save rupansh/2dfa9fcae01b1015aa1feb38cbc3ba10 to your computer and use it in GitHub Desktop.
Save rupansh/2dfa9fcae01b1015aa1feb38cbc3ba10 to your computer and use it in GitHub Desktop.
import requests
url = input("enter post url ")
res = requests.get(url)
img = filter(lambda x: "og:image" in x, res.text.split("\n"))
print(next(img).split()[2].replace("content=", ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment