otiai10 / opengraph

Open Graph Parser for Go
https://pkg.go.dev/github.com/otiai10/opengraph
MIT License
65 stars 13 forks source link

Only parse meta tags? #9

Closed anuragdhingra closed 3 years ago

anuragdhingra commented 3 years ago

@mbleigh @otiai10 Hey, I went through the implementation and seems like the fetch method parses title meta and link elements to create the opengraph object. Any way I could just check for meta tags?

otiai10 commented 3 years ago

@anuragdhingra Is this what you want? https://github.com/otiai10/opengraph/pull/10

anuragdhingra commented 3 years ago

Yep, exactly. Thank you!

otiai10 commented 3 years ago

will merge. Thx for your feedback

anuragdhingra commented 3 years ago

@otiai10 Thank you for quick response. Just a suggestion maybe if we could pass an optional policy to the Fetch method, it would make the method more flexible and avoid the need to use New and Parse, what do you think? If no policy is passed maybe it can use some default policy that includes everything.

anuragdhingra commented 3 years ago

If it sounds okay to you, I can send a PR for the same. TIA.

otiai10 commented 3 years ago

Thanks. Sure you can send it.

By the way, I'm planning to release v2.0 coz I don't like the current interface of New, Fetch, and FetchWithContext as they are now.