hexacta/sanata

Embed media

pomber opened this issue ยท 4 comments

It would be nice to embed images and videos like Twitter does.

Links are already included in the generated tweets as text, we should find a way to check if it's something embeddable and embed it.

As far as I could see, the urls for the images are like:
http://twitpic.com/2cw2so
http://bit.ly/lPbljU (this ends up being a twitpic too)

which points to an HTML page with a body and an "img" tag inside the body, so it can't be added as the "src" of an img tag inside sanata.

we could use an iframe, but there is no easy way to know if the url is just the HTML with the image embedded or an url of a site

another option could be to "read" the html of that url, and if the body only has an img, then show that

fnc commented

I think we could use Open Graph protocol to get the image's url inside the given url's target site. Facebook, twitter and some other sites use it so sanata could get images from them.
There is a package for node https://www.npmjs.com/package/open-graph-scraper.

fnc commented

I will work on this if you agree ๐Ÿ˜ƒ

yes! of course. Go ahead