Skip to content

Commit

Permalink
fixes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
sokomishalov committed Jun 8, 2020
1 parent e9b841d commit 125577a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Maven:
<dependency>
<groupId>com.github.sokomishalov.skraper</groupId>
<artifactId>skrapers</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
</dependency>
</dependencies>
```
Expand All @@ -134,7 +134,7 @@ repositories {
maven { url = uri("http://jitpack.io") }
}
dependencies {
implementation("com.github.sokomishalov.skraper:skrapers:0.4.4")
implementation("com.github.sokomishalov.skraper:skrapers:0.4.5")
}
```

Expand Down
6 changes: 3 additions & 3 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>ru.sokomishalov.skraper</groupId>
<artifactId>skraper-parent</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
</parent>

<artifactId>cli</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>

<properties>
<maven.skip.deploy>true</maven.skip.deploy>
Expand All @@ -21,7 +21,7 @@
<dependency>
<groupId>ru.sokomishalov.skraper</groupId>
<artifactId>skrapers</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
</dependency>
<dependency>
<groupId>com.xenomachina</groupId>
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/kotlin/ru/sokomishalov/skraper/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import kotlin.text.Charsets.UTF_8
fun main(args: Array<String>) = mainBody(columns = 100) {
val parsedArgs = ArgParser(args = args.ifEmpty { arrayOf("--help") }).parseInto(::Args)

println("${"Skraper".green()} ${"v.0.4.4".magenta()} started")
println("${"Skraper".green()} ${"v.0.4.5".magenta()} started")

val posts = runBlocking {
parsedArgs.skraper.getPosts(
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repositories {
}

dependencies {
def skraper_version = "0.4.4"
def skraper_version = "0.4.5"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ru.sokomishalov.skraper</groupId>
<artifactId>skraper-parent</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
<packaging>pom</packaging>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions skrapers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>ru.sokomishalov.skraper</groupId>
<artifactId>skraper-parent</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
</parent>

<artifactId>skrapers</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>

<dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,17 @@ class FacebookSkraper @JvmOverloads constructor(
}

private fun Element.extractPostText(): String? {
return getFirstElementByClass("userContent")
val text = getFirstElementByClass("userContent")
?.getFirstElementByTag("p")
?.wholeText()
?.toString()

val repostText = getFirstElementByAttributeValue("data-testid", "post_message")
?.getFirstElementByTag("p")
?.wholeText()
?.toString()

return text ?: repostText
}

private fun Element.extractPostPublishDateTime(): Long? {
Expand Down

0 comments on commit 125577a

Please sign in to comment.