-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added NovelWorld! Still some things I need to take care of includin…
…g a new logo and another source.
- Loading branch information
1 parent
a57f098
commit 5a8479b
Showing
50 changed files
with
1,250 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
} | ||
|
||
android { | ||
compileSdkVersion 30 | ||
|
||
defaultConfig { | ||
minSdkVersion 23 | ||
targetSdkVersion 30 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles "consumer-rules.pro" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
implementation androidCore | ||
implementation appCompat | ||
testImplementation 'junit:junit:4.+' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.2' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' | ||
|
||
implementation gsonutils | ||
implementation helpfulutils | ||
implementation rxutils | ||
implementation gson | ||
|
||
implementation jsoup | ||
|
||
implementation rxkotlin | ||
implementation rxandroid | ||
|
||
implementation project(':Models') | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
22 changes: 22 additions & 0 deletions
22
..._sources/src/androidTest/java/com/programmersbox/novel_sources/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.programmersbox.novel_sources | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.programmersbox.novel_sources.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.programmersbox.novel_sources"> | ||
|
||
</manifest> |
17 changes: 17 additions & 0 deletions
17
novel_sources/src/main/java/com/programmersbox/novel_sources/Sources.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.programmersbox.novel_sources | ||
|
||
import com.programmersbox.models.ApiService | ||
import com.programmersbox.novel_sources.novels.WuxiaWorld | ||
import org.jsoup.Jsoup | ||
|
||
enum class Sources( | ||
val source: ApiService | ||
) : ApiService by source { | ||
|
||
WUXIAWORLD(WuxiaWorld); | ||
|
||
override val serviceName: String get() = this.name | ||
|
||
} | ||
|
||
internal fun String.toJsoup() = Jsoup.connect(this).get() |
98 changes: 98 additions & 0 deletions
98
novel_sources/src/main/java/com/programmersbox/novel_sources/novels/WuxiaWorld.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.programmersbox.novel_sources.novels | ||
|
||
import com.programmersbox.models.* | ||
import com.programmersbox.novel_sources.Sources | ||
import com.programmersbox.novel_sources.toJsoup | ||
import io.reactivex.Single | ||
|
||
object WuxiaWorld : ApiService { | ||
|
||
override val baseUrl: String get() = "https://wuxiaworld.online" | ||
|
||
override fun getRecent(page: Int): Single<List<ItemModel>> = Single.create { | ||
val pop = "/wuxia-list?view=list&page=$page" | ||
"$baseUrl$pop".toJsoup() | ||
.select("div.update_item") | ||
.map { | ||
ItemModel( | ||
title = it | ||
.select("h3") | ||
.select("a.tooltip") | ||
.attr("title"), | ||
description = "", | ||
imageUrl = it.select("img").attr("abs:src"), | ||
url = it | ||
.select("h3") | ||
.select("a.tooltip") | ||
.attr("abs:href"), | ||
source = this | ||
) | ||
} | ||
.let(it::onSuccess) | ||
} | ||
|
||
override fun getList(page: Int): Single<List<ItemModel>> = Single.create { | ||
val pop = "/wuxia-list?view=list&sort=popularity&page=$page" | ||
"$baseUrl$pop".toJsoup() | ||
.select("div.update_item") | ||
.map { | ||
ItemModel( | ||
title = it | ||
.select("h3") | ||
.select("a.tooltip") | ||
.attr("title"), | ||
description = "", | ||
imageUrl = it.select("img").attr("abs:src"), | ||
url = it | ||
.select("h3") | ||
.select("a.tooltip") | ||
.attr("abs:href"), | ||
source = this | ||
) | ||
} | ||
.let(it::onSuccess) | ||
} | ||
|
||
override fun getItemInfo(model: ItemModel): Single<InfoModel> = Single.create { | ||
|
||
val info = model.url.toJsoup() | ||
|
||
InfoModel( | ||
source = this, | ||
url = model.url, | ||
title = model.title, | ||
description = info.select("meta[name='description']").attr("content"), | ||
imageUrl = model.imageUrl, | ||
genres = emptyList(), | ||
chapters = info | ||
.select("div.chapter-list") | ||
.select("div.row") | ||
.select("span") | ||
.select("a") | ||
.map { | ||
ChapterModel( | ||
name = it.attr("title"), | ||
url = it.attr("abs:href"), | ||
uploaded = "", | ||
source = Sources.WUXIAWORLD | ||
) | ||
}, | ||
alternativeNames = emptyList() | ||
) | ||
.let(it::onSuccess) | ||
|
||
} | ||
|
||
override fun getChapterInfo(chapterModel: ChapterModel): Single<List<Storage>> = Single.create { | ||
it.onSuccess( | ||
listOf( | ||
Storage( | ||
link = chapterModel.url.toJsoup().select("div.content-area").html(), | ||
source = chapterModel.url, | ||
quality = "Good", | ||
sub = "Yes" | ||
) | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.