Giter Club home page Giter Club logo

ogtagparser's Introduction

ogTagParser

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

License

Getting Started

NOTE: This library is not hosted anywhere as of now.

Pass the URL and get the Data

val content = OgTagParser().getContents(URL_TO_PARSE)
content?.let {
  val title = content.ogTitle,
  val description = content.ogDescription,
  val url = content.ogUrl,
  val site_name = content.ogSiteName,
  val type = content.ogType,
  val image = content.image
)

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

ogtagparser's People

Contributors

anandwana001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ogtagparser's Issues

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.

Setup Testing

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

Description what you'd like to happen:

Need to setup testing.

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
+    }

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.