Feature Requests item #1800925, was opened at 2007-09-24 17:14
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800925&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: wikipedia.search and page generator
Initial Comment:
The MediaWiki search functionality needs to be exposed to the bot framework, especially as a page generator as the Google search depends on an inaccessible feature, and the Yahoo search API is limited to 100 results.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800925&group_…
Feature Requests item #1800873, was opened at 2007-09-24 15:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800873&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: replace.py -excepttext
Initial Comment:
replace.py -excepttext does not work.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800873&group_…
Revision: 4345
Author: a_engels
Date: 2007-09-23 19:37:11 +0000 (Sun, 23 Sep 2007)
Log Message:
-----------
* Adapted rcsort to the newest changes in the rest of the framework
* Added the option newbies=true to rcsort, making it use [[Special:Contributions/newbies]] instead of [[Special:Recentchanges]]
Modified Paths:
--------------
trunk/pywikipedia/rcsort.py
trunk/pywikipedia/userinterfaces/cgi_interface.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/rcsort.py
===================================================================
--- trunk/pywikipedia/rcsort.py 2007-09-22 10:32:24 UTC (rev 4344)
+++ trunk/pywikipedia/rcsort.py 2007-09-23 19:37:11 UTC (rev 4345)
@@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
# A tool to see the recentchanges ordered by user instead of by date. This
# is meant to be run as a CGI script.
+# Apart from the normal options of the recent changes page, you can add an option
+# ?newbies=true which will make the bot go over recently registered users only.
# Currently only works on Dutch Wikipedia, I do intend to make it more generally
# usable.
# Permission has been asked to run this on the toolserver.
@@ -26,17 +28,28 @@
print "-->"
mysite = wikipedia.getSite()
-post = 'title=Speciaal:RecenteWijzigingen'
+newbies = form.has_key('newbies')
+
+if newbies:
+ post = 'title=Speciaal:Bijdragen&target=newbies'
+else:
+ post = 'title=Speciaal:RecenteWijzigingen'
+
for element in form:
- post += '&%s=%s'%(element,form[element].value)
+ if element != 'newbies':
+ post += '&%s=%s'%(element,form[element].value)
if not 'limit' in form:
post += '&limit=1000'
text = mysite.getUrl('/w/index.php?%s'%post)
+
text = text.split('\n')
rcoptions = False
lines = []
-Ruser = re.compile('title=\"Speciaal\:Bijdragen\/([^\"]*)\"')
+if newbies:
+ Ruser = re.compile('\"Overleg gebruiker:([^\"]*)\"\>Overleg\<\/a\>\)')
+else:
+ Ruser = re.compile('title=\"Speciaal\:Bijdragen\/([^\"]*)\"')
Rnumber = re.compile('tabindex=\"(\d*)\"')
count = 0
for line in text:
@@ -51,6 +64,12 @@
elif line.find('rcoptions') > -1:
print line.replace("/w/index.php?title=Speciaal:RecenteWijzigingen&","rcsort.py?")
rcoptions = True
+ elif newbies and line.find('Nieuwste') > -1:
+ line = line.replace("/w/index.php?title=Speciaal:Bijdragen&","rcsort.py?").replace("target=newbies","newbies=true")
+ if line.find('</fieldset>') > -1:
+ line = line[line.find('</fieldset>')+11:]
+ print line
+ rcoptions = True
lines.sort()
last = 0
@@ -60,10 +79,10 @@
if line[0] == None:
print "<h2>Gebruiker onbekend</h2>"
else:
- wikipedia.output(u"<h2>%s</h2>"%line[0],showcgi=True)
+ wikipedia.output(u"<h2>%s</h2>"%line[0],toStdout=True)
print "<ul>"
last = line[0]
- wikipedia.output(line[2].replace('href="/w','href="http://nl.wikipedia.org/w'), showcgi = True)
+ wikipedia.output(line[2].replace('href="/w','href="http://nl.wikipedia.org/w'), toStdout = True)
print
print "</ul>"
Modified: trunk/pywikipedia/userinterfaces/cgi_interface.py
===================================================================
--- trunk/pywikipedia/userinterfaces/cgi_interface.py 2007-09-22 10:32:24 UTC (rev 4344)
+++ trunk/pywikipedia/userinterfaces/cgi_interface.py 2007-09-23 19:37:11 UTC (rev 4345)
@@ -4,11 +4,10 @@
def __init__(self):
pass
- def output(self, text, toStdout = False):
- # all debug output etc. will be ignored.
- if toStdout:
- sys.stdout.write(text.encode('UTF-8', 'replace'))
+ def output(self, text, colors = None, newline = True, toStdout = False):
+ if not toStdout:
+ return
+ sys.stdout.write(text.encode('UTF-8', 'replace'))
- def input(self, question, password = False):
- # CGI is output-only.
- self.output(question + ' ', newline = False, toStdout = True)
+ def input(self, question, colors = None):
+ self.output(question + ' ', newline = False, showcgi = True)
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2007-09-22 10:32:24 UTC (rev 4344)
+++ trunk/pywikipedia/wikipedia.py 2007-09-23 19:37:11 UTC (rev 4345)
@@ -4941,7 +4941,10 @@
['yes', 'no'], ['y', 'N'], 'N')
if answer in ['y', 'Y']:
return
- get_throttle.drop()
+ try:
+ get_throttle.drop()
+ except NameError:
+ pass
import atexit
atexit.register(_flush)
Feature Requests item #1800492, was opened at 2007-09-23 18:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800492&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: uncategorised page generators
Initial Comment:
The current page generators are not exposed as command line options, and there isnt a page generator for [[Special:Uncategorizedimages]].
This patch provides both.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800492&group_…
Bugs item #1798800, was opened at 2007-09-21 00:37
Message generated for change (Comment added) made by zeroj
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1798800&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Roberto Zanon (qualc1)
Assigned to: Nobody/Anonymous (nobody)
Summary: pagefromfile.py: bug with -notitle and -summary arguments
Initial Comment:
The patch make working -summary (if specified -summary it uses it) and -notitle (it doesn't do anything if "-notitle" is used without this path).
----------------------------------------------------------------------
Comment By: John Vandenberg (zeroj)
Date: 2007-09-23 17:09
Message:
Logged In: YES
user_id=108686
Originator: NO
FWIW, I also ran into this problem and my fix is almost identical.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1798800&group_…
Feature Requests item #1800470, was opened at 2007-09-23 16:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800470&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: John Vandenberg (zeroj)
Assigned to: Nobody/Anonymous (nobody)
Summary: yahoo page generator
Initial Comment:
For those of us without a Google key to the Google Search API, a Yahoo search page generator can be useful.
Patch attached.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1800470&group_…
Revision: 4344
Author: cosoleto
Date: 2007-09-22 10:32:24 +0000 (Sat, 22 Sep 2007)
Log Message:
-----------
minor fix, TypeError
Modified Paths:
--------------
trunk/pywikipedia/query.py
Modified: trunk/pywikipedia/query.py
===================================================================
--- trunk/pywikipedia/query.py 2007-09-22 09:52:30 UTC (rev 4343)
+++ trunk/pywikipedia/query.py 2007-09-22 10:32:24 UTC (rev 4344)
@@ -114,14 +114,14 @@
if pt == type( {} ):
return params
elif pt == type( () ):
- if len( params ) != 2: raise u"Tuple size must be 2"
+ if len( params ) != 2: raise "Tuple size must be 2"
return {params[0]:params[1]}
elif pt == type( [] ):
for p in params:
- if p != type( () ) or len( p ) != 2: raise u"Every list element must be a 2 item tuple"
+ if p != type( () ) or len( p ) != 2: raise "Every list element must be a 2 item tuple"
return dict( params )
else:
- raise u"Unknown param type %s" % pt
+ raise "Unknown param type %s" % pt
def CombineParams( params1, params2 ):
"""Merge two dictionaries. If they have the same keys, their values will
@@ -140,7 +140,7 @@
params1[k] = v2
elif len( v2 ) > 0:
if type('') != type(v1) or type('') != type(v2):
- raise u"Both merged values must be of type 'str'"
+ raise "Both merged values must be of type 'str'"
params1[k] = v1 + '|' + v2
# else ignore
else:
@@ -167,13 +167,14 @@
encList = ''
# items may not have one symbol - '|'
for l in list:
- if '|' in l: raise u"item '%s' contains '|' symbol" % l
+ if '|' in l: raise "item '%s' contains '|' symbol" % l
encList += ToUtf8(l) + '|'
return encList[:-1]
def ToUtf8(s):
if type(s) != type(u''):
- raise u"item %s is not unicode" % unicode(s)
+ wikipedia.output("item %s is not unicode" % unicode(s))
+ raise
return s.encode('utf-8')
def IsString(s):
Revision: 4343
Author: cosoleto
Date: 2007-09-22 09:52:30 +0000 (Sat, 22 Sep 2007)
Log Message:
-----------
disabled not working REs
Modified Paths:
--------------
trunk/pywikipedia/fixes.py
Modified: trunk/pywikipedia/fixes.py
===================================================================
--- trunk/pywikipedia/fixes.py 2007-09-21 23:16:02 UTC (rev 4342)
+++ trunk/pywikipedia/fixes.py 2007-09-22 09:52:30 UTC (rev 4343)
@@ -47,7 +47,7 @@
# horizontal line without attributes in a single line
(r'(?i)([\r\n])<hr[ /]*>([\r\n])', r'\1----\2'),
# horizontal line without attributes with more text in the same line
- (r'(?i) +<hr[ /]*> +', r'\r\n----\r\n'),
+ #(r'(?i) +<hr[ /]*> +', r'\r\n----\r\n'),
# horizontal line with attributes; can't be done with wiki syntax
# so we only make it XHTML compliant
(r'(?i)<hr ([^>/]+?)>', r'<hr \1 />'),
@@ -144,7 +144,7 @@
# external link starting with double bracket
(r'\[\[(?P<url>https?://.+?)\]', r'[\g<url>]'),
# external link with forgotten closing bracket
- (r'\[(?P<url>https?://[^\]\s]+)\r\n', '[\g<url>]\r\n'),
+ #(r'\[(?P<url>https?://[^\]\s]+)\r\n', r'[\g<url>]\r\n'),
# external link ending with double bracket.
# do not change weblinks that contain wiki links inside
# inside the description
@@ -208,7 +208,7 @@
# external link starting with double bracket
(r'\[\[(?P<url>https?://.+?)\]', r'[\g<url>]'),
# external link with forgotten closing bracket
- (r'\[(?P<url>https?://[^\]\s]+)\r\n', '[\g<url>]\r\n'),
+ #(r'\[(?P<url>https?://[^\]\s]+)\r\n', r'[\g<url>]\r\n'),
# external link and description separated by a dash, with
# whitespace in front of the dash, so that it is clear that
# the dash is not a legitimate part of the URL.