View source: Pywikipedia
Views
Page
View source
We looking for new a maintainer for AndyZ's peerreviewer script, see
WT:Peer review
for details.
You can view and copy the source of this page:
'''WPW''' ('''web pywikipedia''') framework is a minimal reimplementation of [[m:pywikipedia|pywikipedia]]. It is designed to load fast with a smaller memory footprint with as few libraries as possible. Despite its incompleteness I preferable it for testing as it eliminates the 5 second initialization delay of pywikipedia. == Programs == The programs below have been port as to test of frameworks capability. Only a few changes are necessary to deal HTML limitations and lack of interactivity. Programs run in a similar manner to their command line counterparts. If the program is significantly changed or enhanced from its command line counterpart it is prefixed with “web” in front. <div style="margin:0.5em auto 1em; text-align:center;"> <form action="../cgi-bin/reflinks.py"> <tt>./<select id="script" style="border:1px solid silver; font-family:monospace;" onchange="this.form.action='../cgi-bin/'+this.options[this.selectedIndex].value; this.nextSibling.href='#'+this.options[this.selectedIndex].value;"> <option>commonfixes.py</option> <option>cosmetic_changes.py</option> <option>noreferences.py</option> <option>pdfbot.py</option> <option selected="selected">reflinks.py</option> <option>standardize_notes.py</option> <option>table2wiki.py</option> </select><a href="#reflinks.py"><sup>?</sup></a> -page:<input name="page" size="40" title="Paste or enter a URL or page title" onchange="fixTitle(this)" /></tt> <input type="submit" value="Execute" /> </form> </div> Most the scripts use pagegenerators.py library allow for multiple page arguments such as from sources: backlinks, categories, Title prefixing, and external link. === commonfixes.py === Applies link, HTML, and template fixes similar to AWB's General fixes, only enabled the Englished Wikipedia. Used by webchecklinks, webreflinks, and [[User:PDFbot|PDFbot]] to standardize wikisyntax. Bookmarklet: <a href="javascript:location='//toolserver.org/~dispenser/cgi-bin/commonfixes.py?client=bookmarklet'+(typeof wgPageName!='undefined'?'&page='+wgContentLanguage+':'+wgPageName : '')" onclick="return false">commonfixes</a> === cosmetic_changes.py === Does slight modifications to the wikitext so the code looks cleaner. The changes are not supposed to change the look of the rendered wiki page. This script is not fully ported yet, featured related to internal, category, and language links are not implemented in wikipedia.py yet. Additionally some specific features for safe replacement are not implemented correctly. Use at your own risk. === noreferences.py === Adds a <code><references /></code> to the '''References''' section if missing and <ref> exists; if the section does not exists it intelligently adds it. === pdfbot.py === Add file sizes to external link wrapped with the formatting template {{[[Template:PDFlink|PDFlink]]}}. [[User:PDFbot/pdfbot.py|Source code]] === reflinks.py === Fills in the title for bare reference links in the form of <code><nowiki><ref>http://en.wikipedia.org/</ref></nowiki></code> and converts into <code><nowiki><ref>[http://en.wikipedia.org/ Wikipedia, the free encyclopedia<!-- bot generated title -->]</ref></nowiki></code> using the title from an HTML page or PDF. [[User:DumZiBoT|DumZiBoT]] run this script to add titles to many references and the script writing the bot owner and writing has posted some of the [[User:DumZiBoT/refLinks|frequently asked question]] about his script. === standardize_notes.py === Update and fixes reference using the [[Template:Note|footnote]]s system. Developed by [[User:SEWilco]]. '''NOTE''': This script is not capable of handling the <ref></ref> syntax. It just handles the {{ref}} syntax, which is still used, but is ''DEPRECATED'' on the English Wikipedia. === table2wiki.py === Convert many HTML-tables into MediaWiki tables (''wikitables''). Examples: [http://en.wikipedia.org/w/index.php?title=Crimpshrine&diff=249538891&oldid=prev], [http://en.wikipedia.org/w/index.php?title=List_of_people_on_stamps_of_Ireland&diff=next&oldid=240474304] == Features == * Quick porting between command line and web application * Fast startup times (< 1 sec) * Limited Multi-language (excluded localized namespaces) * MediaWiki like human and machine interfaces == General query parameters == === Language support === Support for languages is accomplish is typically by giving the programs the page title in interwiki format. For example the German Wiktionary page for “Fenster” would be inputted as <tt>wikt:de:Fenster</tt>. This is cumbersome so an easier way is to paste the URL and it will automagically convert to the correct form. Some program are not properly built and so require the use of the <code>&family=</code> and <code>&lang=</code> to setup the project and language, respectively. === Edit token === If the string <code>&wpEditToken=</code> is supplied with a valid edit token for your account the save button will be enabled. This can be used in conjuction with the parameter <code>&autoclick=</code> to autosave pages. == Porting == # Add to top of the script <code>#!/usr/bin/python2.5</code> # Change the permissions to <tt>-rwxr-xr-w</tt> # Change the initializing code from <pre> if __name__ == "__main__": try: main() finally: wikipedia.stop() </pre> :to <pre> if __name__ == "__main__" and wikipedia.handleUrlAndHeader(): try: wikipedia.startContent() main() finally: wikipedia.endContent() wikipedia.stopme() </pre> <div class="toptext"><a href="http://en.wikipedia.org/wiki/User_talk:Dispenser" title="User talk:Dispenser" class="extiw">Report bugs / Feedback</a></div>
Interaction
Main page
Recent changes
Tools
Altviewer
Checklinks
Dablinks
Geodata
Peer reviewer
Pywikipedia
Reflinks
Interaction
Preferences