Wikidata:Requests for permissions/Bot/TaxonBot
The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
Approved--Ymblanter (talk) 18:35, 26 December 2016 (UTC)[reply]
TaxonBot (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: Doc Taxon (talk • contribs • logs)
Task/s:
- correcture of commons links to logos of enterprises (changing of infoboxes in dewiki)
- correcture of data in infoboxes at dewiki from data in wikidata, so this data has to be sent to wikidata first
- correcture of properties between internet archive links and internet links
- inserts of postal codes where such are missing
- much more
Code: An example of the code for logo commons image insert based on tcl, mySQL and JSON (API) running on toollabs.
set lang de ; source langwiki.tcl ; set token [login $wiki]
set items [catids {Wikipedia:Infobox Unternehmen/Logo nicht aus Wikidata} 0]
foreach item $items {lappend lkv "page_id = $item"}
foreach 1 $items {
if {$1 in {311509 240419 1809945 8860119 9050738 7886923}} {continue}
set c [conts id $1 0]
set sc [split $c \n]
foreach 2 $sc {
if {[string first Logo $2] > -1 && [string first | $2] > -1 && [string first = $2] > -1} {
set s2 [split $2 =]
lappend s $1 [string trim [lindex $s2 1]]
break
}
}
}
set lang commons ; source langwiki.tcl ; set token [login $wiki]
foreach {1 2} $s {
if ![missing File:$2] {
lappend bt $1 [string map {_ { }} $2]
lappend lkv "page_id = $1"
}
}
set lang d ; source langwiki.tcl ; set token [login $wiki]
mysqlreceive $db "select page_id, page_title, pp_value from page, page_props where pp_page = page_id and ([join $lkv { or }]) and pp_pro
pname = 'wikibase_item' order by page_title;" {pgid pt ppv} {
lappend ps $pgid $pt $ppv
}
foreach {pgid pt ppv} $ps {
catch {
set claims [get [post $wiki {*}$format / action wbgetclaims / entity $ppv] claims]
if {{P154} ni [dict keys $claims]} {
set f [open wikidata5.out a] ; puts $f $pgid:$ppv:$pt:[dict get $bt $pgid] ; close $f
}
}
}
set s [read [set f [open wikidata5.out r]]] ; close $f
set s [lrange [split $s \n] 0 end-1]
foreach 1 $s {lappend j [split $1 :]}
foreach 1 $j {
set j1 [lindex $1 1]
set j3 [lindex $1 3]
puts \n$j1:$j3
puts [get [post $wiki {*}$token {*}$format / action wbsetclaim / claim [format {{"id":"%s$13572468-2468-1357-eca9-bdf024681357","type
":"statement","mainsnak":{"snaktype":"value","property":"P154","datavalue":{"value":"%s","type":"string"},"datatype":"commonsMedia"},"re
ferences":[{"snaks":{"P143":[{"snaktype":"value","property":"P143","datavalue":{"value":{"entity-type":"item","numeric-id":"48183","id":
"Q48183"},"type":"wikibase-entityid"},"datatype":"wikibase-item"}]},"snaks-order":["P143"]}]}} $j1 $j3] / bot]]
}
exit
Function details:
- The functions are changes of values to wikidata properties as of data that are up to date crawled in the web or gotten from tables.
- New snaks has to be added where those are missing.
- The list of older changes of TaxonBot can you find here: Special:Contributions/TaxonBot
This request has to be made because user:Ymblanter said so. These changes has to be hold up to date, or new snaks have to be set, so I need a flooder flag again and again and again ... and again. All the tasks cannot be made at once, but it will be done time to time, also fulfilling bot requests on German Wikipedia relating to Wikidata.
I also am working together with my colleague user:Queryzo who is requesting a flooder flag right now. He is working with infoboxes, too, to get data from wikidata fulfilling them into dewiki movie infoboxes. Give him the flooder flag, it's okay, or better a bot flag.
I also run de:user:TaxonBot, de:user:TaxonKatBot, de:user:TaxonBota, hsb:user:TaxonBot and some more around the clock with bot flag, so I have IMHO enough experience to fulfill the jobs mentioned above here in wikidata, relating to my good old flooder flag times here.
Thank you very much, -- Doc Taxon (talk) 00:23, 16 December 2016 (UTC)[reply]
- I am going to approve the bot in a couple of days provided there have been no objections.--Ymblanter (talk) 19:54, 20 December 2016 (UTC)[reply]