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

Including "Article" attributes #18

Open
ryanjyost opened this issue Mar 2, 2017 · 6 comments
Open

Including "Article" attributes #18

ryanjyost opened this issue Mar 2, 2017 · 6 comments

Comments

@ryanjyost
Copy link
Contributor

First, just want to quickly say thanks for this great module.

For the project I'm working on, I'd like to display the author. This isn't strictly "og", but should be simple addition? If you're against including for this project, I'll try on my own. Thanks, and happy to submit pull if/when I add the feature (would be my first, I'm a novice relatively speaking).

@ryanjyost ryanjyost changed the title Grabbing "Article" attributes Including "Article" attributes Mar 2, 2017
@samholmes
Copy link
Owner

I'm very liberal when it comes to pull requests. So any contributions would be greatly appreciated!

I'd like to clear up what you mean by "Article" attributes and "author"?

@ryanjyost
Copy link
Contributor Author

Per the Open Graph Protocol , they refer to an article og:type. So the article:author property, or just an <author> tag if present.

@samholmes
Copy link
Owner

Right now the module will (should) only return OG meta tag data. So as it stands you should be getting the article:author property returned from the module?

Number 3 on the Todo list is to use fallback data if an OG tag isn't present (document title, etc). I haven't gotten to this yet, but I wouldn't mind a PR on this! :)

@ryanjyost
Copy link
Contributor Author

article:author does not have the og prefix, so it is skipped on line 95 of index.js.

The article:author property unfortunately isn't as common as the og prefixed tags, so getting the author consistently will require fallback data.

I'll work on getting the author, first through meta data (article:author or just author), then via scraping the page. Obviously the goal is to have fallback data for everything that does not have a meta tag, but maybe we can get the ball rolling with the author?

@samholmes
Copy link
Owner

@ryanjyost could you provide a URL that uses the article OG type. This way I can get a better example.

@ryanjyost
Copy link
Contributor Author

Here's one from the Washington Post, though the more I delve into this, the more it seems the article:authorproperty is used for links to the Facebook pages of authors, or is not present at all. The Open Graph docs and my initial research seemed more promising than that.

Getting the author, if that's still considered a worthwhile addition to this module, may be best addressed through finding name="author" or by scraping the page.

Sorry for the confusion!

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

No branches or pull requests

2 participants