Compare commits
1 Commits
8172d4c769
...
v0.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ee8fb23d9 |
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -274,22 +274,6 @@ dependencies = [
|
||||
"syn 2.0.104",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dancing-bot-teachers"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"futures",
|
||||
"mwbot",
|
||||
"rand 0.9.2",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"thiserror 2.0.12",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.14.4"
|
||||
@@ -2462,6 +2446,22 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "teachertracker-rs"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"futures",
|
||||
"mwbot",
|
||||
"rand 0.9.2",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"thiserror 2.0.12",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.20.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "dancing-bot-teachers"
|
||||
name = "teachertracker-rs"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
authors = ["Lukas Wölfer <coding@thasky.one>"]
|
||||
|
||||
@@ -41,12 +41,17 @@ fn list_teacher_pages(bot: &Bot) -> tokio::sync::mpsc::Receiver<Result<mwbot::Pa
|
||||
pages.generate(bot)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn app_signature() -> String {
|
||||
format!("{} [{}]", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tracing_subscriber::fmt()
|
||||
.with_level(true)
|
||||
.with_max_level(tracing::Level::INFO)
|
||||
.init();
|
||||
|
||||
tracing::info!("Starting {}", app_signature());
|
||||
let rt = match tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
|
||||
@@ -12,7 +12,7 @@ pub async fn update_wsdc(bot: Bot) -> ! {
|
||||
tracing::info!("We have to update {} pages", l.len());
|
||||
let wait_duration = Duration::from_secs(6 * 3600);
|
||||
for (index, page) in l {
|
||||
tracing::info!("Next up: {index}");
|
||||
tracing::info!("Next up: #{index}");
|
||||
tokio::time::sleep(wait_duration).await;
|
||||
if generate_page(index, page).await {
|
||||
tracing::info!("Updated {index}");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::app_signature;
|
||||
use crate::{wikiinfo::wanted_ids, wikipage::page_from_info, worldsdc::fetch_wsdc_info};
|
||||
use mwbot::Bot;
|
||||
use mwbot::SaveOptions;
|
||||
@@ -50,7 +51,10 @@ pub async fn generate_page(id: u32, page: mwbot::Page) -> bool {
|
||||
match page
|
||||
.save(
|
||||
code,
|
||||
&SaveOptions::summary("Created WSDC info from worldsdc.com")
|
||||
&SaveOptions::summary(&format!(
|
||||
"Created WSDC info from worldsdc.com -- {}",
|
||||
app_signature()
|
||||
))
|
||||
.mark_as_bot(true)
|
||||
.mark_as_minor(false),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user