Preview the url in android like facebook does before submitting the link (viewing links)

I have an EditText to input a web link. I want to view the entered URL, similar to the function on Facebook, where we will place the link and see the image of the page with the header at the top and the URL at the bottom.

How can I develop this in Android?

+4
source share
1 answer

Use JSOUP after a user enters a link in editext to parse your links. OG meta tags (this is what FB watches). Clear meta tags:

Here is an example of the meta information you want from a recent article nytimes

<meta property="og:url" content="http://www.nytimes.com/2013/03/16/world/europe/pope-francis-praises-benedict-urges-cardinals-to-spread-gospel.html"/> <meta property="og:type" content="article"/> <meta property="og:title" content="Vatican Rejects Argentine Accusations Against Pope Francis"/> <meta property="og:description" content="The Vatican on Friday formally defended Pope Francis' role in Argentina's so-called "Dirty War," amid accusations that he failed to halt abuses of which he had knowledge."> <meta property="og:image" content="http://graphics8.nytimes.com/images/2013/03/16/world/16vatican/16vatican-superJumbo.jpg"/> 
+6
source

All Articles