Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

allow to pass the xml by content instead of url, keeping backward compatibility. #3

Merged
merged 1 commit into from

2 participants

@spikykiwi

this patch does exactly that.

@minichiello minichiello merged commit be260f7 into minichiello:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 10, 2011
  1. @spikykiwi
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 PyOpenGraph/PyOpenGraph.py
View
8 PyOpenGraph/PyOpenGraph.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
#Copyright (c) 2010 Gerson Minichiello
#
@@ -30,9 +31,12 @@
class PyOpenGraph(object):
- def __init__(self, url):
+ def __init__(self, url=None, xml=None):
parser = rdfadict.RdfaParser()
- result = parser.parse_url(url)
+ if not xml:
+ result = parser.parse_url(url)
+ else:
+ result = parser.parse_string(xml, url)
data = result[url]
self.metadata = self.get_properties(data)
Something went wrong with that request. Please try again.