0

My application is enabled for external share . I do get link in my application when a tweet is shared from Twitter. Say this is the link

Check out @manoramanews's Tweet: https://twitter.com/manoramanews/status/958975623380156416?s=09

When I share the same link on Facebook or WhatsApp a view is shown with details of the link like image, title of tweet and description of tweet.

I need these details. How do I get these info in my app

EDIT 1:

I tried parsing the link using this code

Document finaldoc = null; //fin[f] contains url at each instance
        try {
            finaldoc = Jsoup.connect(strings[0]).get();
            Elements finallink1 = finaldoc.select("title");
            Log.e(FragmentShareWithSparrows.class.getName(), "1" + finallink1);
            Elements finallink2 = finaldoc.select("meta");
            Log.e(FragmentShareWithSparrows.class.getName(), "2" + finallink2);
            dd = getMetaTag(finaldoc, "description");
            if (dd == null || dd.length() == 0) {
                dd = getMetaTag(finaldoc, "og:description");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        Log.e(FragmentShareWithSparrows.class.getName(), "3" + dd);

am not sure if thats the right way to get the info I need

EDIT 2 Its not duplicated of this SO question as this is how to set up image in their website. While am asking how to get the image from a link.

suja
  • 1,198
  • 2
  • 12
  • 32

0 Answers0