Jump to content

User:Chlod/Tools

From Wikipedia, the free encyclopedia

I make tools that are primarily for Wikipedia, and I've released majority of them as open-source. This page details the tools I've made and how to use them.

Tool Status Description Code Operation
Chlod's Wikipedia Tools     Active Used to host all tools on this page. See infobox Persistent
PAGASA Parser     Active Parses information from PAGASA's Tropical Cyclone Bulletin (TCB) page and turns it into various formats. See infobox Persistent
JTWC Archiver     Active Parses information from the Joint Typhoon Warning Center's RSS feed and archives whichever version is available. See infobox Persistent (products)
Every 10 minutes (archiving)
Stroke Order Resolver     Active Takes a Kanji, Hiragana, or Katakana character, and returns the stroke order for that character. See infobox Persistent
Article Randomizer     Active Gets a random good article or featured article and displays it to the user. See infobox Persistent

Chlod's Wikipedia Tools

[edit]
Chlod's Wikipedia Tools
Original author(s)Chlod Alejandro
Developer(s)Chlod Alejandro
Initial releaseJanuary 6, 2020; 4 years ago (2020-01-06)
Written inJavaScript, HTML
EngineModular Express Server using Node.js
Apache HTTP Server (for static files)
TypeStatic file server, Application programming interface
License
Websitehttps://wiki.chlod.net

wiki.chlod.net or Chlod's Wikipedia Tools (CWT) is the website where I host my rapid-testing userscript, and the tools I use for Wikipedia. Although it uses mostly open-source components, I see no use in exposing the modules I use to operate the web server. Thus, I keep the modules and managers of the server closed-source. However, if you would like a copy, feel free to send me an email or a message on my talk page.

CWT uses the Modular Express Server, a rapid-deployment Express server template I use to quickly make services available on the internet. The web server itself is open-source, and is available on GitHub. All userscripts found under /userscripts, namely my testing userscript, are also open-source. Getting the source is tedious, however, since I don't host the userscripts on GitHub. You will have to download them manually using cURL or wget.

History

[edit]

CWT was initially hosted on my Apache HTTP Server, and only fed the main page and the test userscript. On 14 May 2020, I created and released the Modular Express Server, and transferred all the files onto the new Node-based server. This allowed me to execute JavaScript files as well, which meant I can use libraries I built for Wikipedia, and pipe them through specific endpoints.

Why not Toolforge

[edit]

Some of these are out of scope. Those are self-hosted instead.

Feedback

[edit]

If you found a security issue, please inform me through Special:Email, or by sending an email to wiki@chlod.net. I'll reply as soon as I can.

If you have any questions regarding the site, feel free to use my User talk:Chlod talk page. I'm open to suggestions and comments about my projects and tools. Please don't write hosting requests, though, since I only host projects I'm a part of or projects that I started.

PAGASA Parser

[edit]
PAGASA Parser
Original author(s)Chlod Alejandro
Developer(s)Contributors to the PAGASA Parser project
Initial releaseMay 15, 2020; 4 years ago (2020-05-15)
Stable release
2.0.10 / January 23, 2022; 2 years ago (2022-01-23)
Repositoryhttps://github.com/pagasa-parser/pagasa-parser
Written inTypeScript
EngineNode.js
TypeData transformer
LicenseApache License 2.0
Websitehttps://pagasa.chlod.net
PAGASA Parser Web
Original author(s)Chlod Alejandro
Developer(s)Contributors to the PAGASA Parser Web project
Initial releaseDecember 17, 2021; 2 years ago (2021-12-17)
Stable release
1.1.4 / January 26, 2022; 2 years ago (2022-01-26)
Repositoryhttps://github.com/pagasa-parser/pagasa-parser-web
Written inTypeScript
EngineNode.js, React
TypeWeb application, Web scraper, Data transformer
LicenseGNU AGPL v3.0
Websitehttps://pagasa.chlod.net/app

The PAGASA Parser is a Node.js library that parses information from PAGASA's Tropical Cyclone Bulletin (TCB) page and turns it into various formats. Although its primary purpose is to convert the TCB into a JavaScript object, there is also an option to generate a TyphoonWarningsTable for the 2024 Pacific typhoon season page.

A web version of the library can be found at https://pagasa.chlod.net/app. After selecting, downloading, and parsing a bulletin, switch to the "Wikipedia (Template:TyphoonWarningsTable)" format and click the "Format" button. You can easily copy the output by pressing the clipboard icon on the right side.

JTWC Archiver

[edit]
JTWC Archiver
Original author(s)Chlod Alejandro
Developer(s)Contributors to the JTWC Archiver
Initial releaseSeptember 28, 2020; 4 years ago (2020-09-28)
Stable release
1.1.0 / October 6, 2020; 4 years ago (2020-10-06)
Repositoryhttps://github.com/ChlodAlejandro/jtwc-archiver
Written inJavaScript
EngineNode.js
TypeWeb scraper
License
Websitehttps://wiki.chlod.net/jtwc

