Skip to content

Commit

Permalink
Authenticate in the work loop
Browse files Browse the repository at this point in the history
This will re-authenticate every 6 hours, which should resolve the issues
of getting logged out randomly.
  • Loading branch information
DamianZaremba committed Oct 26, 2021
1 parent 504b23c commit 353d8ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cluebot3.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
$wpi = new \Wikipedia\Index($wph, $logger);
$wpapi = new \Wikipedia\Api($wph, $logger);

if (!$wpapi->login($user, $pass)) {
die('Failed to authenticate');
}
while (true) {
if (!$wpapi->login($user, $pass)) {
die('Failed to authenticate');
}

while (1) {
$titles = array();
$continue = null;
$ei = $wpapi->embeddedin('User:' . $user . '/ArchiveThis', 500, $continue);
Expand Down

0 comments on commit 353d8ac

Please sign in to comment.