Llw2lw: Difference between revisions
Elena & Fabrice's Web
Fabrice (talk | contribs)
m 1 revision imported
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= llw2lw =
= llw2lw =


'''''llw2lw''''' (local-laussywiki to laussywiki) is a [[python]] [[script]] to export to our online [[laussy.org]] [[mediawiki]] [[web]], changes made on our local copy.
'''''llw2lw''''' (local-laussywiki to laussywiki) is a [[python]] [[script]] to export to our online [[laussy.org]] [[mediawiki]] [[web]], changes made on my local copy.
 
A log is kept in <tt>~/comp/lw/llw2lw-log.txt</tt>.


== Versions ==
== Versions ==
Line 7: Line 9:
* [[:File:llw2lw.gz|v°1.4.19]] ({{thisday|20|July|2025}}) — first version (with [[Grok]]3).
* [[:File:llw2lw.gz|v°1.4.19]] ({{thisday|20|July|2025}}) — first version (with [[Grok]]3).
* v°1.5.0 ({{thisday|16|August|2025}}) — exclude the file namespace (6) as files are uploaded separately and the inclusion of their metadata in the xml causes problems.
* v°1.5.0 ({{thisday|16|August|2025}}) — exclude the file namespace (6) as files are uploaded separately and the inclusion of their metadata in the xml causes problems.
* v°1.6.0 ({{thisday|5|September|2025}}) — store the time of last update as well as the date!


== Todo ==
== Todo ==


* Blogs should be treated specially as not all pages get exported (for unknown reasons).
* Blogs should be treated specially as not all pages get exported (for unknown reasons).
* The update should take into account the time of day too, in addition to the calendar date itself.
* <s>The update should take into account the time of day too, in addition to the calendar date itself.</s> 1.6.0.
* The date of page creation and modification should be fixed.
* The date of page creation and modification should be fixed.


== Usage ==
== Usage ==


# Run <tt>llw2lw --doit</tt> (run in dry-mode first, maybe).
# Use [[Special:Import]] with interwiki prefix <tt>llw</tt>, Assign edits ticked.
# Use [[Special:Import]] with interwiki prefix <tt>llw</tt>, Assign edits ticked.
# Upload files (if any)
# Upload files (if any)

Latest revision as of 01:17, 6 September 2025

llw2lw

llw2lw (local-laussywiki to laussywiki) is a python script to export to our online laussy.org mediawiki web, changes made on my local copy.

A log is kept in ~/comp/lw/llw2lw-log.txt.

Versions

  • v°1.4.19 (20 July (2025)) — first version (with Grok3).
  • v°1.5.0 (16 August (2025)) — exclude the file namespace (6) as files are uploaded separately and the inclusion of their metadata in the xml causes problems.
  • v°1.6.0 (5 September (2025)) — store the time of last update as well as the date!

Todo

  • Blogs should be treated specially as not all pages get exported (for unknown reasons).
  • The update should take into account the time of day too, in addition to the calendar date itself. 1.6.0.
  • The date of page creation and modification should be fixed.

Usage

  1. Run llw2lw --doit (run in dry-mode first, maybe).
  2. Use Special:Import with interwiki prefix llw, Assign edits ticked.
  3. Upload files (if any)
laussy@azag:~$ ./llw2lw --help
Usage: ./llw2lw.py [--doit] [--verbose] [--no-export=<title1>,<title2>,...] [--help]
Export recent changes from a local MediaWiki to an XML file and download associated files.

Options:
  --doit                Write XML file, download files to FilesToUpload/, and update log file.
  --verbose             Enable debug output to console and llw2lw-debug.log.
  --no-export=<titles>  Comma-separated list of page/file titles to exclude 
                        (e.g., Test4,Template:Test,File:Screenshot_20250717_222636.png).
                        Note: Spaces and underscores in titles are interchangeable.
  --help                Show this help message and exit.

The script prompts for a start date (YYYY-MM-DD). Defaults to the LAST UPDATE date
from ~/comp/lw/llw2lw-log.txt, or yesterday if the log file is missing.