Jump to content

User:TaxonBot/test5.tcl

From Wikipedia

\n\[\[Kategorie:" $nsc] > -1} { set nsc [string map [list "-->\n\[\[Kategorie:" "-->\n$nt\n\n\[\[Kategorie:"] $nsc] } elseif {[string first {Hinweis Seiten-Koordinaten} $nsc] == -1} { set nsc [string map [list "\n\n\n\{\{SORTIERUNG:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc] set nsc [string map [list "\n\n\n\{\{DEFAULTSORT:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc] set nsc [string map [list "\n\n\n\[\[Kategorie:" "\n\n$nt\n\n\[\[Kategorie:"] $nsc] if {[string first {Hinweis Seiten-Koordinaten} $nsc] == -1} { set nsc [string map [list "\n\n\{\{SORTIERUNG:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc] set nsc [string map [list "\n\n\{\{DEFAULTSORT:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc] set nsc [string map [list "\n\n\[\[Kategorie:" "\n\n$nt\n\n\[\[Kategorie:"] $nsc]

  1. if {[string first {Hinweis Seiten-Koordinaten} $nsc] == -1} {
  2. set nsc [string map [list "\n\{\{DEFAULTSORT:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc]
  3. }
  4. if {[string first {Hinweis Seiten-Koordinaten} $nsc] == -1} {
  5. set nsc [string map [list "\n\{\{SORTIERUNG:" "\n\n$nt\n\n\{\{SORTIERUNG:"] $nsc]
  6. }

if {[string first {Hinweis Seiten-Koordinaten} $nsc] == -1} { set nsc [string map [list "\}\}\n\[\[Kategorie:" "\}\}\n$nt\n\n\[\[Kategorie:"] $nsc] } } }

  1. puts $nsc ; gets stdin

set nsc [string map [list
{
} "\{\{commonscat" "\{\{Commonscat" "\n|-\n|\}" "\n|\}"] $nsc] puts ----\n$nsc\n if {[string first "\n$nt\n\n" $nsc] == -1} { puts {Fehler: Hinweis nicht gefunden} regsub -- {(\[\[Kategorie:)} $nsc \n$nt\n\n\\1 nsc if {[string first \[\[Kategorie: $nsc] == -1 && [string first PAGENAME\}\}\}\} $nsc] > -1} { set nsc [string map [list PAGENAME\}\}\}\} PAGENAME\}\}\}\}\n$nt] $nsc] puts "Ersatz:\n$nsc" lappend lcatt $catt ; continue } if {[string first \[\[Kategorie: $nsc] == -1} { regsub -- {(\d\d\}\})} $nsc \\1\n$nt nsc puts "Ersatz:\n$nsc"

  1. gets stdin

} puts ----\n$nsc\n }

  1. gets stdin

if {[regexp -all -- {Seiten-Koordinaten} $nsc] > 1} { puts "\aFehler: zu viele Hinweise eingefügt" lappend lcatt $catt ; continue } set nsc [string trim $nsc] puts [decr llcat] puts [edid $cat $summ $nsc / minor] }

puts $lcatt

exit

set lins [insource {\|Vorlage:Navigationsleiste VIMN Northern Europe/} 0] puts $lins

foreach ins $lins { puts [edit $ins {Bot: Vorlage:Navigationsleiste VIMN Northern Europe wurde gelöscht} [string map [list "|Vorlage:Navigationsleiste VIMN Northern Europe\n" {}] [conts t $ins x]] / minor] gets stdin }



exit

source api.tcl ; set lang d ; source langwiki.tcl ; #set token [login $wiki]

if 0 { set db [get_db wikidatawiki] set lde [mysqlsel $db {SELECT

 wbit_item_id as id,
   wby_name as type,
     wbxl_language as language,
       wbx_text as text
       FROM wbt_item_terms
       LEFT JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id
       LEFT JOIN wbt_type ON wbtl_type_id = wby_id
       LEFT JOIN wbt_text_in_lang ON wbtl_text_in_lang_id = wbxl_id
       LEFT JOIN wbt_text ON wbxl_text_id = wbx_id
       WHERE wbxl_language = 'de' limit 100;} -list]

mysqlclose $db

puts $lde

  1. WHERE wbit_item_id = 822280 and wbxl_language = 'de'; -list]

exit

}


set db [get_db wikidatawiki] set lde [mysqlsel $db " select wbit_item_id, wby_name, wbxl_language, wbx_text, rc_title, rc_timestamp, rc_cur_id, ips_site_id, ips_site_page, comment_text from recentchanges left join wb_items_per_site on ips_item_id = trim('Q' from rc_title) left join wbt_item_terms on wbit_item_id = ips_item_id LEFT JOIN wbt_term_in_lang ON wbit_term_in_lang_id = wbtl_id LEFT JOIN wbt_type ON wbtl_type_id = wby_id LEFT JOIN wbt_text_in_lang ON wbtl_text_in_lang_id = wbxl_id LEFT JOIN wbt_text ON wbxl_text_id = wbx_id left join comment on comment_id = rc_comment_id where wbxl_language = 'de' and !rc_namespace and rc_timestamp >= 20210625220000 and ips_site_id = 'dewiki' order by ips_site_page

" -list]

mysqlclose $db

puts $lde puts [llength $lde]


exit

where ips_item_id = trim('Q' from rc_title) and comment_id = rc_comment_id


set tyear [utc -> seconds {} %Y {}] set chron "Wikipedia:Hauptseite/Artikel des Tages/Chronologie $tyear" set lchron "Wikipedia:Hauptseite/Artikel des Tages/Chronologie [expr $tyear - 1]"

set ltc [dict values [regexp -all -line -inline -- {\[\[(.*)\]\]} [conts t $chron x]]] set llc [dict values [regexp -all -line -inline -- {\[\[(.*)\]\]} [conts t $lchron x]]]

set lcc [join [list [lrange $ltc 0 end-1] [lrange $llc 0 end-1]]] puts $lcc

puts [llength $lcc]

foreach cc [lrange $lcc 0 4] { lappend lpcc Diskussion:$cc }

puts [get [post $wiki {*}$format / action purge / titles [join $lpcc |] / forcerecursivelinkupdate 1]]

exit

while 1 { input 1 "n: " input 2 "l: "

puts "set old$1 \{$2\}" puts "set new$1 \{[string map [list {<font color="} {} {;">} {} {}] $2]\}"

}

exit

set lins [insource {font color='/} 2] puts $lins

foreach ins $lins { if {[string first Abbottbot $ins] > -1} { puts [edit $ins {Bot: Überarbeitung veralteter Syntax / HTML-Validierung} [string map [list {} {} {} {} {} {}] [conts t $ins x]] / minor] if {[incr c] <= 5} {gets stdin} } }

exit

set pg "Wikipedia:Liste von Tippfehlern/$argv"

set c [conts t $pg x]

  1. puts $c

regsub -all -line -- {--.*?T\)} $c {} nc regsub -all -line -- {-\[.*?T\)} $nc {} nc regsub -all -line -- {\[\[Benutzer.*?T\)} $nc {} nc regsub -all -line -- {\d\d:\d\d.*?T\)} $nc {} nc

  1. regsub -all -line -- {i\. V\..*?$} $nc {} nc
  2. regsub -all -line -- {-.*?\[\[Benutzer.*?T\)} $nc {} nc

regsub -all -line -- {--.*?11} $nc {} nc

puts $nc

gets stdin

puts [edit $pg {Bot: aktualisiert} $nc]


exit

  1. set lins [lsort [insource {\{\{BLfD/} x]]

set lins [insource {Lucida Calligraphy\;\"\>S/} x] puts [set i [llength $lins]]

set summ {Korrektur ungültiger HTML-Syntax} set old1 {Steindy} set new1 {Steindy} set old2 {Steindy} set new2 {Steindy}

set o 1 foreach ins $lins {

 puts \n[decr i]:$ins:

if $o {

 if {$ins ne {Benutzer Diskussion:Wahrerwattwurm/Archiv 11}} {continue} else {set o 0}

}

 set out [edit $ins "Bot: $summ" [string map [list $old1 $new1 $old2 $new2] [conts t $ins x]] / minor]
 puts $out
 if {{protectedpage} in [split $out]} {
  1. continue
    source api2.tcl ; set lang de1 ; source langwiki.tcl ; #set token [login $wiki]
    puts [edit $ins $summ [string map [list $old1 $new1 $old2 $new2] [conts t $ins x]] / minor]
    after 5000
    source api.tcl ; set lang de ; source langwiki.tcl ; #set token [login $wiki]
 }
 if {[incr c] <= 5} {gets stdin}

}


</source> -->