OpenGraph

A module to parse the Open Graph Protocol
Download

OpenGraph Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Publisher Name:
  • Erik Rivera
  • Publisher web site:
  • https://github.com/erikriver/

OpenGraph Tags


OpenGraph Description

A module to parse the Open Graph Protocol OpenGraph is a Python module of python for parsing the Open Graph Protocol, you can read more about the specification at http://ogp.me/Installationpip install opengraphUsageFrom an URL>>> import opengraph>>> video = opengraph.OpenGraph(url="http://www.youtube.com/watch?v=q3ixBmDzylQ")>>> video.is_valid()True>>> for x,y in video.items():... print "%-15s => %s" % (x, y)...site_name => YouTubedescription => Eric Clapton and Paul McCartney perform George Harrison's "While My Guitar Gently Weeps" at the...title => While My Guitar Gently Weepsurl => http://www.youtube.com/watch?v=q3ixBmDzylQimage => http://i2.ytimg.com/vi/q3ixBmDzylQ/default.jpgvideo:type => application/x-shockwave-flashvideo:height => 224video => http://www.youtube.com/v/q3ixBmDzylQ?version=3&autohide=1video:width => 398type => videoFrom HTML>>> HTML = """... < html xmlns:og="http://ogp.me/ns#" >... < head >... < title >The Rock (1996)< /title >... < meta property="og:title" content="The Rock" / >... < meta property="og:type" content="movie" / >... < meta property="og:url" content="http://www.imdb.com/title/tt0117500/" / >... < meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" / >... < /head >... < /html >... """>>> movie = opengraph.OpenGraph() # or you can instantiate as follows: opengraph.OpenGraph(html=HTML)>>> movie.parser(HTML)>>> video.is_valid()TrueGenerate JSON or HTML>>>>>>>>>


OpenGraph Related Software