Permalink
Browse files

Good faith recgognition and extra lowers removed

Subtracted good faith edits from the vandalism count and removed extra
lower() functions when data=data.lower() is already called.
  • Loading branch information...
sdamashek committed Dec 27, 2012
1 parent a001280 commit 82d654c12df4a94726af0d39606d4c35c3d2d8f9
Showing with 2 additions and 2 deletions.
  1. +2 −2 bot.py
View
4 bot.py
@@ -9,8 +9,8 @@ def getCountThingy():
x = "http://en.wikipedia.org/w/api.php?action=query&list=recentchanges&rcstart="+currentTime+"&rclimit=5000&rcdir=older&rcprop=comment&format=xml"
data = url.urlopen(x).read()
data = data.lower()
count = int(round((data.lower().count("revert")/5.0)+1)) #Round up
totalEdits = int(round(data.lower().count('<rc type')/5.0))
count = int(round(((data.count("revert")-data.count("reverted good faith")-data.count("reverting good faith"))/5.0)+1)) #Round up
totalEdits = int(round(data.count('<rc type')/5.0))
return (totalEdits, count)
theTuple = getCountThingy()
print "Edit Per Minute: ", theTuple[0]

0 comments on commit 82d654c

Please sign in to comment.