Content deleted Content added
Updating published sources: TFATitleSubpageCreator: * Start maintaining a JSON version of the data, currently in the bot's userspace. |
Updating published sources: TFATitleSubpageCreator: * Comment out new code for now, can't work at that title due to missing OAuth grants. |
||
Line 51:
$api->task('TFATitleSubpageCreator', 0, 10, qw/d::Talk d::Templates/);
#my $jsontok = $api->edittoken( 'User:AnomieBOT II/TFA title.json' );
#if($jsontok->{'code'} eq 'shutoff'){
# $api->warn("Task disabled: ".$jsontok->{'content'}."\n");
# return 300;
#}
#if($jsontok->{'code'} ne 'success'){
# $api->warn("Failed to get edit token for User:AnomieBOT II/TFA title.json: ".$jsontok->{'error'}."\n");
# return 300;
#}
#my $json;
#eval { $json = JSON->new->decode( $jsontok->{'revisions'}[0]{'slots'}{'main'}{'*'} // '' ); };
#if ( $@ ) {
# $api->warn("Failed to parse User:AnomieBOT II/TFA title.json: $@\n");
# return 300;
#}
#my @jsonupdates = ();
my $broken = 0;
Line 149:
}
#my $dt = Time::Piece->strptime( $date, '%B %d, %Y' )->strftime( '%Y-%m-%d' );
#if ( $link ne ( $json->{$dt} // '' ) ) {
# $json->{$dt} = $link;
# push @jsonupdates, "[[$title|$dt]] is [[$link]]";
#}
}
#if ( @jsonupdates ) {
# my $outtxt = JSON->new->pretty->canonical->encode( $json );
# my $r = $api->edit( $jsontok, $outtxt, "Updates: " . join( '; ', @jsonupdates ), 1, 1 );
# if ( $r->{'code'} ne 'success' ) {
# $api->warn( "Write failed on User:AnomieBOT II/TFA title.json: " . $r->{'error'} . "\n" );
# $broken = 1;
# }
#}
@titles=();
|