Jump to content

User:Dam-io/wiki2git

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dam-io (talk | contribs) at 12:57, 4 March 2019 (First draft for a new wikipedia tool). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)


Converts a Wikipedia article revision history into a git repository

With a web interface

You can use the experimental service at http://wiki2git.dam.io

  1. Enter you Article URL into the input field, ex: https://en.wikipedia.org/wiki/The_Little_Prince
  2. Press "Convert to git"
  3. You now see the script executing but to see the script progress, you must refresh the page (Ctrl-R in most browsers)
    • the script should take less than 10 seconds for an article with less than 1000 revisions
  4. You get the link to a .tar.gz archive of the repository
  5. Extract the repository on your computer, go to the folder named like "XXXX-XXXX-XXXX-XXXX"
  6. You should be able to do git log and see all the revisions

As a local script

Installation

> git clone https://framagit.org/mdamien/wiki2git.git
> cd wiki2git
> virtualenv -p python3 env
> . ./env/bin/activate
> pip install -r requirements.txt

Usage

> ./wiki2git https://en.wikipedia.org/wiki/The_Little_Prince prince # output is in prince folder