I like the way Facebook interprets when a link is posted on their editor. Instead of giving a plain line of text it give a preview of what the link contains. In case of ElkArte, may be we can offer it on hover. But it looks like an interesting idea to have on board
Facebook uses something they call OpenGraph.
https://davidwalsh.name/facebook-meta-tags
A quick search based on that knowledge suggests you could probably stick https://github.com/markserbol/urlive on your page.
As a default I think such a thing would probably be too heavy.
LOL, funny thing is I made this for SMF and it isn't as popular as I thought it would be.
The code is a little sloppy because I was planning it for only Open Graph, but then I had to add oEmbed and Meta support.
SMF Mod Site
http://custom.simplemachines.org/mods/index.php?mod=4075
GitHub
https://github.com/sicommnend/SMF-Open-Embed
Some Demos
http://dev.sicomm.us/index.php?board=2.0;sort=subject
Considering the nature of the license, if any one wants to adapt or improve upon it, go ahead. Also if you don't mind push me some commits of any improvements. ;)
@nend , the intension is to give preview of plain links not media links. That's what the mod does ?
What irks me about this "stuff" is that posting a link on FB/TW/G+/WhatEver it is likely to be the only thing you are ever going to post, so it kind of make sense to have a preview of the content, but if you put an url in a message on a forum, it's unlikely to be the only thing posted in the body of the text, let's take nend's post as an example, using this approach, the final result would be something like:
that, it kind of... sucks, IMO.
Anyway, addons are possible, so go for it! :P
I would suggest " Preview on Hover " in that case. Just like some forum software gives preview of content when you hover on topic in topic index.
Oops, missed that part.
Then, another "problem" is with mobile devices where hovering basically doesn't exist.
Ok :)
Now that I think of it, how about a custom BB code which will give link preview to a link ? In that case, we can posters can themselves decide whether or not to add a " Link Preview ".
It does both, Emanuele's posted example is what it does. If OG information doesn't exist it tries oEmbed and Meta. If the webmaster is lazy and doesn't supply any information in the head then it falls through to a normal link.
Main inspiration when creating this was the sloppy embed mods, you know the ones "Embed something BBC". Then they usually have a huge array just to parse the content. It's like why would I want to go that route to embed stuff when there are frameworks and standards available.
Sort of posted at same time. That's what this modification does.
Missed this. Due to my current situation at SM, I'll not be rewriting it for Elk. However if someone is wanting to use any bit of it or use it as a reference...
Noticed only now, should I say congratz? :P
What's wrong ? Elk developers are not welcome at SM ?
Well, I know how it feels, and not because it's SMF, but just because it is strange to contribute to two projects that shared what Elk and SMF share.
On the other hands, others like live627 have ported their mods even while being on the SMF team, so it's not that stranage, just a personal choice. Completely understandable. ;)
Yeah it's more personal. I haven't looked at what changed in the two systems, so there's the learning curve. If I take on something else, then I have to take time away from other things.