This is already done, but it is made by comparison of page title and category title. This should be handled using Wikidata
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
[IMPR] Move main categories to top in cc | pywikibot/core | master | +81 -36 |
Related Objects
Related Objects
- Mentioned Here
- T100265: Implement collation-aware sorting
Event Timeline
Comment Actions
I found the script, but the author of code was @Ladsgroup
#!/usr/bin/python #coding: utf-8 import wikipedia, codecs, re site = wikipedia.getSite("cs") f = codecs.open("cswiki.txt","r","utf-8") rer = re.compile("\[\[(.+?)\]\]") aaa = rer.findall(f.read()) f.close() excludes = [u'{{Rozcestník',u'{{rozcestník',u'{{Přesměrování'] for name in aaa: page = wikipedia.Page(site,name) try: text = page.get() except: continue ok = True for exclude in excludes: if exclude in text: ok = False if not ok: continue new_text = re.sub(u"\[\[Kategorie\:%s(\|.*?)? *?]]" % re.escape(page.title()),"",text) add_text = u"[[Kategorie:%s| ]]" % page.title() if u"\n[[Kategorie" in new_text: new_text = new_text.replace(u"\n[[Kategorie",add_text+u"\n[[Kategorie",1) else: new_text += add_text if new_text!= text: page.put(new_text, u"Hlavní kategorie: jako první, řadicí klíč")
Comment Actions
Change 434997 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [IMPR] Move main categories to top in cc
Comment Actions
Change 434997 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Move main categories to top in cc