You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to get others thoughts on adding a feature where if no OGP tags are present, the library could fallback to images in the HTML.
This should be fairly easily done by selecting all img tags in the body using DOMDocument. An example of using DOMDocument like this is where I do fall back for image_src if an OGP image tag is not provided: 155c2f4
So that tiny images aren't included (such as images unrelated to the specific page, eg. user profile pictures), I suggest the library not return images smaller than say 150x150 px.
Some people may not want this feature to occur however, since unrelated images may be found in the body, so there should be a optional parameter you can pass to fetch() to disable it.
This is also related to issue #7 to update the library to return an array for OGP tag types which allow multiple instances of the tag, such as images/video.
This could likely be done for other tags like video as well.
The text was updated successfully, but these errors were encountered:
I wanted to get others thoughts on adding a feature where if no OGP tags are present, the library could fallback to images in the HTML.
This should be fairly easily done by selecting all
img
tags in the body using DOMDocument. An example of using DOMDocument like this is where I do fall back for image_src if an OGP image tag is not provided: 155c2f4So that tiny images aren't included (such as images unrelated to the specific page, eg. user profile pictures), I suggest the library not return images smaller than say 150x150 px.
Some people may not want this feature to occur however, since unrelated images may be found in the body, so there should be a optional parameter you can pass to
fetch()
to disable it.This is also related to issue #7 to update the library to return an array for OGP tag types which allow multiple instances of the tag, such as images/video.
This could likely be done for other tags like video as well.
The text was updated successfully, but these errors were encountered: