NewToki: fix domain number logic and update data (#13893)
This commit is contained in:
parent
01beb2d8d4
commit
85dd5326e7
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'NewToki / ManaToki'
|
||||
pkgNameSuffix = 'ko.newtoki'
|
||||
extClass = '.TokiFactory'
|
||||
extVersionCode = 25
|
||||
extVersionCode = 26
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -1,56 +1,48 @@
|
|||
1. Visit https://t.me/s/newtoki3 and load all messages.
|
||||
Data from either https://t.me/s/newtoki5 or https://web.archive.org.
|
||||
|
||||
2. Run
|
||||
```js
|
||||
$$(".tgme_widget_message_service_date").map(e => e.innerText)
|
||||
```
|
||||
|
||||
3. Paste the dates into a spreadsheet.
|
||||
|
||||
4. Remove duplicates.
|
||||
|
||||
The number is changed to 154 on 2022-09-21.
|
||||
|
||||
| Date | Days | Average |
|
||||
| ---------: | ---: | ------: |
|
||||
| 2022-09-21 | 12 | 12.0 |
|
||||
| 2022-09-09 | 7 | 9.5 |
|
||||
| 2022-09-02 | 8 | 9.0 |
|
||||
| 2022-08-25 | 6 | 8.3 |
|
||||
| 2022-08-19 | 11 | 8.8 |
|
||||
| 2022-08-08 | 10 | 9.0 |
|
||||
| 2022-07-29 | 8 | 8.9 |
|
||||
| 2022-07-21 | 9 | 8.9 |
|
||||
| 2022-07-12 | 7 | 8.7 |
|
||||
| 2022-07-05 | 11 | 8.9 |
|
||||
| 2022-06-24 | 6 | 8.6 |
|
||||
| 2022-06-18 | 8 | 8.6 |
|
||||
| 2022-06-10 | 3 | 8.2 |
|
||||
| 2022-06-07 | 11 | 8.4 |
|
||||
| 2022-05-27 | 6 | 8.2 |
|
||||
| 2022-05-21 | 11 | 8.4 |
|
||||
| 2022-05-10 | 11 | 8.5 |
|
||||
| 2022-04-29 | 6 | 8.4 |
|
||||
| 2022-04-23 | 8 | 8.4 |
|
||||
| 2022-04-15 | 6 | 8.3 |
|
||||
| 2022-04-09 | 10 | 8.3 |
|
||||
| 2022-03-30 | 11 | 8.5 |
|
||||
| 2022-03-19 | 9 | 8.5 |
|
||||
| 2022-03-10 | 14 | 8.7 |
|
||||
| 2022-02-24 | 12 | 8.8 |
|
||||
| 2022-02-12 | 15 | 9.1 |
|
||||
| 2022-01-28 | 9 | 9.1 |
|
||||
| 2022-01-19 | 9 | 9.1 |
|
||||
| 2022-01-10 | 17 | 9.3 |
|
||||
| 2021-12-24 | 7 | 9.3 |
|
||||
| 2021-12-17 | 6 | 9.2 |
|
||||
| 2021-12-11 | 8 | 9.1 |
|
||||
| 2021-12-03 | 9 | 9.1 |
|
||||
| 2021-11-24 | 8 | 9.1 |
|
||||
| 2021-11-16 | 11 | 9.1 |
|
||||
| 2021-11-05 | 7 | 9.1 |
|
||||
| 2021-10-29 | 9 | 9.1 |
|
||||
| 2021-10-20 | 12 | 9.2 |
|
||||
| 2021-10-08 | 8 | 9.1 |
|
||||
| 2021-09-30 | 15 | 9.3 |
|
||||
| 2021-09-15 | | |
|
||||
| Date | Days | Average | Number |
|
||||
| ---------: | ---: | ------: | -----: |
|
||||
| 2022-10-16 | 8 | 8.0 | 158 |
|
||||
| 2022-10-08 | 11 | 9.5 | 157 |
|
||||
| 2022-09-27 | 6 | 8.3 | 156 |
|
||||
| 2022-09-21 | 12 | 9.3 | 154 |
|
||||
| 2022-09-09 | 7 | 8.8 | |
|
||||
| 2022-09-02 | 8 | 8.7 | |
|
||||
| 2022-08-25 | 6 | 8.3 | |
|
||||
| 2022-08-19 | 11 | 8.6 | |
|
||||
| 2022-08-08 | 10 | 8.8 | |
|
||||
| 2022-07-29 | 8 | 8.7 | |
|
||||
| 2022-07-21 | 9 | 8.7 | |
|
||||
| 2022-07-12 | 7 | 8.6 | |
|
||||
| 2022-07-05 | 11 | 8.8 | |
|
||||
| 2022-06-24 | 6 | 8.6 | |
|
||||
| 2022-06-18 | 8 | 8.5 | |
|
||||
| 2022-06-10 | 3 | 8.2 | |
|
||||
| 2022-06-07 | 11 | 8.4 | |
|
||||
| 2022-05-27 | 6 | 8.2 | |
|
||||
| 2022-05-21 | 11 | 8.4 | |
|
||||
| 2022-05-10 | 11 | 8.5 | |
|
||||
| 2022-04-29 | 6 | 8.4 | |
|
||||
| 2022-04-23 | 8 | 8.4 | |
|
||||
| 2022-04-15 | 6 | 8.3 | |
|
||||
| 2022-04-09 | 10 | 8.3 | |
|
||||
| 2022-03-30 | 11 | 8.4 | |
|
||||
| 2022-03-19 | 9 | 8.5 | |
|
||||
| 2022-03-10 | 14 | 8.7 | |
|
||||
| 2022-02-24 | 12 | 8.8 | |
|
||||
| 2022-02-12 | 15 | 9.0 | |
|
||||
| 2022-01-28 | 9 | 9.0 | |
|
||||
| 2022-01-19 | 9 | 9.0 | |
|
||||
| 2022-01-10 | 17 | 9.3 | |
|
||||
| 2021-12-24 | 7 | 9.2 | |
|
||||
| 2021-12-17 | 6 | 9.1 | |
|
||||
| 2021-12-11 | 8 | 9.1 | |
|
||||
| 2021-12-03 | 9 | 9.1 | |
|
||||
| 2021-11-24 | 8 | 9.0 | |
|
||||
| 2021-11-16 | 11 | 9.1 | |
|
||||
| 2021-11-05 | 7 | 9.0 | |
|
||||
| 2021-10-29 | 9 | 9.0 | |
|
||||
| 2021-10-20 | 12 | 9.1 | |
|
||||
| 2021-10-08 | 8 | 9.1 | |
|
||||
| 2021-09-30 | 15 | 9.2 | |
|
||||
| 2021-09-15 | | | |
|
|
@ -15,12 +15,12 @@ import java.io.IOException
|
|||
* It was merged after shutdown of ManaMoa.
|
||||
* This is by the head of Manamoa, as they decided to move to Newtoki.
|
||||
*
|
||||
* Updated on 2022-09-21, see `domain_log.md`.
|
||||
* Updated on 2022-10-16, see `domain_log.md`.
|
||||
* To avoid going too fast and to utilize redirections,
|
||||
* the number is decremented by 1 initially,
|
||||
* and increments every 9.2 days which is a bit slower than the average.
|
||||
* and increments every 9 days which is a bit slower than the average.
|
||||
*/
|
||||
val fallbackDomainNumber get() = (154 - 1) + ((System.currentTimeMillis() - 1663723150_000) / 794880_000).toInt()
|
||||
val fallbackDomainNumber get() = (158 - 1) + ((System.currentTimeMillis() - 1665882000_000) / 777600_000).toInt()
|
||||
|
||||
var domainNumber = ""
|
||||
get() {
|
||||
|
@ -52,13 +52,16 @@ object DomainInterceptor : Interceptor {
|
|||
chain.proceed(request)
|
||||
} catch (e: IOException) {
|
||||
if (chain.call().isCanceled()) throw e
|
||||
Log.e("NewToki", "failed to fetch ${request.url}", e)
|
||||
|
||||
val newDomainNumber = try {
|
||||
val document = chain.proceed(GET("https://t.me/s/newtoki3")).asJsoup()
|
||||
val description = document.selectFirst("meta[property=og:description]").attr("content")
|
||||
val document = chain.proceed(GET("https://t.me/s/newtoki5")).asJsoup()
|
||||
val description = document.select("a[href^=https://newtoki]").last()!!.attr("href")
|
||||
numberRegex.find(description)!!.value
|
||||
} catch (_: Throwable) {
|
||||
fallbackDomainNumber.toString()
|
||||
fallbackDomainNumber
|
||||
.also { if (it <= domainNumber.toInt()) throw e }
|
||||
.toString()
|
||||
}
|
||||
domainNumber = newDomainNumber
|
||||
|
||||
|
|
Loading…
Reference in New Issue