User:Jeffq/Transwiki automation
Appearance
This process is designed to automate the initial transfer and logging of articles from one wiki project to another, based on the principles outlined in meta:Transwiki. Besides enforcing guidelines that are frequently ignored in practice, it adds three features practically never provided under the current transwiki process:
- Accurate edit history timestamps.
- Project-specific editor links (e.g., clicking on an editor in a transwiki page history will take you to that editor's user page for the originating project).
- The discussion page of the originating article, complete with reformatted links.
NOTE: Articles are copied into the Transwiki: namespace instead of directly into the main article space for two major reasons, based on Transwiki policy:
- An article may exist already on the destination project.
- The destination project should decide the ultimate fate of any incoming articles. They may not agree with the originating project's decision to move the article, or they may want to make significant changes before adding it to their article space.
The specific actions taken by this process are:
- Create a copy of the original article in the Transwiki: namespace of the destination project.
- Copy and format the edit history of the original article into the discussion page of the new article, including UTC timestamps and project-specific user links.
- Copy and format the discussion page of the original article into the discussion page of the new article, including UTC timestamps and project-specific user links.
- Log the transwiki copy in both projects, including UTC timestamps and project
Assumptions
[edit]- Transwiki logs are found at [[PROJECT:Transwiki]] (standard practice).
- Each transwiki log has a section for recording outgoing transwikis. (The heading is not assumed, but is required input.)
- Each transwiki log has a section for recording incoming transwikis. (The heading is not assumed, but is required input.)
- NOTE: A policy change for all projects to standardize on incoming/outgoing nomenclature, or at least register their headings or section numbers, would greatly simplify even this automated process for Transwiki editors.
- Transwiki log order (within a section) has the most recent entries appended to the end of the section (common practice; standard?).
- User will initiate process on the originating project.
- The following log entry format is acceptable to all participating projects:
- [[ORIG:Old article name]] → [[DEST:Transwiki:New article name]] — [[User:Local username or IP|]] timestamp
- NOTE: The project prefixes will be adjusted so that the links direct to what is expected, per Principle of least astonishment.
Information needed
[edit]- Originating project
- Article name
- Origin username or IP (may be calculated)
- User password (unnecessary if IP or if user already logged in)
- Timezone offset (unnecessary if IP)
- Heading of Transwiki log's outgoing section (default=Outgoing)
- Destination project
- New article name (default=Article name)
- Destination username or IP (default: same as originating project)
- User password (unnecessary if IP)
- Timezone offset (unnecessary if IP)
- Heading of Transwiki log's incoming section (default=Incoming)
Steps
[edit]- Set up process.
- If username provide and not logged in, log in user. Fail if login fails.
- Open session on destination project. Fail if can't login or if session unavailable.
- Calculate project prefixes for link conversions: origin→destination (NEW:) and destination→origin (OLD:).
- Example: en:Wikiquote→Wikisource: "wikisource:"; Wikisource→en:Wikiquote: "q:en:".
- Save user's current timezone offset on each project (if necessary) and set each to offset=0 (UTC).
- Copy article.
- Fetch [[ORIG:Article name]].
- Create [[DEST:Transwiki:New article name]].
- Copy history.
- Fetch &action=history&offset=0&limit=50000 of [[ORIG:Article name]].
- In the history text, append " (UTC)" to all timestamps, and add project-specific links to all usernames/IPs.
- Edit &action=edit§ion=new for [[DEST:Transwiki talk:New article name]].
- Paste formatted history with &Subject/headline=Transwikied article edit history and save.
- Copy original discussion page.
- Fetch [[ORIG:Talk:Article name]].
- In the discussion page text, add project-specific links to all usernames and IPs. BONUS: Convert all links to project-specific links.
- Edit &action=edit§ion=new for [[DEST:Transwiki talk:New article name]].
- Paste formatted discussion page with &Subject/headline=Transwikied article discussion page and save.
- Log transwiki on origin and destination projects.
- Create basic log entry in format:
- [[Article name]] → [[Transwiki:New article name]]
- For origin log entry, add destination prefix (NEW:) to 2nd log field and append "— [[User:Origin username or IP|]] timestamp".
- Edit [[ORIG:Transwiki#Outgoing]] and append origin log entry to it.
- For destination log entry, add destination prefix (OLD:) to 1st log field and append "— [[User:Destination username or IP|]] timestamp".
- Edit [[DEST:Transwiki#Incoming]] and append origin log entry to it.
- Create basic log entry in format:
- OPTIONAL: Submit transwikied article for speedy deletion on originating project.
- Wikiquote: Add {{db|article transwikied to DEST:}} tag to [[ORIG:Article name]].
- Clean up process.
- Restore user timezone preferences on each project.