This commit is contained in:
lunaticbum 2026-02-05 18:16:20 +09:00
parent 98d4d3e463
commit 764025f1e7
7 changed files with 30 additions and 26 deletions

View File

@ -231,7 +231,7 @@ class ForeGroundService : Service() {
TaskAggregator.refreshSystemInfo(applicationContext) TaskAggregator.refreshSystemInfo(applicationContext)
TaskAggregator.refreshNewsFeeds(applicationContext)
// 1. 시스템 정보: 자주 변경되지 않으므로 1~3시간 간격 // 1. 시스템 정보: 자주 변경되지 않으므로 1~3시간 간격
val systemRequest = PeriodicWorkRequestBuilder<AggregatedSystemWorker>(PrefLong.longTimePeriod.get(120L), TimeUnit.MINUTES) val systemRequest = PeriodicWorkRequestBuilder<AggregatedSystemWorker>(PrefLong.longTimePeriod.get(120L), TimeUnit.MINUTES)
.build() .build()

View File

@ -189,8 +189,8 @@ open class DcInside : RssDataInterface {
} else if (dateTiem?.contains("-") == true) { } else if (dateTiem?.contains("-") == true) {
val cal: Calendar = Calendar.getInstance() val cal: Calendar = Calendar.getInstance()
cal.setTime(Date()) cal.setTime(Date())
cal.set(Calendar.MONTH, dateTiem!!.split("-")[0].toInt() - 1) // cal.set(Calendar.MONTH, dateTiem!!.split("-")[0].toInt() - 1)
cal.set(Calendar.DAY_OF_MONTH, dateTiem!!.split("-")[1].toInt()) // cal.set(Calendar.DAY_OF_MONTH, dateTiem!!.split("-")[1].toInt())
// cal.add(Calendar.DAY_OF_MONTH, -1) // cal.add(Calendar.DAY_OF_MONTH, -1)
dateTiemL = cal.timeInMillis dateTiemL = cal.timeInMillis
dateTiemL dateTiemL

View File

@ -57,9 +57,9 @@ enum class RssDataType {
} }
companion object { companion object {
fun getExcAdt() = arrayListOf(NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO, ARCA).map { it.name } fun getExcAdt() = arrayListOf(NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO).map { it.name }
fun getAdts() = arrayListOf( REDDIT_NSFW).map { it.name } fun getAdts() = arrayListOf( REDDIT_NSFW).map { it.name }
fun getAll() = arrayListOf(TORRENT, YOUTUBE, NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO, ARCA,PRIVATE,REDDIT_NSFW) fun getAll() = arrayListOf(YOUTUBE, NEWSFEED, REDDIT, DOTAX, FMKORAE, DCINSIDE, RULIWEB, CLIEN, THEQOO, PRIVATE,REDDIT_NSFW)
} }
} }

View File

