Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion selfimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
import cStringIO
import re
import json
import urllib2

import mwclient
import mwparserfromhell
Expand Down Expand Up @@ -91,7 +93,11 @@ def process_page(page):
description = re.sub(r"""\[\[User:.*?\]\] \(\[\[User talk:J.*?\]\]\).*?\(UTC\)""",'',description,flags=re.U) # Remove signatures when possible
else:
description = ""


### Fetch image captions used, and list them if exist | A930913 for Sfan00_IMG ###
data=json.load(urllib2.urlopen("http://tools-webproxy/cluestuff/cgi-bin/vada/imgcaps.py?img={name}".format(**page)))
if len(data): description="* This page: "+description+"\n"+"".join(["* [["+k+"]]: "+data[k]+"\n" for k in data])

contents = u"""{{Information
| description = """+description+"""
| source = {{own}}
Expand Down