What a stunning module, thank you Frans! I was just wondering, how would we scrape an image from the remote site as well please?
Looking most forward to the development of your module. Already see so many uses, ie as an entity field with flags, comments etc :)
Comments
Comment #1
frans commentedTnx Lilian!
Thumbnails are now showing, once the URL uses og:image. Example, use http://www.imdb.com/title/tt0117500/ in your text. More and more sites are using this, just because of our mutual friend Mark Zuckerberg.
But that didn't answer your question...
We can scrape images in the body with a submodule.
Use a HOOK_preprocces_opengraph_filter just like
template_preprocess_opengraph_filter
http://drupalcode.org/project/opengraph_filter.git/blob/refs/heads/7.x-1...
In that preprocess do something like this
Then write the needed function.
The function opengraph_filter_get_html caches the output on the first call, so it should not add extra overhead, other then the magic you add for extracting img tags.
Issues to solve:
Best would be if we find a way to download the image to the local disk, so that we can do imagecache on the module. I know... this is Drupal, so 'There Is A Module For That'™
In this case I know 2 we can use:
http://drupal.org/project/imagecache_external
// Something for the theme function opengraph_filter_image?
http://drupal.org/project/image_resize_filter
// Can be used now i guess, just add the filter after opengraph_filter
My only concern is the speed of it all. Once you hit save on your comment, it starts looking for urls, then from that url it scrapes images, it download images and resizes them... hmmmmm Can't we come up with something better?
Comment #2
3dnathaniel commentedAny luck on this?
Having real issues when the site isn't using og:image or other og tags.
Comment #3
loon commentedComment #4
loon commentedD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
Thanks!