@ -3,7 +3,6 @@ package bums.lunatic.launcher.workers
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.work.WorkerParameters
import bums.lunatic.launcher.model.RssDataType import bums.lunatic.launcher.model.RssDataType
import bums.lunatic.launcher.model.RuliWeb import bums.lunatic.launcher.model.RuliWeb
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
@ -17,7 +16,7 @@ class RuliWebGetter(context: Context) : BaseGetter(context) {
} }
fun parseRuli(ruli_tr : org.jsoup.nodes.Element) { fun parseRuli(ruli_tr : org.jsoup.nodes.Element) {
Blog.LOGE("ruli_tr >>> ${ruli_tr.text()}") // Blog.LOGE("ruli_tr >>> ${ruli_tr.text()}")
var aTags = ruli_tr.getElementsByTag("a") var aTags = ruli_tr.getElementsByTag("a")
var tagIdx = 0 var tagIdx = 0
var pageLink = "" var pageLink = ""
@ -33,6 +32,12 @@ class RuliWebGetter(context: Context) : BaseGetter(context) {
} }
tagIdx = 1 tagIdx = 1
if(ruli_tr.getElementsByTag("a").size > tagIdx) { title = aTags.get(tagIdx).text() } if(ruli_tr.getElementsByTag("a").size > tagIdx) { title = aTags.get(tagIdx).text() }
if (title.isNullOrBlank()) {
val link: org.jsoup.nodes.Element? = ruli_tr.selectFirst("a.subject_link.deco")
if (link != null) {
title = link.ownText().trim()
}
}
tagIdx = 2 tagIdx = 2
if(ruli_tr.getElementsByTag("a").size > tagIdx) { desc = aTags.get(tagIdx).text().plus(" / ") } if(ruli_tr.getElementsByTag("a").size > tagIdx) { desc = aTags.get(tagIdx).text().plus(" / ") }
tagIdx = 3 tagIdx = 3
@ -57,6 +62,7 @@ class RuliWebGetter(context: Context) : BaseGetter(context) {
} }
} }
} }
Blog.LOGE("RULIWEB ${temp.size}")
} }
@SuppressLint("RestrictedApi") @SuppressLint("RestrictedApi")
@ -65,7 +71,7 @@ class RuliWebGetter(context: Context) : BaseGetter(context) {
RssDataType.RULIWEB.isOn { RssDataType.RULIWEB.isOn {
try { try {
Blog.LOGE("realWork() ${this::class.simpleName}") Blog.LOGE("realWork() ${this::class.simpleName}")
val testUrl2 = arrayListOf("https://bbs.ruliweb.com/best/humor_only","https://bbs.ruliweb.com/best/humor_only/now?m=humor_only&t=default&page=2") val testUrl2 = arrayListOf("https://bbs.ruliweb.com/best/humor_only/now?range=24h","https://bbs.ruliweb.com/best/humor_only/now?range=24h&page=2")
testUrl2.forEach { url -> testUrl2.forEach { url ->
Jsoup.connect(url).timeout(5000).ignoreHttpErrors(true) Jsoup.connect(url).timeout(5000).ignoreHttpErrors(true)
.userAgent(USAGT) .userAgent(USAGT)

View File

@ -94,6 +94,7 @@ object TaskAggregator {
// 병렬로 네트워크 요청 쏘기 (시간 획기적으로 단축됨) // 병렬로 네트워크 요청 쏘기 (시간 획기적으로 단축됨)
val jobs = listOf( val jobs = listOf(
async { RuliWebGetter(context).fetchData() }, async { RuliWebGetter(context).fetchData() },
async { TheQooGetter(context).fetchData() },
async { YoutubeGetter(context).fetchData() }, async { YoutubeGetter(context).fetchData() },
async { DCGetter(context).fetchData() }, async { DCGetter(context).fetchData() },
async { FmKoreaGetter(context).fetchData() }, async { FmKoreaGetter(context).fetchData() },

View File

@ -8,6 +8,7 @@ import bums.lunatic.launcher.model.TheQoo
import bums.lunatic.launcher.model.getHref import bums.lunatic.launcher.model.getHref
import bums.lunatic.launcher.model.getRssData import bums.lunatic.launcher.model.getRssData
import bums.lunatic.launcher.model.getT import bums.lunatic.launcher.model.getT
import bums.lunatic.launcher.utils.Blog
import io.realm.kotlin.types.RealmObject import io.realm.kotlin.types.RealmObject
import org.jsoup.Jsoup import org.jsoup.Jsoup
@ -18,7 +19,7 @@ class TheQooGetter(context: Context) : BaseGetter(context) {
fun parseTQoo(tq_tr : org.jsoup.nodes.Element) { fun parseTQoo(tq_tr : org.jsoup.nodes.Element) {
// BLog.LOGE("tq_tr >>>> ${tq_tr}") Blog.LOGE("tq_tr >>>> ${tq_tr}")
var desc = tq_tr.getElementsByClass("cate").getT() var desc = tq_tr.getElementsByClass("cate").getT()
var title = tq_tr.getElementsByClass("title").getT() var title = tq_tr.getElementsByClass("title").getT()
var pageLink = tq_tr.getElementsByTag("a").getHref() var pageLink = tq_tr.getElementsByTag("a").getHref()
@ -53,17 +54,18 @@ class TheQooGetter(context: Context) : BaseGetter(context) {
override fun realWork(): List<RealmObject> { override fun realWork(): List<RealmObject> {
RssDataType.THEQOO.isOn { RssDataType.THEQOO.isOn {
try { try {
val testUrl2 = arrayListOf("https://theqoo.net/hot","https://theqoo.net/hot/category/512000937","https://theqoo.net/hot/category/24784","https://theqoo.net/hot/category/24788") // val testUrl2 = arrayListOf("https://theqoo.net/hot")
testUrl2.forEach { url -> // testUrl2.forEach { url ->
Jsoup.connect(url) // Jsoup.connect(url)
.userAgent(USAGT) // .userAgent(USAGT)
.get().let { ruli -> // .get().let { ruli ->
// BLog.LOGE("test ${testUrl2} >> ${ruli.title()}") // Blog.LOGE("THEQOO url ${url} >> ${ruli.title()} ${ruli.getElementsByTag("tr").text()}")
ruli.getElementsByTag("tr").forEach { ruli_tr -> //
parseTQoo(ruli_tr) // ruli.getElementsByTag("tr").forEach { ruli_tr ->
} // parseTQoo(ruli_tr)
} // }
} // }
// }
} catch (e:Exception){e.printStackTrace()}} } catch (e:Exception){e.printStackTrace()}}
return temp return temp
} }

View File

@ -54,12 +54,7 @@
android:text="newsfeed" android:text="newsfeed"
style="@style/tableItem" style="@style/tableItem"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/arca"
android:text="arca"
style="@style/tableItem"
android:layout_height="wrap_content"
/>
</TableRow> </TableRow>
<TableRow android:id="@+id/normal_02" android:weightSum="3"> <TableRow android:id="@+id/normal_02" android:weightSum="3">