User:Jeffq/Transwiki automation

From Wikiquote
Jump to: navigation, search

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:

  1. Accurate edit history timestamps.
  2. 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).
  3. 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:

  1. An article may exist already on the destination project.
  2. 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:

  1. Create a copy of the original article in the Transwiki: namespace of the destination project.
  2. 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.
  3. 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.
  4. 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]

  1. Set up process.
    1. If username provide and not logged in, log in user. Fail if login fails.
    2. Open session on destination project. Fail if can't login or if session unavailable.
    3. Calculate project prefixes for link conversions: origin→destination (NEW:) and destination→origin (OLD:).
      Example: en:Wikiquote→Wikisource: "wikisource:"; Wikisource→en:Wikiquote: "q:en:".
    4. Save user's current timezone offset on each project (if necessary) and set each to offset=0 (UTC).
  2. Copy article.
    1. Fetch [[ORIG:Article name]].
    2. Create [[DEST:Transwiki:New article name]].
  3. Copy history.
    1. Fetch &action=history&offset=0&limit=50000 of [[ORIG:Article name]].
    2. In the history text, append " (UTC)" to all timestamps, and add project-specific links to all usernames/IPs.
    3. Edit &action=edit&section=new for [[DEST:Transwiki talk:New article name]].
    4. Paste formatted history with &Subject/headline=Transwikied article edit history and save.
  4. Copy original discussion page.
    1. Fetch [[ORIG:Talk:Article name]].
    2. In the discussion page text, add project-specific links to all usernames and IPs. BONUS: Convert all links to project-specific links.
    3. Edit &action=edit&section=new for [[DEST:Transwiki talk:New article name]].
    4. Paste formatted discussion page with &Subject/headline=Transwikied article discussion page and save.
  5. Log transwiki on origin and destination projects.
    1. Create basic log entry in format:
      [[Article name]] → [[Transwiki:New article name]]
    2. For origin log entry, add destination prefix (NEW:) to 2nd log field and append "— [[User:Origin username or IP|]] timestamp".
    3. Edit [[ORIG:Transwiki#Outgoing]] and append origin log entry to it.
    4. For destination log entry, add destination prefix (OLD:) to 1st log field and append "— [[User:Destination username or IP|]] timestamp".
    5. Edit [[DEST:Transwiki#Incoming]] and append origin log entry to it.
  6. OPTIONAL: Submit transwikied article for speedy deletion on originating project.
    1. Wikiquote: Add {{db|article transwikied to DEST:}} tag to [[ORIG:Article name]].
  7. Clean up process.
    1. Restore user timezone preferences on each project.