wiki:wikitaxi:wikitaxi_import_script [2010/07/20 21:20] complexjunk cleaned up code per request |
wiki:wikitaxi:wikitaxi_import_script [2010/07/20 22:02] (current) complexjunk Added link to 7-Zip, fixed capitalization, other misc cleanup/fixes |
| | Some people routinely use WikiTaxi as an offline backup for their personal Wiki and need to convert their uncompressed MediaWiki XML dumps to a WikiTaxi *.taxi file on a regular basis. The following script provides a solution to simplify this process. | | Some people routinely use WikiTaxi as an offline backup for their personal Wiki and need to convert their uncompressed MediaWiki XML dumps to a WikiTaxi *.taxi file on a regular basis. The following script provides a solution to simplify this process. |
| | | | |
| - | [[http://www.autoitscript.com/autoit3/index.shtml|AutoIT]] is required to compile the script, and 7-zip must be installed. Once compiled the script must be placed into the WikiTaxi directory. Then it allows to drag and drop (or select in standalone mode) a MediaWiki *.xml dump file for processing: | + | [[http://www.autoitscript.com/autoit3/index.shtml|AutoIt]] is required to compile the script, and [[http://www.7-zip.org/download.html|7-Zip]] must be installed. Once compiled the script must be placed into the WikiTaxi directory. Then it allows to drag and drop (or select in standalone mode) a MediaWiki *.xml dump file for processing: |
| | | | |
| - | * Run 7-zip to compress the *.xml file to *.xml.bz2 | + | * Run 7-Zip to compress the *.xml file to *.xml.bz2 |
| | * Launch ''WikiTaxi_Importer.exe'', type in the appropriate file names, and import. | | * Launch ''WikiTaxi_Importer.exe'', type in the appropriate file names, and import. |
| | * Invoke ''WikiTaxi.exe'' and navigate to the main page. | | * Invoke ''WikiTaxi.exe'' and navigate to the main page. |
| | | | |
| | <code> | | <code> |
| - | ; Automated MediaWiki XML to WikiTaxi converter. Compile with AutoIT. | + | ; Automated MediaWiki XML to WikiTaxi converter. Compile with AutoIt. |
| | ; Requires WikiTaxi in same directory as compiled .exe, also requires 7-Zip installed on PC. | | ; Requires WikiTaxi in same directory as compiled .exe, also requires 7-Zip installed on PC. |
| | | | |
| | $startpage = "Main Page" | | $startpage = "Main Page" |
| | | | |
| - | ; 7-zip is required | + | ; 7-Zip is required |
| | If Not FileExists(@ProgramFilesDir & "\7-zip\7z.exe") Then | | If Not FileExists(@ProgramFilesDir & "\7-zip\7z.exe") Then |
| - | MsgBox(0, "Required", "7-zip required! Please install and try again.") | + | MsgBox(16, "Required", "7-Zip required! Please install and try again.") |
| | Exit | | Exit |
| | EndIf | | EndIf |
| | "[CLASS:TTntButton.UnicodeClass; INSTANCE:2]") | | "[CLASS:TTntButton.UnicodeClass; INSTANCE:2]") |
| | | | |
| - | ; --- If you have issues after importing, you can adjust or remove lines below --- | + | ; --- If you have issues after importing, adjust or remove lines below --- |
| | | | |
| - | ; Adjust to your needs. I use a small wiki, not the Wikipedia, so the timing is right for my situation. | + | ; Adjust to your needs. I use a small wiki, not the Wikipedia, |
| | + | ; so the timing is right for my situation. |
| | Sleep(1000) | | Sleep(1000) |
| | | | |
| - | ; Uncomment line below for larger wikis, AutoIT can't see this text otherwise we'd wait for it. | + | ; AutoIt can't see this text otherwise we'd wait for it. |
| | + | ; To pause script, uncomment line below for larger wikis: |
| | ;MsgBox(0,"Wait...",'Wait for "Import finished successfully!"') | | ;MsgBox(0,"Wait...",'Wait for "Import finished successfully!"') |
| | | | |
| | + | ; Start WikiTaxi and navigate to specified start page |
| | Run('WikiTaxi "' & $wiki_taxi & '" "' & $startpage & '"') | | Run('WikiTaxi "' & $wiki_taxi & '" "' & $startpage & '"') |
| | | | |
| | ProcessClose("WikiTaxi_Importer.exe") | | ProcessClose("WikiTaxi_Importer.exe") |
| | | | |
| - | ; Remove temporary file. You could also remove .xml, but I keep it since WikiTaxi strips out history. | + | ; Remove temporary file. You could also remove .xml, |
| | + | ; but I keep it since WikiTaxi strips out history. |
| | FileDelete($wiki_xml & ".bz2") | | FileDelete($wiki_xml & ".bz2") |
| | </code> | | </code> |
wiki/wikitaxi/wikitaxi_import_script.txt · Last modified: 2010/07/20 22:02 by complexjunk