Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JSON and XML encoding support #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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