📲Android library to parse open graph tags (ogTags) from given URL.

Overview

ogTagParser

Android library to parse open graph tags (ogTags) from given URL.

License

Getting Started

Step 1. Add the dependency

Root Level Build.gradle file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

module level build.gradle file

dependencies {
    ...
    implementation 'com.github.anandwana001:ogTagParser:1.0.2'
}
Step 2. Pass the URL and get the Data
OgTagParser().getContents(

    URL_TO_PARSE,

    object : LinkViewCallback {

        override fun onAfterLoading(linkSourceContent: LinkSourceContent) {

             // og:title
             linkSourceContent.ogTitle

             // og:description
             linkSourceContent.ogDescription

             // og:url
             linkSourceContent.ogUrl

             // og:site_name
             linkSourceContent.ogSiteName

             // og:type
             linkSourceContent.ogType

             // og:image
             linkSourceContent.images
        }
    }
)

If this library helps you in anyway, show your love ❤️ by putting a on this project ✌️

Contribute

Love to see the contribution and build this repo a more better version. So if you have any issues, new ideas about implementations then just raise issue and we are open for Pull Requests. Improve and make it happen. See Contributing Guidelines.

License

License

You might also like...
Android library for viewing, editing and sharing in app databases.
Android library for viewing, editing and sharing in app databases.

DbInspector DbInspector provides a simple way to view the contents of the in-app database for debugging purposes. There is no need to pull the databas

Android Market In-app Billing Library

Update In-app Billing v2 API is deprecated and will be shut down in January 2015. This library was developed for v2 a long time ago. If your app is st

An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt

Motion An Android library allowing images to exhibit a parallax effect. By replacing static pictures and backgrounds with a fluid images that reacts t

Android library to easily serialize and cache your objects to disk using key/value pairs.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

Form Validator Library for Android

Android-Validator Form Validator Library for Android [](https://flattr.com/submit/auto?user_id=throrin19&url=https://github.com/throrin19/Android-Vali

Very easy to use wrapper library for Android SharePreferences

Treasure English document Treasure是一个Android平台上基于SharePreferences的偏好存储库,只需要定义接口,无需编写实现,默认支持Serializable和Parcelable。运行时0反射,不仅使用方便而且性能和原生写法几乎无差别。 使用方法 1

Error handling library for Android and Java

ErrorHandler Error handling library for Android and Java Encapsulate error handling logic into objects that adhere to configurable defaults. Then pass

Small Android library to help you incorporate MVP, Passive View and Presentation Model patterns in your app
Small Android library to help you incorporate MVP, Passive View and Presentation Model patterns in your app

DroidMVP About DroidMVP is a small Android library to help you incorporate the MVP pattern along with Passive View and Presentation Model (yes, those

A simple Android utils library to write any type of data into cache files and read them later.

CacheUtilsLibrary This is a simple Android utils library to write any type of data into cache files and then read them later, using Gson to serialize

Comments
  • update sample app

    update sample app

    Guidelines

    1. A PR should be focused and contained. If you are changing multiple unrelated things, they should be in separate PRs.
    2. A PR should fix a bug or solve a problem - something that only you would use is not necessarily something that should be published.
    3. Give your PR a detailed title and description - look over your code one last time before actually creating the PR. Give it a self-review.

    If you do not follow the guidelines, your PR will be rejected.

    opened by anandwana001 0
  • Support Image from non secure url

    Support Image from non secure url

    Please consider making a Pull Request if you are capable of doing so.

    Library Version:

    1.0.2

    Describe the Bug:

    Currently, the library doesn't support showing images from non-secure URLs

    Expected Behavior:

    Need to check if it is a good idea to show images or is there any other way to work this out.

    bug 
    opened by anandwana001 0
  • set userAgent

    set userAgent

    I want to be able to set the user agent. I can't get Twitter OgTag now.

    solution https://qiita.com/JunkiHiroi/items/f03d4297e11ce5db172e

    like this curl 'https://twitter.com/hatakenjiro/status/1267448662839357441' -H 'User-Agent: bot

    my proposal

    --- a/ogtagparser/src/main/java/com/anandwana001/ogtagparser/OgTagParser.kt
    +++ b/ogtagparser/src/main/java/com/anandwana001/ogtagparser/OgTagParser.kt
    @@ -16,6 +16,12 @@ import kotlin.coroutines.CoroutineContext
     class OgTagParser {
    
         private var callback: LinkViewCallback? = null
    +    private var userAgent: String = "Mozilla"
    +
    +    fun setUserAgent(userAgent: String): OgTagParser {
    +        this.userAgent = userAgent
    +        return this
    +    }
    
    opened by tomovwgti 1
  • Improve use of Coroutine

    Improve use of Coroutine

    Please consider making a Pull Request if you are capable of doing so.

    Description what you'd like to happen: Currently, I had implemented the CoroutineScope to use the CoroutineContext to access the job instance. As per the doInBackground(), using withContext() with a coroutine context. Need to have the same context as above. Make this doInBackground() cancellable as it's a suspend function.

    opened by anandwana001 0
Releases(1.0.2)
Owner
Akshay Nandwana
Android Engineer I
Akshay Nandwana
LearningRegex - Parse links from text via RegEx

Parse links from text via RegEx Supported types: Hashtags Urls emails Using in p

Boris 0 Feb 16, 2022
Gitversion - A native console application to calculate a version based on git commits and tags

GitCommit A native console application to calculate a version based on git commi

Solugo 5 Sep 13, 2022
Routable, an in-app native URL router, for Android

Routable Routable is an in-app native URL router, for Android. Also available for iOS. Usage Set up your app's router and URLs: import com.usepropelle

Clay Allsopp 476 Nov 11, 2022
an android app to browse urls before open

link eye - kuesji koesnu - 8/8/2021 an android app to browse urls before open try to open a link, select link eye and choose always to start using

kuesji koesnu 25 Dec 31, 2022
Android library which makes it easy to handle the different obstacles while calling an API (Web Service) in Android App.

API Calling Flow API Calling Flow is a Android library which can help you to simplify handling different conditions while calling an API (Web Service)

Rohit Surwase 19 Nov 9, 2021
Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Shahid Iqbal 4 Nov 29, 2022
A robust native library loader for Android.

ReLinker A robust native library loader for Android. More information can be found in our blog post Min SDK: 9 JavaDoc Overview The Android PackageMan

Keepsafe 2.9k Dec 27, 2022
Joda-Time library with Android specialization

joda-time-android This library is a version of Joda-Time built with Android in mind. Why Joda-Time? Android has built-in date and time handling - why

Daniel Lew 2.6k Dec 9, 2022
UPnP/DLNA library for Java and Android

Cling EOL: This project is no longer actively maintained, code may be outdated. If you are interested in maintaining and developing this project, comm

4th Line 1.6k Jan 4, 2023
:iphone: [Android Library] Get device information in a super easy way.

EasyDeviceInfo Android library to get device information in a super easy way. The library is built for simplicity and approachability. It not only eli

Nishant Srivastava 1.7k Dec 22, 2022