On Facebook, when you paste a direct link to an image, it will actually display the image as part of the post rather than just the link. Has anybody modified OSSN to do the same? It looks like it could be done fairly easily by editing components/OssnWall/plugins/default/wall/templates/wall/user/item.php - just wondering if anyone has already done this to save myself some time.
If not, i'll post my code once I get it working. I know that it's preferable to create a component for any modifications, but this one is so small that I figured directly editing the file I mentioned above would be easiest.
@Pedro , you may can use https://www.softlab24.com/product/view/3790/link-preview
You may also see the code posted here https://www.opensource-socialnetwork.org/discussion/view/2937/embed-external-picture-to-wall-post
Any news on this topic?
no prob lol. I know exactly what you're talking about with the og (facebook's OpenGraph thing) meta tags. I know that Softlab24 has a premium link preview component, which I actually bought, but for some reason could not get it working and support was unfortunately not helpful. I'm actually in the process of writing my own "link preview" code for news feed posts, but I don't think it's a good idea for me to post it here since there exists a premium component with (allegedly) the same functionality. I actually encountered the same issue as you with 'og:image' sometimes being available and other times not. What I decided to do was obtain a screenshot of the page being linked to, and use that as the image instead (figured that would be a more accurate representation). There are a few different ways to do this - either you can use a tool like pageres-cli (https://github.com/sindresorhus/pageres-cli) to create the screenshot locally, or you can use a web-based API like grabz.it or browshot.com (the cheapest I found was grabz.it - 1000 screenshots/month for free). If you want, you can email me, I'm always happy to share: [emailremoved]
I will post the code for making direct links to images show up when I finish it later today.
And this is what I get for not reading slow enough at 5am. Direct link to image. Disregard my entire post, lol.
I've actually found that to be hit or miss with a lot of images on Facebook. Some links will reveal an image and some won't. I believe the difference is in the og:image meta tag parameter; or Facebook's Open Graph to be more specific.
OG allows sites like Facebook, Pinterest, and Google+ to scrape the content and display it natively, so there might be quite a bit of value in building a component for OSSN rather than modifying item.php directly. The obvious benefits would be a standardized method of storing information, efficient use of resources, and not making web scrapes on every page load. Caveats would be the same as Facebook; if they're not using the og:image meta tag, there won't be anything to scrape/index when a link is posted.
Just my two cents. I'm curious to see what you come up with.
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)