opengraph
opengraph copied to clipboard
Added support for other OpenGraph like tags
Twitter and OpenGraph have been split apart. I made all attempts to respect OpenGraph as the default provider, while allowing either to be used very easily.
Each 'Provider' can have different required attributes, as well as the attribute we key off of for finding these tags.
Passing provider to OpenGraph() will force a Provider. If any OpenGraph tags are found, OpenGraph becomes the Provider, which forces validity of OpenGraph instead of the original Provider.
is_valid() has been modified such that it will use the detected Provider. If tags of mixed providers are found, OpenGraph will take precedence.
to_html() has been altered to print using the Provider's name.
OrderedDict from collections is used to keep OpenGraph as top priority.
I'm not sure if you ever wanted to support other Providers, but I figured I'd share the code with you. Thanks for writing opengraph :D