Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created March 10, 2020 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/60ec782a1967183f73eb8fc1b7e5dd92 to your computer and use it in GitHub Desktop.
Save Porter97/60ec782a1967183f73eb8fc1b7e5dd92 to your computer and use it in GitHub Desktop.
#...
import opengraph
#...
@app.cli.command()
def update_images():
content = Content.query.all()
for x in content:
og = opengraph.OpenGraph(url=x.url)
x.image = og.image
x.add_fields_to_stream(image=og.image)
db.session.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment