Register - Login
Views: 99386196
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-24-22 04:52:13 AM
Jul - The Cutting Room Floor - HOW TO: install a bot to upload files to the wiki New poll - New thread - New reply
Next newer thread | Next older thread
Liliana
"A horrible person". That's what it says. "A horrible person."

We weren't even testing for that.


Level: NaN


Posts: 1894/-3841
EXP: NaN
For next: 0

Since: 07-23-07


Since last post: 10.2 years
Last activity: 10.1 years

Posted on 09-21-10 01:04:43 PM Link | Quote
I know many of you have moaned about how Special:MultipleUpload no longer works and you have to upload every single file at once, which is very tedious.

However, it is possible to install a bot, which while intended for Wikipedia, works perfectly fine for this wiki too. You can use it to upload images in a much easier fashion, and, using batch scripts, to upload a bunch of them at once.

1. Download the latest python 2.x release from here (not 3.x!) and install it.
2. Download the PyWikipedia bot from here. It is a simple zip archive, so just extract it and here you go. I'm assuming from now on that you extracted the archive to C:\pywikipedia\.
3. The script won't be aware of this wiki. You'll need this file, copy and paste and save it as rustedlogic_family.py in the \families\ subfolder.



# -*- coding: utf-8 -*-

import family

# Cutting Room Floor

class Family(family.Family):
def __init__(self):
family.Family.__init__(self)

self.name = 'rustedlogic'

self.langs = {
'en': 'wiki.rustedlogic.net',
}
self.namespaces[4] = {
'_default': [u'The Cutting Room Floor', self.namespaces[4]['_default']],
}
self.namespaces[5] = {
'_default': [u'The Cutting Room Floor talk', self.namespaces[5]['_default']],
}

def RversionTab(self, code):
return r'<li\s*><a href=".*?title=.*?&action=history".*?>.*?</a></li>'

def version(self, code):
return "1.16.0"

def scriptpath(self, code):
return ''

def apipath(self, code):
return '/api.php'


4. Open a command-line window and navigate to the pywikipedia folder. (in this example case, you can do a simple cd \pywikipedia)
5. Run generate_user_files.py. It should be fairly straightforward, just enter the wiki name as "rustedlogic".
6. Run login.py to log in.

Once you have done these steps, you can upload files. The syntax to upload files is:

upload.py -keep -noverify "filename" "description"

If you have a folder full of files, you can also upload them all at once using a for loop. Navigate to the folder which contains the files and do:

for %i in (*.png) do c:\pywikipedia\upload.py -keep -noverify "%i" "{{screenshot|system=NES}}"

This should allow you to easily upload files in an effective manner.

____________________
Next newer thread | Next older thread
Jul - The Cutting Room Floor - HOW TO: install a bot to upload files to the wiki New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

26 database queries.
Query execution time:  0.285657 seconds
Script execution time:  0.020558 seconds
Total render time:  0.306215 seconds


TidyHTML vomit below
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 119 column 11 - Warning: <form> isn't allowed in <table> elements
line 118 column 10 - Info: <table> previously mentioned
line 120 column 11 - Warning: missing <tr>
line 120 column 119 - Warning: missing </font> before </td>
line 124 column 16 - Warning: plain text isn't allowed in <tr> elements
line 120 column 11 - Info: <tr> previously mentioned
line 125 column 68 - Warning: missing </nobr> before </td>
line 141 column 68 - Warning: missing </nobr> before <tr>
line 147 column 35 - Warning: missing <tr>
line 147 column 50 - Warning: missing </font> before </td>
line 148 column 37 - Warning: unescaped & or unknown entity "&id"
line 147 column 220 - Warning: missing </font> before </table>
line 149 column 35 - Warning: missing <tr>
line 149 column 50 - Warning: missing </font> before </td>
line 149 column 91 - Warning: missing </font> before </table>
line 156 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 158 column 9 - Warning: missing <tr>
line 176 column 13 - Warning: missing <tr>
line 177 column 102 - Warning: unescaped & or unknown entity "&postid"
line 179 column 192 - Warning: missing </span> before <blockquote>
line 186 column 1200 - Warning: inserting implicit <span>
line 186 column 1200 - Warning: missing </span> before <hr>
line 221 column 1 - Warning: inserting implicit <span>
line 236 column 17 - Warning: missing <tr>
line 236 column 17 - Warning: discarding unexpected <table>
line 239 column 35 - Warning: missing <tr>
line 239 column 50 - Warning: missing </font> before </td>
line 239 column 91 - Warning: missing </font> before </table>
line 241 column 35 - Warning: missing <tr>
line 241 column 50 - Warning: missing </font> before </td>
line 242 column 37 - Warning: unescaped & or unknown entity "&id"
line 241 column 220 - Warning: missing </font> before </table>
line 243 column 17 - Warning: discarding unexpected </textarea>
line 243 column 28 - Warning: discarding unexpected </form>
line 243 column 35 - Warning: discarding unexpected </embed>
line 243 column 43 - Warning: discarding unexpected </noembed>
line 243 column 53 - Warning: discarding unexpected </noscript>
line 243 column 64 - Warning: discarding unexpected </noembed>
line 243 column 74 - Warning: discarding unexpected </embed>
line 243 column 82 - Warning: discarding unexpected </table>
line 243 column 90 - Warning: discarding unexpected </table>
line 245 column 9 - Warning: missing </font> before <table>
line 257 column 25 - Warning: discarding unexpected </font>
line 266 column 37 - Warning: discarding unexpected </font>
line 244 column 1 - Warning: missing </center>
line 120 column 63 - Warning: <img> lacks "alt" attribute
line 125 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 125 column 93 - Warning: <img> lacks "alt" attribute
line 141 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 141 column 98 - Warning: <img> lacks "alt" attribute
line 148 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 161 column 23 - Warning: <img> lacks "alt" attribute
line 161 column 64 - Warning: <img> lacks "alt" attribute
line 172 column 15 - Warning: <img> lacks "alt" attribute
line 233 column 3154 - Warning: <img> lacks "alt" attribute
line 242 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 242 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 242 column 246 - Warning: <img> proprietary attribute value "absmiddle"
line 251 column 25 - Warning: <img> lacks "alt" attribute
line 256 column 267 - Warning: <img> lacks "alt" attribute
line 149 column 50 - Warning: trimming empty <font>
line 186 column 1200 - Warning: trimming empty <span>
line 236 column 17 - Warning: trimming empty <tr>
line 239 column 50 - Warning: trimming empty <font>
line 125 column 68 - Warning: <nobr> is not approved by W3C
line 141 column 68 - Warning: <nobr> is not approved by W3C
line 177 column 27 - Warning: <nobr> is not approved by W3C
line 179 column 74 - Warning: <div> proprietary attribute "width"
line 233 column 2988 - Warning: <div> proprietary attribute "width"
Info: Document content looks like HTML5
Info: No system identifier in emitted doctype
Tidy found 70 warnings and 0 errors!


The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier to maintain
compared with using <FONT> elements.

You are recommended to use CSS to control line wrapping.
Use "white-space: nowrap" to inhibit wrapping in place
of inserting <NOBR>...</NOBR> into the markup.

About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium

Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md