User:Enterprisey/Pastebin
This is for text I use frequently incredibly rarely.
scots
sco-1
- Colin Angus Mackay (talk · contribs) 2020-06-28
- Hamid Hassani (talk · contribs) 2020-08-25
- Joliv (talk · contribs) 2020-08-03
sco-2
sco-3
sco-4
sco-N
The code used to generate this
|
|---|
use std::{collections::HashMap, thread};
use chrono::{prelude::*, Duration};
use mediawiki::api_sync::ApiSync};
static ISO_8601_FMT: &str = "%Y-%m-%dT%H:%M:%SZ";
fn make_map(params: &[(&str, &str)]) -> HashMap<String, String> {
params.iter().map(|(k, v)| (k.to_string(), v.to_string())).collect()
}
fn main() {
let time_90_days_ago = Utc::now() - Duration::days(90);
let time_str = time_90_days_ago.format(ISO_8601_FMT).to_string();
for level in &["1", "2", "3", "4", "N"] {
println!("== sco-{} ==", level);
let category = format!("Category:User sco-{}", level);
let users_query = make_map(&[
("action", "query"),
("list", "categorymembers"),
("cmtitle", &category),
("cmprop", "title"),
("cmnamespace", "2"), // user
]);
let mut api = ApiSync::new("https://en.wikipedia.org/w/api.php").unwrap();
api.set_user_agent("QueryActiveUsers/0.1 (https://en.wikipedia.org/wiki/User:Enterprisey) mediawiki_rs/0.2.0");
let users = api.get_query_api_json_limit_iter(&users_query, None)
.map(|user| user.unwrap())
.filter_map(|user| user["query"]["categorymembers"][0]["title"].as_str().map(ToString::to_string));
for user in users {
let user = user.split_terminator('/').next().unwrap();
let contribs_query = make_map(&[
("action", "query"),
("list", "usercontribs"),
("ucuser", &user),
("uclimit", "1"),
("ucprop", "timestamp"),
("ucend", &time_str),
]);
let contribs = api.get_query_api_json_all(&contribs_query).unwrap();
let contribs = contribs["query"]["usercontribs"].as_array().unwrap();
if let Some(t) = contribs.get(0) {
println!("* {{{{user|{}}}}} {}", user, t["timestamp"].as_str().unwrap().split_terminator('T').next().unwrap());
}
thread::sleep(std::time::Duration::from_millis(500));
}
}
} |
Template for Template:Infobox MTR station replacement
{{Infobox station
|name=
|native_name=
|native_name_lang=zh
|symbol_location=hk
|symbol=wrl
|type=[[Hong Kong]] [[MTR]] rapid transit station
|image=
|caption=
|address=
|borough=
|coordinates_display=inline,title
|latitude=
|longitude=
|line={{HK-MTR box|West Rail}}
|platforms=
|tracks=
|structure=
|code=
|opened={{Start date|YYYY|MM|DD|df=y}}
|services={{s-rail|title=HK-MTR}}
|map_type=Hong Kong MTR
}}AfC "significant coverage" comment
Please note that for [[WP:N|notability]] to be established, your topic must have received [[WP:GNG|significant coverage]] ([https://en.wikipedia.org/wiki/Wikipedia:Notability#cite_note-1 for example]) in [[WP:RS|reliable sources]]. Feel free to re-submit once you've added some sources that do this.
What "Input link" is commonly used for
{{edit|Special:MyTalk|'''ask for help on your talk page'''|section=new|preload=Help:Contents/helpmepreload|preloadtitle=Help me!}}
How to make a user script into an auto-gadget-installer
if ( mw.user.options.get('gadget-prosesize') === null ) new mw.Api().saveOption('gadget-prosesize', '1');
(from Special:Diff/926105964)
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.