Changeset View
Changeset View
Standalone View
Standalone View
bot.php
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
// stats message | // stats message | ||||
$stats = []; | $stats = []; | ||||
foreach( $counts as $group => $count ) { | foreach( $counts as $group => $count ) { | ||||
$stats[] = "$group: $count"; | $stats[] = "$group: $count"; | ||||
} | } | ||||
$stats = implode( ", ", $stats ); | $stats = implode( ", ", $stats ); | ||||
try { | |||||
$wit->login(); | $wit->login(); | ||||
$wit->edit( [ | $wit->edit( [ | ||||
'title' => MARKADMINS_PAGE, | 'title' => MARKADMINS_PAGE, | ||||
'summary' => "Bot: aggiornamento elenco utenti: $stats", | 'summary' => "Bot: aggiornamento elenco utenti: $stats", | ||||
'text' => json_encode( [ 'legend' => $LEGEND, 'users' => $users ] ), | 'text' => json_encode( [ 'legend' => $LEGEND, 'users' => $users ] ), | ||||
'contentformat' => 'application/json', | 'contentformat' => 'application/json', | ||||
'bot' => 1, | 'bot' => 1, | ||||
] ); | ] ); | ||||
} catch( Exception $e ) { | |||||
\cli\Log::error( sprintf( | |||||
"something bad happened: %s", | |||||
$e->getMessage() | |||||
) ); | |||||
} | |||||
\cli\Log::info( $stats ); | \cli\Log::info( $stats ); |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register