Bythmusters
Joined 18 November 2025
Bythmusters (talk | contribs) m fixed code block |
Bythmusters (talk | contribs) m ce |
||
| Line 27: | Line 27: | ||
! colspan="2" |[[Special:Statistics|<big>Statistics</big>]] | ! colspan="2" |[[Special:Statistics|<big>Statistics</big>]] | ||
|} | |} | ||
Redirect cleanup: [[Special:DoubleRedirects|Double redirects]], [[Special:BrokenRedirects|broken redirects]] | |||
It's 2026, who isn't using https-only? [https://consumerrights.wiki/w/Special:LinkSearch?target=http%3A%2F%2F*&namespace= Turn http links to https] | It's 2026, who isn't using https-only? [https://consumerrights.wiki/w/Special:LinkSearch?target=http%3A%2F%2F*&namespace= Turn http links to https] | ||
Search queries are a good way to find articles that have starter text: [https://consumerrights.wiki/index.php?search=%5BIncident%5D&title=Special%3ASearch&wprov=acrw1_-1 <nowiki>Pages containing [Incident]</nowiki>] | Search queries are a good way to find articles that have starter text or broken elements: [https://consumerrights.wiki/index.php?search=%5BIncident%5D&title=Special%3ASearch&wprov=acrw1_-1 <nowiki>Pages containing [Incident]</nowiki>] | ||
Also template search, pages with: [https://consumerrights.wiki/index.php?title=Special:WhatLinksHere/Template:InfoboxCompany&limit=500 InfoboxCompany] [https://consumerrights.wiki/w/Special:WhatLinksHere?target=Template%3AInfoboxProductLine&namespace=&limit=50 InfoboxProductLine] (mostly gone) | Also template search, pages with: [https://consumerrights.wiki/index.php?title=Special:WhatLinksHere/Template:InfoboxCompany&limit=500 InfoboxCompany] [https://consumerrights.wiki/w/Special:WhatLinksHere?target=Template%3AInfoboxProductLine&namespace=&limit=50 InfoboxProductLine] (mostly gone) | ||
Scroll through every page at once by namespace: [[Special:AllPages]] | Scroll through every page at once by namespace: [[Special:AllPages]] | ||
== Finding articles without certain templates == | ==Finding articles without certain templates== | ||
As of 1/31/26, I am trying to find articles which are missing any of the four [[Help:Templates#Cargo|cargo templates]]. I have manually scraped the list of pages with certain templates copying lists from[[Special:WhatLinksHere]] and all pages in the main namespace (excluding redirects) from [[Special:AllPages]] into text documents. Using these lists, you can run a basic Python script and count how many lists each page is present in. Any page found in only 1 list must have no cargo templates, any page found in 2 lists has one cargo template, any pages with 3-5 lists has several cargo templates. | As of 1/31/26, I am trying to find articles which are missing any of the four [[Help:Templates#Cargo|cargo templates]]. I have manually scraped the list of pages with certain templates copying lists from [[Special:WhatLinksHere]] and all pages in the main namespace (excluding redirects) from [[Special:AllPages]] into text documents. Using these lists, you can run a basic Python script and count how many lists each page is present in. Any page found in only 1 list must have no cargo templates, any page found in 2 lists has one cargo template, any pages with 3-5 lists has several cargo templates. | ||
I am not an advanced programmer but here is my script: | I am not an advanced programmer but here is my script: | ||
<nowiki># these files all generated 1/30/26 21 UTC | <nowiki># these files all generated 1/30/26 21 UTC | ||
# generate list of filepaths to be read | # generate list of filepaths to be read | ||
filenames = ["allpages.txt", "company.txt", "incident.txt", "productline.txt", "product.txt"] | filenames = ["allpages.txt", "company.txt", "incident.txt", "productline.txt", "product.txt"] | ||
pathprefix = "[your-path-here]" | pathprefix = "[your-path-here]" | ||
filepaths = [] | filepaths = [] | ||
for x in filenames: | for x in filenames: | ||
filepaths.append(pathprefix + x) | |||
# print(filepaths) | # print(filepaths) | ||
# read files line-by-line, sanitize lines, and count in dictionary | # read files line-by-line, sanitize lines, and count in dictionary | ||
match = " (transclusion) (← links | edit)" | match = " (transclusion) (← links | edit)" | ||
table = {} # String to Int: line, count | table = {} # String to Int: line, count | ||
for x in filepaths: | for x in filepaths: | ||
with open(x, "r") as file: # auto closes file | |||
content = file.read() | |||
lines = content.split('\n') | |||
for line in lines: | |||
line = line.replace(match, "") | |||
# print(line) | |||
if line in table: | |||
table[line] += 1 | |||
else: | |||
table[line] = 1 | |||
# print(table) | # print(table) | ||
# read unsorted dict and sort into new dict with count as key | # read unsorted dict and sort into new dict with count as key | ||
sortedtable = {} # Int to List[String]: count, lines | sortedtable = {} # Int to List[String]: count, lines | ||
for pair in table.items(): | for pair in table.items(): | ||
line = pair[0] | |||
count = pair[1] | |||
if count in sortedtable: | |||
sortedtable[count].append(line) | |||
else: | |||
sortedtable[count] = [line] | |||
print("#####Only in AllPages#####") | print("#####Only in AllPages#####") | ||
for x in sortedtable[1]: | for x in sortedtable[1]: | ||
print(x)</nowiki> | |||
Then a list can be displayed or saved with Bash: <code>python3 table.py | less</code> | Then a list can be displayed or saved with Bash: <code>python3 table.py | less</code> | ||