- Before fetching remote document for extracting tags, a HEAD request is now made to check the content type of the document. Anything that is not
text/html
is then skipped.
- A failed fetch due to network errors (for example timeout) now do a
debug
level logger instead ofwarning
like before.
-
Use a default user agent if none given.
-
Allow passing a
timeout
that will be used withrequests.get
.A default timeout of 10 seconds will be used if a timeout is not passed in.
-
No longer fetch other URL's than "http" and "https" protocols.
-
Catch exceptions raised by
requests.get
.On an exception, return an empty result and log with warning level to the logger
opengraph
.
Released to PyPi under the name python-opengraph-jaywink
.
-
OpenGraph
now allows passing in aparser
argument, which defaults tohtml.parser
.A valid
parser
is anythingBeautifulSoup
supports, for examplelxml
orhtml5lib
. You must have the right parser installed when callingOpenGraph
, except the defaulthtml.parser
which is built-in to Python.
-
OpenGraph
no longer "remembers" old OG tags from previous class instances.Data dictionary has been moved from class to instance attributes to ensure clean data is available every time the class is used.
First release on Pypi as python-opengraph
with basic OG tags parsing.