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

Added support for other OpenGraph like tags #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daryltucker
Copy link

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.

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.
@daryltucker
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant