User:Lowercase sigmabot II/Source.py: Difference between revisions

Content deleted Content added
Updating source) (bot
Updating source) (bot
Line 1:
 
Source as of 0205:3552, 1 May 2012 (UTC).
 
== Sandbot1.py ==
Line 141:
def should_be_reset(box):
curtime = datetime.utcnow()
three_daysthree_min = timedelta(hoursseconds=72180)
query = api.call({"action":"query", "prop":"revisions", "titles":box, "rvprop":"timestamp"})["query"]["pages"]
pageid = query.keys()[0]
box_stamp = api.parse_date(query[pageid]["revisions"][0]["timestamp"])
if box_stamp < curtime - three_daysthree_min:
return True
return False