From ece41a27e5a4eaabf9ee55eee65809d7cfd4edc9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 18 Nov 2019 11:04:53 +0800 Subject: [PATCH] up --- app/src/main/assets/rssSource.json | 319 ------------------ .../io/legado/app/ui/main/MainActivity.kt | 6 - .../io/legado/app/ui/main/MainViewModel.kt | 15 - 3 files changed, 340 deletions(-) delete mode 100644 app/src/main/assets/rssSource.json diff --git a/app/src/main/assets/rssSource.json b/app/src/main/assets/rssSource.json deleted file mode 100644 index 1cdc02066..000000000 --- a/app/src/main/assets/rssSource.json +++ /dev/null @@ -1,319 +0,0 @@ -[ - { - "customOrder": 14, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "class.wrap", - "ruleContent": "@js:String(result).replace(/
').replace(/
[\\s\\S]*/,\"\")", - "ruleImage": "tag.img@src", - "ruleLink": "class.link-button@href", - "rulePubDate": "", - "ruleTitle": "class.title@text", - "sourceGroup": "Origin", - "sourceIcon": "http://static.daily.zhihu.com/img/app-logo.png", - "sourceName": "知乎日報", - "sourceUrl": "https://daily.zhihu.com" - }, - { - "customOrder": 2, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "@css:.cell.item", - "ruleContent": "@js:var doc=org.jsoup.Jsoup.parse(result);\n\"

\"+doc.select(\"h1\").text()+\"

\"+String(doc.select(\"#img-content\").html()).replace(/data-src=/g,\"src=\")", - "ruleImage": "@css:.topic_image>img@src", - "ruleLink": "@css:.item_title>a@href", - "rulePubDate": "@css:.fade@text", - "ruleTitle": "@css:.item_title@text", - "sourceGroup": "JTKS", - "sourceIcon": "https://gitee.com/alanskycn/yuedu/raw/master/JS/xiaoshuoshiyi.jpg", - "sourceName": "小說拾遺", - "sourceUrl": "http://www.jintiankansha.me/column/LoglHJhFTR" - }, - { - "customOrder": 1, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "@css:.cell.item", - "ruleContent": "var doc=org.jsoup.Jsoup.parse(result);\n\"

\"+doc.select(\"h1\").text()+\"

\"+String(doc.select(\"#img-content\").html()).replace(/data-src=/g,\"src=\")
", - "ruleImage": "@css:.topic_image>img@src", - "ruleLink": "@css:.item_title>a@href", - "rulePubDate": "@css:.fade@text", - "ruleTitle": "@css:.item_title@text", - "sourceGroup": "JTKS", - "sourceIcon": "http://img.100weidu.com/weixin/head/MzI5NTA4NjgwNw==", - "sourceName": "赤戟的书荒救济所", - "sourceUrl": "http://www.jintiankansha.me/column/qOcZgyKfdi" - }, - { - "customOrder": 3, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "@css:.t_news", - "ruleContent": "@js:org.jsoup.Jsoup.parse(result).select(\".news_content\").html()", - "ruleImage": "@css:.img_t>a:eq(0)>img@src##^##https:", - "ruleLink": "@css:.news_tit02 a@href", - "rulePubDate": "@css:.news_info>span:eq(1)@text", - "ruleTitle": "@css:.news_tit02 a@text", - "sourceGroup": "", - "sourceIcon": "https://file.thepaper.cn/wap/v3/img/deskicon.png", - "sourceName": "澎湃新闻", - "sourceUrl": "https://m.thepaper.cn/" - }, - { - "customOrder": 6, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/qdaily.jpg", - "sourceName": "好奇心日报", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=13&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 5, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/mtime.jpg", - "sourceName": "时光网", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=27&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 8, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/zimuzu-9999x0w.jpg", - "sourceName": "字幕组", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=3&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 11, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/doubanmoviereview.jpg", - "sourceName": "豆瓣最受欢迎的影评", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=76&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 7, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/anitama.jpg", - "sourceName": "Anitama", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=86&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 12, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/nfw.png", - "sourceName": "南方要闻", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":80}\"\n}" - }, - { - "customOrder": 9, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/iplaysoft.png", - "sourceName": "异次元软件世界", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":51}\"\n}" - }, - { - "customOrder": 13, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/appin.png", - "sourceName": "小众软件", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":14}\"\n}" - }, - { - "customOrder": 15, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/zhangzishi.png", - "sourceName": "涨姿势", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":78}\"\n}" - }, - { - "customOrder": 16, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/penti.png", - "sourceName": "喷嚏图卦", - "sourceUrl": "http://47.105.79.245/v3/article?feedId=66&articleId=0&pageSize=20&isLookDown=true" - }, - { - "customOrder": 17, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/guancha.jpg", - "sourceName": "观察者 要闻", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:28}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":105}\"\n}" - }, - { - "customOrder": 18, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/meiriyiwen.png", - "sourceName": "每日一文", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":87}\"\n}" - }, - { - "customOrder": 4, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": false, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "http://47.105.79.245/netease.jpg", - "sourceName": "网易要闻", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:27}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":98}\"\n}" - }, - { - "customOrder": 19, - "enableJs": false, - "enabled": true, - "loadWithBaseUrl": false, - "ruleArticles": "$.data.data[*]", - "ruleContent": "

{$.data.title}

时间:{$.data.createTimeString}({$.data.createTime})

{$.data.content}原文链接", - "ruleDescription": "", - "ruleImage": "$.thumbnail", - "ruleLink": "http://47.105.79.245/v2/text/{$.id}", - "rulePubDate": "$.createTimeString", - "ruleTitle": "$.title", - "sourceGroup": "", - "sourceIcon": "https://static.zhihu.com/heifetz/assets/apple-touch-icon-120.b3e6278d.png", - "sourceName": "知乎每日精选", - "sourceUrl": "http://47.105.79.245/v2/article/newest,{\n \"headers\": \"{User-Agent:\\\"okhttp/3.10.0\\\",Content-Type:\\\"application/json; charset=UTF-8\\\",Content-Length:26}\",\n \"method\": \"POST\",\n \"body\": \"{\\\"articleId\\\":0,\\\"feedId\\\":8}\"\n}" - }, - { - "customOrder": 0, - "enableJs": true, - "enabled": true, - "loadWithBaseUrl": true, - "ruleArticles": "@css:.booklist-card", - "ruleContent": "", - "ruleLink": "@css:.booklist-card-content>a@href##^##http://www\\.yousuu\\.com", - "rulePubDate": "@css:.ResultBooklistItemClasses,.ResultBooklistItemUpdateAt@text##,,##,", - "ruleTitle": "@css:.booklist-card-content>a@text", - "sourceGroup": "", - "sourceIcon": "https://gitee.com/alanskycn/yuedu/raw/master/JS/youshuwang.png", - "sourceName": "优书网", - "sourceUrl": "http://www.yousuu.com/booklists?type=man&screen=latest&page=1" - } -] \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 46eaa1deb..5509812c1 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -74,14 +74,8 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), .request() } noButton { - viewModel.initRssSource() - } - onCancelled { - viewModel.initRssSource() } }.show().applyTint() - } else { - viewModel.initRssSource() } } } diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index 7fe551f55..2e275ca47 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -5,11 +5,8 @@ import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.constant.BookType import io.legado.app.constant.Bus -import io.legado.app.data.entities.RssSource import io.legado.app.help.storage.Restore import io.legado.app.model.WebBook -import io.legado.app.utils.GSON -import io.legado.app.utils.fromJsonArray import io.legado.app.utils.postEvent import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.delay @@ -20,7 +17,6 @@ class MainViewModel(application: Application) : BaseViewModel(application) { fun importYueDuData() { execute { Restore.importYueDuData(getApplication()) - initRssSource() } } @@ -62,15 +58,4 @@ class MainViewModel(application: Application) : BaseViewModel(application) { } } - fun initRssSource() { - execute { - if (App.db.rssSourceDao().size == 0) { - val json = String(context.assets.open("rssSource.json").readBytes()) - val sources = GSON.fromJsonArray(json) - if (sources != null) { - App.db.rssSourceDao().insert(*sources.toTypedArray()) - } - } - } - } } \ No newline at end of file