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

Content deleted Content added
Updating source) (bot
Updating source) (bot
Line 1:
Source as of 0201:4844, 1421 October 2012 (UTC).
 
== Sandbot1.py ==
Line 116:
* The page is cleared regularly *
* Feel free to try your editing skills below *
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->"""
"""
def main():
Line 162 ⟶ 161:
def box_needs_reset(self, box):
now = datetime.datetime.utcnow()
three_min = datetime.timedelta(seconds=606)#0 * 3)
res = self.api.call(action="query", prop="revisions", titles=box.title, rvprop="timestamp", limit="2")
str_stamp = res["query"]["pages"][tuple(res["query"]["pages"].keys())[0]]["revisions"][0]["timestamp"]
Line 176 ⟶ 175:
for sandbox in self.SANDBOXES:
box = self.api.page(sandbox)
if box.revision_user ==in ("Lowercase sigmabot II":, "Hazard-Bot") or\
box.content == reset_text:
continue
if self.box_needs_reset(box):
print("Clearing {!r}".format(sandbox))
print(self.api.edit(sandbox, reset_text, "Clearing sandbox) (bot", bot=True, force=True))
else:
# The bot will fork, and continue on to the next sandbox