'Social Media Meta-Data Open-graph/OG Tags extraction for generating a Link Preview layout in Android
I have been trying to generate a Preview layout in Android which takes a URL input and extracts the meta-data tags associated to display an Image, title and description associated with the said link.
Something what all social media application do, for example Twitter displaying our Firebase dynamic link's preview, and, Instagram showing a Twitter post accurately from the following links:
Twitter displaying preview of our url: link: https://i.zido.com.sa/JwzHau8B1qEP9jB69
Instagram displaying preview of Twitter url:
link: https://twitter.com/Tate/status/1382378879277469697?s=09

So for this I tried using jsoup and its based libraries/classes like JsoupOgTagParser.kt,ogTagParser, and, even RichLinkPreview but most of the extracted things are null, and the images extracted are like just the fav icons of the social media platform themselves like Twitter instead of the post's related image etc. e.g my logs for an Instagram og:title, og:image, and og:desc states this:
Meta data fetched: TITLE: Login • Instagram IMAGE: https://www.instagram.com/static/images/ico/favicon-192.png/68d99ba29cc8.png
But this Facebook Sharing Debugging tool parses and displays all the information correctly.
So basically I'd be grateful if someone could point me in the right direction and tell me what I am missing, I searched a lot but could not find anything relevant much. I do have a hunch that for social media it's leading to Login page and the access is restricted so do I need some registration or something but if you can point out how I can use the Facebook's tool in my case as well that'll be splendid.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

