Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions dbreps2/src/enwiki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
mod boteditcount;
mod brokenwikiprojtemps;
mod editcount;
mod emptycats;
mod featuredbysize;
mod goodarticlesbysize;
mod newprojects;
Expand All @@ -27,32 +26,22 @@ mod potenshbdps4;
mod potenshblps2;
mod projectchanges;
mod stickyprodblps;
mod templatesnonfree;
mod unbelievablelifespans;
mod uncatunrefblps;
mod unsourcedblps;
mod untaggedblps;
mod untaggedstubs;
mod untaggedunrefblps;
mod unusednonfree;
mod unusedtemplates;
mod unusedtemplatesfiltered;
mod usercats;
mod webhostpages;

pub use {
boteditcount::BotEditCount, brokenwikiprojtemps::BrokenWikiProjTemps,
editcount::EditCount, emptycats::EmptyCats, featuredbysize::FeaturedBySize,
editcount::EditCount, featuredbysize::FeaturedBySize,
goodarticlesbysize::GoodArticlesBySize, newprojects::NewProjects,
orphanedafds::OrphanedAfds, orphanedsubtalks::OrphanedSubTalks,
potenshbdps4::Potenshbdps4, potenshblps2::Potenshblps2,
projectchanges::ProjectChanges, stickyprodblps::StickyProdBLPs,
templatesnonfree::TemplatesNonFree,
unbelievablelifespans::UnbelievableLifeSpans,
uncatunrefblps::UncatUnrefBLPs, unsourcedblps::UnsourcedBLPs,
untaggedblps::UntaggedBLPs, untaggedstubs::UntaggedStubs,
untaggedunrefblps::UntaggedUnrefBLPs, unusednonfree::UnusedNonFree,
unusedtemplates::UnusedTemplates,
untaggedunrefblps::UntaggedUnrefBLPs, unusedtemplates::UnusedTemplates,
unusedtemplatesfiltered::UnusedTemplatesFiltered, usercats::UserCats,
webhostpages::WebhostPages,
};
120 changes: 0 additions & 120 deletions dbreps2/src/enwiki/emptycats.rs

This file was deleted.

9 changes: 6 additions & 3 deletions dbreps2/src/enwiki/potenshbdps4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use mysql_async::Conn;

pub struct Row {
page_title: String,
cl_to: String,
lt_title: String,
}

pub struct Potenshbdps4 {}
Expand Down Expand Up @@ -78,7 +78,10 @@ WHERE
.exec_map(
self.query(),
(format!("{year}_births"),),
|(page_title, cl_to)| Row { page_title, cl_to },
|(page_title, lt_title)| Row {
page_title,
lt_title,
},
)
.await?;
//dbg!((year, year_rows.len()));
Expand All @@ -96,7 +99,7 @@ WHERE
}

fn format_row(&self, row: &Row) -> Vec<String> {
str_vec![format!("[[{}]]", row.page_title), linker(14, &row.cl_to)]
str_vec![format!("[[{}]]", row.page_title), linker(14, &row.lt_title)]
}

fn code(&self) -> &'static str {
Expand Down
92 changes: 0 additions & 92 deletions dbreps2/src/enwiki/templatesnonfree.rs

This file was deleted.

14 changes: 10 additions & 4 deletions dbreps2/src/enwiki/unbelievablelifespans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,22 @@ FROM
SELECT
page_namespace,
page_title AS page_title,
CAST(SUBSTRING_INDEX(cl3.cl_to, '_', 1) AS UNSIGNED) AS deathyear
CAST(SUBSTRING_INDEX(lt3.lt_title, '_', 1) AS UNSIGNED) AS deathyear
FROM
categorylinks AS cl1
JOIN linktarget AS lt1 ON cl1.cl_target_id = lt1.lt_id
LEFT JOIN categorylinks AS cl2 ON cl1.cl_from = cl2.cl_from
AND cl2.cl_to IN ('Longevity_traditions', 'Longevity_claims')
LEFT JOIN linktarget AS lt2 ON cl2.cl_target_id = lt2.lt_id
AND lt2.lt_namespace = 14
AND lt2.lt_title IN ('Longevity_traditions', 'Longevity_claims')
JOIN categorylinks AS cl3 ON cl1.cl_from = cl3.cl_from
AND cl3.cl_to REGEXP '^[0-9]+_deaths$'
JOIN linktarget AS lt3 ON cl3.cl_target_id = lt3.lt_id
AND lt3.lt_namespace = 14
AND lt3.lt_title REGEXP '^[0-9]+_deaths$'
JOIN page ON page_id = cl1.cl_from
WHERE
cl1.cl_to = CONCAT(?, '_births')
lt1.lt_namespace = 14
AND lt1.lt_title = CONCAT(?, '_births')
AND cl2.cl_from IS NULL
) AS BornAndDeads
WHERE
Expand Down
Loading