Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions opengraph/opengraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
except ImportError:
from BeautifulSoup import BeautifulSoup

global import_json
try:
import json
import_json = True
except ImportError:
import_json = False

class OpenGraph(dict):
"""
"""
Expand Down Expand Up @@ -85,20 +78,6 @@ def to_html(self):
meta += u"\n"

return meta

def to_json(self):
# TODO: force unicode
global import_json
if not import_json:
return "{'error':'there isn't json module'}"

if not self.is_valid():
return json.dumps({'error':'og metadata is not valid'})

return json.dumps(self)

def to_xml(self):
pass

def scrape_image(self, doc):
images = [dict(img.attrs)['src']
Expand Down