ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/ValBot/Docs/Read-me.rtf
(Generate patch)

Comparing ValBot/Docs/Read-me.rtf (file contents):
Revision 1169 by iritscen, Mon Feb 21 23:59:20 2022 UTC vs.
Revision 1185 by iritscen, Tue Aug 15 02:03:16 2023 UTC

# Line 1 | Line 1
1 < {\rtf1\ansi\ansicpg1252\cocoartf2636
2 < \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;\f2\fswiss\fcharset0 Helvetica-Oblique;
3 < }
4 < {\colortbl;\red255\green255\blue255;}
5 < {\*\expandedcolortbl;;}
6 < \margl1440\margr1440\vieww13140\viewh14100\viewkind0
7 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc\partightenfactor0
8 <
9 < \f0\b\fs28 \cf0 How to Use these Scripts\
10 < by iritscen@yahoo.com
11 < \f1\b0 \
12 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
13 < \cf0 \
14 < In the course of maintaining the OniGalore wiki, I have written some Python and Bash shell scripts for Pywikibot.  My Bash shell scripts call existing Python scripts which come with Pywikibot.  My Python scripts utilize the Pywikibot API to perform new tasks not covered by the bundled scripts.  To run the scripts, first {\field{\*\fldinst{HYPERLINK "https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation"}}{\fldrslt install Pywikibot}}, then read below.\
15 < \
16 < \ul Python\ulnone \
17 < In Terminal, 'cd' into the core/ directory and run the command "python pwb.py /path/to/script [arguments for script]".  When running a built-in Pywikibot script, you would simply invoke it with "python pwb.py [name of script without suffix] [arguments]", but since these scripts are outside the core/ directory they need full pathname qualification.\
18 < \
19 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
20 <
21 < \f0\b \cf0 check_interwiki_links.py
22 < \f1\b0 \
23 < This script scans the wikitext of the supplied page, or all the pages in the supplied category, for interwiki links such as [[wp:Example]] and [[wikt:Definition|some word]].  It then tests those links to make sure they're valid and prints a "WARNING:" message if a redirect or 404 is encountered.\
24 < \
25 < Usage:\
26 < python pwb.py check_interwiki_links -page:"Daodan" (checks a single page)\
27 < python pwb.py check_interwiki_links -cat:"Wiki Support" (checks the whole category recursively)\
28 < \
29 <
30 < \f0\b check_intrawiki_section_links.py
31 < \f1\b0 \
32 < This script scans the wikitext of the supplied page, or all the pages in the supplied category, for intrawiki links with section links in them such as [[Konoko#In-game_appearance]].  It then tests those links to make sure they're valid and prints a "WARNING:" or "ERROR:" message if a problem is encountered.  "ADVICE:" messages are printed when a link cannot be tested because transclusion is being used to construct it dynamically.\
33 < \
34 < Usage: The syntax is the same as for check_interwiki_links.py.\
35 < \
36 <
37 < \f0\b find_external_images.py
38 < \f1\b0 \
39 < This script scrapes the HTML of the supplied category's pages and alerts you to externally-linked images so you can consider uploading them to the wiki.  Special attention is drawn to images hosted elsewhere on oni2.net.  This script isn't totally finished and the argument-handling code is in a bit of disarray, but it should support showing inline and/or non-embedded external image links.\
40 < \
41 < Usage:\
42 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
43 < \cf0 python pwb.py find_external_images -page:"State of Emergency"\
44 < python pwb.py find_external_images -justshown -cat:"Category:Real World"\
45 < \
46 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
47 <
48 < \f0\b \cf0 uncapitalize_image_suffixes.py
49 < \f1\b0 \
50 < This script checks all the images on the wiki for capitalized file suffixes (.JPG instead of .jpg, etc.) and renames them to be non-capitalized.  Note that any pages linking to the images will need to be corrected manually afterward, but the script will tell you which pages link to or embed each image that it renames.\
51 < \
52 < \ul Bash\ulnone \
53 <
54 < \f0\b drive_https_upgrade.sh
55 < \f1\b0 \
56 < This script was designed to take a TXT report from a Validate External Links session run \ul without\ulnone  the --show-https-upgrades argument and use it to mass-change all the URLs for sites that wanted an upgrade from HTTP to HTTPS.  In such a TXT report, links which wanted an HTTPS upgrade would have the phrase "Skipping URL
57 < \f2\i x
58 < \f1\i0  because I have not been asked to show http->https upgrades" in it, so the script uses regex to search for "http->https".  It edits all such links from the one numbered FIX_START to the one numbered FIX_END.  This script served its purpose and probably won't be needed again, but it has value as a tutorial.\
59 < \
60 <
61 < \f0\b drive_slash_adding.sh
62 < \f1\b0 \
63 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
64 < \cf0 This script was designed to take a TXT report from a Validate External Links session run \ul without\ulnone  the --show-added-slashes argument and use it to mass-change all the URLs that wanted a trailing slash added to them.  In such a TXT report, URLs where the server asked for a trailing '/' to be added to the URL would have the phrase "Skipping URL
65 < \f2\i x
66 < \f1\i0  because I have not been asked to show added trailing slashes", so the script searches for the word "trailing".  This script served its purpose and probably won't be needed again, but it has value as a tutorial.\
67 < \
68 < \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
69 < \cf0 \ul Docs\
70 <
71 < \f0\b \ulnone Generator and replace options.txt
72 < \f1\b0 \ul \
73 < \ulnone This is the help text generated by "python pwb.py replace -help".  It shows the many options you have for using the built-in replace.py script and for asking any built-in Pywikibot script to limit its scope to certain pages.\ul \
74 < \ulnone \
75 <
76 < \f0\b Pywikibot commands.rtf
77 < \f1\b0 \
78 < General advice on how to use Pywikibot properly.\
79 < \
80 <
81 < \f0\b Read-me.rtf
82 < \f1\b0 \
83 < You are here.}
1 > {\rtf1\mac\ansicpg10000\cocoartf\nisusversion50300 {\*\nisusorigapp Cocoa}{\*\nisusorigdate\yr2023\mo4\dy27\hr12\min11 }{\*\nisussysvers 13.5.0}\deff0
2 > {\*\fonttbl
3 > {\f0\fswiss\fcharset77 Helvetica;}
4 > {\f1\fswiss\fcharset77 Helvetica-Bold{\*\falt Helvetica};}
5 > {\f2\fswiss\fcharset77 Helvetica-Oblique{\*\falt Helvetica};}}
6 > {\colortbl ;\red0\green0\blue254 ;}
7 > {\*\nisustoctable
8 > {\nisustoc\tcf68 {\nisustocname Default TOC}{\*\nisustoctabrep  }{\*\nisustocretrep  }{\nisustoclevelstyle TOC 1}{\nisustoclevelstyle TOC 2}{\nisustoclevelstyle TOC 3}{\nisustoclevelstyle TOC 4}{\nisustoclevelstyle TOC 5}{\nisustoclevelstyle TOC 6}{\nisustoclevelstyle TOC 7}{\nisustoclevelstyle TOC 8}{\nisustoclevelstyle TOC 9}}\nisusactivetoc68 }
9 > {\*\nisusxetable
10 > {\nisusxe\xef68 {\nisusxename Default Index}{\nisusxeheaderstyle Index Heading}{\nisusxelevelstyle Index 1}{\nisusxelevelstyle Index 2}{\nisusxelevelstyle Index 3}{\nisusxelevelstyle Index 4}{\nisusxelevelstyle Index 5}{\nisusxelevelstyle Index 6}{\nisusxelevelstyle Index 7}{\nisusxelevelstyle Index 8}{\nisusxelevelstyle Index 9}{\*\fldinst INDEX \\k ". " \\g \endash  \\e "\tab " \\l ", " \\f D}}\nisusactivexe68 }
11 > {\stylesheet
12 > {\s104\snext104 \ltrpar\pardirnatural\ql\widctlpar\sb0\sa0\sl240\slmult1\hyphpar1\li0\lin0\fi0\ri0\rin0 Header;}
13 > {\s105\snext105 \ltrpar\pardirnatural\ql\widctlpar\sb0\sa0\sl240\slmult1\hyphpar1\li0\lin0\fi0\ri0\rin0 Footer;}
14 > {\*\cs106\ul\cf1 Hyperlink;}}
15 > \defformat {\*\generator Nisus Writer Express 4.3 [0503.0004.01]}{\info {\*\nisusgmtoffset -4:00}{\author Admin}{\creatim\yr2021\mo3\dy7\hr16\min44 }{\revtim\yr2023\mo8\dy14\hr21\min59 }}
16 > {\*\userprops }\nisusrulerunits0\nisusstatusbar1\nisusareaid1\viewkind4\viewscale100\nisusviewruler1\nisusviewrulerh1\nisusviewrulerv0\nisusviewtoolbar1\nisusviewtooldrawer0\nisusviewtoolswidth0\nisusviewpagenumtype1\nisusviewrulericons0\donotshowcomments1
17 > {\*\nisusviewsettings\viewkind4\viewscale100 {\nisusnavsettings {\*\visible 0}{\*\width 160}{\*\isOnRightSide 0}{\*\mode toc}{\*\sort location}}{\nisuscommentsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 0}{\*\width 180}{\*\titlebarInfo 2}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}{\nisusrevisionsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 1}{\*\width 180}{\*\titlebarInfo 4}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}}
18 > {\*\nisusviewsettings\viewkind1\viewscale100 {\nisusnavsettings {\*\visible 0}{\*\width 160}{\*\isOnRightSide 0}{\*\mode toc}{\*\sort location}}{\nisuscommentsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 0}{\*\width 180}{\*\titlebarInfo 2}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}{\nisusrevisionsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 1}{\*\width 180}{\*\titlebarInfo 4}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}}
19 > \nisusareasplitv0
20 > {\*\nisuswindow\x128\y96\w613\actualw613\h631 }
21 > \nshwinv0\nshwpg1\nisusinlinespell0\nisushyphnone\spltpgpar\nisusselectstart2878\nisusselectlength0\fet2\ftnbj\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\pgnstart1\nocolbal \f0
22 > \sectd\endnhere\cols1\ltrsect\colbalsxn0\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\guttersxn0\headery720\footery360\pgncont\pgndec\sxnstarts1\sxnrestart\sxndec
23 > {\header\plain\pard\s104\ltrpar\pardirnatural\ql\widctlpar\f0\fs28 }
24 > {\footer\plain\pard\s105\ltrpar\pardirnatural\ql\widctlpar\f0\fs28 }
25 > \deftab720 {\pard\ltrpar\pardirnatural\qc {\f1\fs28\b How to Use these Scripts\par
26 > by iritscen@yahoo.com}{\fs28 \par }}
27 > {\pard\ltrpar\pardirnatural\ql {\fs28 \par
28 > In the course of maintaining the OniGalore wiki, I have written some Python and Bash shell scripts for Pywikibot.  My Bash shell scripts call Python scripts which are bundled with Pywikibot.  My Python scripts utilize the Pywikibot API to perform new tasks not covered by the bundled scripts.  To run the scripts, first }}
29 > {\field {\*\fldinst HYPERLINK "https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation"}{\fldrslt {\pard\ltrpar\pardirnatural\ql {\cs106\fs28\ul\cf1 install Pywikibot}}}}{\pard\ltrpar\pardirnatural\ql {\fs28 , then read below for an introduction to each file in the ValBot/ directory.\par
30 > \par
31 > {\ul Bash/}\par
32 > {\f1\b drive_https_upgrade.sh}\par
33 > This script was designed to take a TXT report from a Validate External Links session run {\ul without} the --show-https-upgrades argument and use it to mass-change all the URLs for sites that wanted an upgrade from HTTP to HTTPS.  In such a TXT report, links which wanted an HTTPS upgrade would have the phrase "Skipping URL {\f2\i x} because I have not been asked to show http->https upgrades" in it, so the script uses regex to search for "http->https".  It edits all such links from the one numbered FIX_START to the one numbered FIX_END.  This script served its purpose and probably won't be needed again, but it has value as a tutorial.\par
34 > \par
35 > {\f1\b drive_slash_adding.sh}\par
36 > This script was designed to take a TXT report from a Validate External Links session run {\ul without} the --show-added-slashes argument and use it to mass-change all the URLs that wanted a trailing slash added to them.  In such a TXT report, URLs where the server asked for a trailing '/' to be added to the URL would have the phrase "Skipping URL {\f2\i x} because I have not been asked to show added trailing slashes", so the script searches for the word "trailing".  This script served its purpose and probably won't be needed again, but it has value as a tutorial.\par
37 > \par
38 > {\ul Docs/\par }
39 > {\f1\b Generator and replace options.txt}{\ul \par }
40 > This is the help text generated by "python pwb.py replace -help".  It shows the many options you have for using the built-in replace.py script and for asking any built-in Pywikibot script to limit its scope to certain pages.{\ul \par }
41 > \par
42 > {\f1\b Pywikibot commands.rtf}\par
43 > General advice on how to use Pywikibot properly.\par
44 > \par
45 > {\f1\b Read-me.rtf}\par
46 > You are here.\par
47 > \par
48 > {\ul Python/}\par
49 > In Terminal, 'cd' into the core/ directory and run the command "python pwb.py /path/to/script [arguments for script]".  If you were running a built-in Pywikibot script, you could simply invoke it with "python pwb.py [name of script without suffix] [arguments]", but since these {\*\nisusscroll\nisusarea1\xoffset0\yoffset5 }
50 > scripts that you downloaded are outside the core/ directory they need full pathname qualification.\par
51 > \par
52 > {\f1\b check_interwiki_links.py}\par
53 > This script scans the wiki markup of a given page, or all the pages in a given category, for interwiki links such as [[wp:Example]] and [[wikt:definition|some word]].  It then tests those links to make sure they're valid and prints an "ERROR:" message if the page is not found or if the interwiki link specified a section on that page (e.g. [[wp:Article#References]]) and that section cannot be found.{\nisusselectcaret \par }
54 > \par
55 > Usage:\par
56 > python pwb.py path/to/check_interwiki_links.py -page:"Daodan"\par
57 > python pwb.py path/to/check_interwiki_links.py -cat:"Wiki Support" \par
58 > Adding the argument "-dbg" will print the name of each page as it is being scanned instead of only the pages with bad links.\par
59 > \par
60 > {\f1\b check_intrawiki_section_links.py}\par
61 > This script scans the wiki markup of a given page, or all the pages in a given category, for intrawiki links that have section links in them such as [[Konoko#In-game appearance]].  It then looks for those sections on the relevant pages and prints an "ERROR:" message if a problem is encountered.  "ADVICE:" messages are printed when a link cannot be tested because transclusion is being used to build the link in a way that the script cannot unravel.\par
62 > \par
63 > Usage: The syntax is the same as for check_interwiki_links.py.  Adding the argument "-dbg" will print the name of each page as it is being scanned as well as verbose logic explaining how each link is being processed.\par
64 > \par
65 > {\f1\b find_external_images.py}\par
66 > This script scrapes the HTML markup of a given page, or all the pages in a given category, and alerts you to externally-linked images so you can consider uploading them to the wiki.  A division is made between images hosted on oni2.net and hosted outside the domain.  The script can be asked to show embedded (inline) images and/or images which are externally linked (presented as clickable links).\par
67 > \par
68 > Usage:\par
69 > python pwb.py path/to/find_external_images.py -linked -page:"Press coverage"\par
70 > python pwb.py path/to/find_external_images.py -embedded -page:"State of Emergency"\par
71 > python pwb.py path/to/find_external_images.py -linked -embedded -cat:"Category:Real World"\par
72 > Adding the argument "-dbg" will print the name of each page as it is being scanned instead of only the pages with bad links.\par
73 > \par
74 > {\f1\b uncapitalize_image_suffixes.py}\par
75 > This script checks all the images on the wiki for capitalized file suffixes (.JPG instead of .jpg, etc.) and renames (i.e., moves) them to non-capitalized versions.  Note that any pages linking to the images will need to be corrected manually afterward, but the script will tell you which pages link to each image that it renames.\par
76 > \par
77 > Usage: Simply invoke the script with no arguments.\par }}}

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)