Skip to content

Commit f7960aa

Browse files
committed
minor fixes
1 parent ecf873b commit f7960aa

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

OGParser/src/main/java/com/kedia/ogparser/JsoupNetworkCall.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ class JsoupNetworkCall {
6161
}
6262
}
6363

64-
Log.e("TAG!!!!!", "result ${doc.select("meta[name=description]").first().attr("content")} ${checkNullParserResult(openGraphResult)}")
65-
6664
if (openGraphResult!!.title.isNullOrEmpty())
6765
openGraphResult!!.title = doc.title()
6866
if (openGraphResult!!.description.isNullOrEmpty())

OGParser/src/main/java/com/kedia/ogparser/SharedPrefs.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.kedia.ogparser
22

33
import android.content.Context
44
import android.content.SharedPreferences
5+
import android.util.Log
56
import androidx.preference.PreferenceManager
67

78
class SharedPrefs(context: Context) {
@@ -87,8 +88,12 @@ class SharedPrefs(context: Context) {
8788
val title = getTitle(url)
8889
val description = getDescription(url)
8990
val image = getImage(url)
90-
91-
return title.isNotEmpty() && description.isNotEmpty() && image.isNotEmpty()
91+
return title.isNotEmpty() &&
92+
title.equals("null").not() &&
93+
description.isNotEmpty() &&
94+
description.equals("null").not() //&&
95+
image.isNotEmpty() &&
96+
image.equals("null").not()
9297
}
9398

9499
}

app/src/main/java/com/kedia/opengraphpreview/MainActivity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import kotlinx.android.synthetic.main.activity_main.*
1010

1111
class MainActivity : AppCompatActivity(), OpenGraphCallback {
1212

13-
private val openGraphParser by lazy { OpenGraphParser(this, showNullOnEmpty = true) }
13+
private val openGraphParser by lazy { OpenGraphParser(this, showNullOnEmpty = true, context = this) }
1414

1515
private val LINKS_TO_TEST = mutableListOf(
1616
// "https://www.linkedin.com/posts/madhusmita-padhy_machinelearning-datascience-activity-6886390508722163712-yhQ0",
@@ -22,8 +22,9 @@ class MainActivity : AppCompatActivity(), OpenGraphCallback {
2222
// "https://www.reddit.com/r/MachineLearning/comments/s3mjqf/deep_learning_interviews_hundreds_of_fully_solved/?utm_medium=android_app&utm_source=share",
2323
// "https://instagram.com/fcbarcelona?utm_medium=copy_link",
2424
// "https://www.facebook.com/groups/777946865955982/permalink/1385110621906267/",
25-
"https://www.youtube.com/",
26-
"https://www.instagram.com/"
25+
// "https://www.youtube.com/",
26+
// "https://www.instagram.com/",
27+
"https://klusterapp.io/kluster/message?message_id=7244&channel_id=2247&Channel_name=new-channel-with-spa&kluster_id=64"
2728
)
2829

2930
override fun onCreate(savedInstanceState: Bundle?) {

0 commit comments

Comments
 (0)