The JTWC Archiver is a Node.js script that parses information from the Joint Typhoon Warning Center's RSS feed and archives whichever version is available. This way, warnings issued by the JTWC which are not immediately added to an article may still be used. The script is run once every 10 minutes and archives each new product.

Since all of these files are pretty much analogous to the actual JTWC warnings (since they are archives straight from the source), you can use them as a basis for citation.

Usage

[edit]

You can browse the Tropical Cyclone Formation Alert and Tropical Cyclone Warning texts and images at https://wiki.chlod.net/jtwc.

To cite a JTWC warning, use the following:

Tropical Storm 15W (Kujira) Warning No. 10 (Report). United States Joint Typhoon Warning Center. 29 September 2020. Archived from the original on 29 September 2020. Retrieved 29 September 2020.
{{Cite web|last=|first=|date={{subst:date}}|title=Tropical Storm 15W (Kujira) Warning No. 10|url=https://www.metoc.navy.mil/jtwc/products/wp1520web.txt|url-status=dead|archive-url=https://wiki.chlod.net/jtwc/text/2020-09-29-0200-wp1520web.txt|archive-date={{subst:date}}|access-date={{subst:date}}|publisher=United States Joint Typhoon Warning Center}}

You may choose to drop the publisher entirely, like I do.

"Tropical Storm 15W (Kujira) Warning No. 10". United States Joint Typhoon Warning Center. 29 September 2020. Archived from the original on 29 September 2020. Retrieved 29 September 2020.
{{Cite web|last=|first=|date={{subst:date}}|title=Tropical Storm 15W (Kujira) Warning No. 10|url=https://www.metoc.navy.mil/jtwc/products/wp1520web.txt|url-status=dead|archive-url=https://wiki.chlod.net/jtwc/text/2020-09-29-0200-wp1520web.txt|archive-date={{subst:date}}|access-date={{subst:date}}|publisher=United States Joint Typhoon Warning Center}}

At the end of each year, most of the links are replaced with more resilient backups. Information for that can be found below.

Output

[edit]

In this tree, the JTWC Archiver is run with the hypothetical wp4220 system, and was archived on September 28, 2020 at 00:00 UTC.

  • Working directory
    • jtwc.rss — The latest copy of the JTWC RSS. This is used to check if there were any updates to the JTWC bulletin.
    • jtwc_products — The folder containing all archived JTWC products.
      • gif — The folder containing graphics for TCFAs and TCWs.
        • 2020-09-28-0000-wp4220.gif — The TCFA/TCW graphic for wp4220 exactly at the moment of archiving.
        • latest-wp4220.gif — The latest TCFA/TCW graphic for wp4220. This file is overwritten when a new graphic is issued.
      • jmv — The folder containing JMV 3.0 data.
        • 2020-09-28-0000-wp4220.tcw — JMV 3.0 data for wp4220 exactly at the moment of archiving.
        • latest-wp4220.tcw — The latest JMV 3.0 data for wp4220. This file is overwritten when new data is available.
      • prog — The folder containing tropical cyclone prognostic reasonings.
        • 2020-09-28-0000-wp4220prog.txt — The prognostic reasoning for wp4220 exactly at the moment of archiving.
        • latest-wp4220prog.txt — The latest prognostic reasoning for wp4220. This file is overwritten when a new version is issued.
      • text — The folder containing the TCFA and TCW warnings.
        • 2020-09-28-0000-abioweb.txt — The advisories for the ABIO sector (the Indian Ocean). Since this text file is always provided when a system in that sector is active, it will be archived as well.
        • 2020-09-28-0000-abpwweb.txt — The advisories for the ABPW sector (the Pacific Ocean). Since this text file is always provided when a system in that sector is active, it will be archived as well.
        • 2020-09-28-0000-wp4220web.txt — The TCFA/TCW text for wp4220 exactly at the moment of archiving.
        • latest-abioweb.txt — The latest ABIO advisory. This file is overwritten when a new advisory is issued.
        • latest-abpwweb.txt — The latest ABPW advisory. This file is overwritten when a new advisory is issued.
        • latest-wp4220.txt — The latest TCFA/TCW text for wp4220. This file is overwritten when a new warning is issued.

url-status

[edit]

The url-status parameter in {{Cite web}} should always be either dead (which emphasizes the archived version over the original) or unfit (which hides the original entirely). This is because the links that lead to a specific warning are time-sensitive and will change, and that the archived version is preferred over the live version (which may already be a new system entirely.)

Periodic archiving

[edit]

At the end of each year, all collected products will be uploaded to the Internet Archive for permanent storage. This is primarily due to three reasons:

  1. The Internet Archive is a more generally-known (and thus, generally-trusted) website, which helps alleviate some concerns regarding SELFPUB or privacy-related concerns (even though the archiver website is just an Apache directory browser).
  2. Though the total file sizes for a year of operation are not significant, there might be a time where I am forced to clear out space from the server. If that happens, those files would then be permanently Not Found, and may not be accessible anymore.
  3. The JTWC Archiver, despite being an archive, was initially designed to be a temporary gathering place for bulletins while parts of an article have not yet been written. Since bulletins are changed rapidly, while articles may not be, there are instances where an old version is no longer available due to it being overwritten. Though I can theoretically hold all bulletins up until, say 2030, I'd like to form a sense of assurance that the bulletins would be stored "forever" by a capable and established archiving service.

Though those bulletins will be archived, it does not mean that they will be removed from the website immediately. They're put on the Internet Archive for that exact reason: archiving. It's meant to be a backup in case things go south on my end.

A list of archives is provided below.

  • 2020 (ATNIPCWP) – Archived on January 12, 2021  – TXTGIFPROG
    Note: The archive project started on September 28, 2020, and thus, this year only has products beginning September 28, 2020.
  • 2021 (ATNIPCWP) – Archived on January 12, 2021  – TXTGIFPROGJMV
    Note: JMV 3.0 data archiving started on May 16, 2021, and thus, this year has JMV 3.0 data only for products beginning May 16, 2021.
  • 2022 (ATNIPCWP) – Archived on March 5, 2023  – TXTGIFPROGJMV
  • 2023 (ATNIPCWP) – Archived on September 2, 2024  – TXTGIFPROGJMV

Stroke Order Resolver

[edit]
Stroke Order Resolver
Original author(s)Chlod Alejandro
Developer(s)Contributors to the Stroke Order Resolver project
Initial releaseAugust 31, 2020; 4 years ago (2020-08-31)
Stable release
1.0.0 / August 31, 2020; 4 years ago (2020-08-31)
Repositoryhttps://github.com/ChlodAlejandro/wiki-kanji-stroke-order
Written inJavaScript
EngineNode.js
TypeWeb scraper
LicenseApache 2.0 License

The Stroke Order Resolver (SOR) is a Modular Express Server module that takes a Kanji, Hiragana, or Katakana character, and returns the stroke order for that character. It automatically falls back to the Kangxi radical stroke orders if it does not find a stroke order meant for Japanese characters.

The images are taken from the Wikimedia Commons Stroke Order Project.

Endpoints

[edit]
Format Endpoint Description
PNG (link for 「一」)

(link for 「前」)

URL 「一」: https://wiki.chlod.net/kanji/%E4%B8%80

URL 「前」: https://wiki.chlod.net/kanji/%E5%89%8D

Returns the stroke order for the given character.

For 「一」, which has both a Japanese version (File:一-jbw.png) and the other version (File:一-bw.png), the Japanese version will be shown.

Since 「前」 does not have a Japanese version (the file File:前-jbw.png does not exist), it will fallback to the other version (File:前-bw.png).

PNG (as parameter) (link for 「前」) URL: https://wiki.chlod.net/kanji/?character=%E5%89%8D

Returns the stroke order for the 前 character. This version takes the character from a URL parameter instead of the path.

GIF (link for 「前」) URL: https://wiki.chlod.net/kanji/%E5%89%8D?animated=1

Returns the stroke order for the 前 character (as a GIF).

To get the animated version, the parameter animated must be passed with the value of 1.

Error cases

[edit]

If the SOR experiences an issue, it will return the appropriate response code and an image describing the issue. For example, if a character was not provided, a 400 response code will be returned, along with a picture describing the issue. If a character did not have an available image, the 404 code is returned.

If a 500 error was returned, there was an internal error in attempting to retrieve the appropriate image. The error is logged on the server side, so if you ping me on my talk page, I'll be able to check out what went wrong.

Article Randomizer

[edit]
Article Randomizer
Original author(s)Chlod Alejandro
Developer(s)Contributors to the Article Randomizer project
Initial releaseApril 12, 2021; 3 years ago (2021-04-12)
Stable release
1.0.0 / April 12, 2020; 4 years ago (2020-04-12)
Repositoryhttps://github.com/ChlodAlejandro/enwiki-article-randomizer
Written inPHP
EngineApache HTTP Server, Zend Engine (PHP)
LicenseApache 2.0 License

The Article Randomizer (GAR or FAR) gets a random good article or featured article and displays it to the user. Due to CORS issues, randomization is done on the server side whereas article information is gathered on the client side. This project makes use of the Action API (through Special:RandomInCategory) and the REST API (through /page/<page>).

This attempts to mimic the randomizer found on the Wikipedia Android app.