Skip to content

Instantly share code, notes, and snippets.

@magnusmanske
Created November 21, 2014 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magnusmanske/b5206189753ce2fb66ee to your computer and use it in GitHub Desktop.
Save magnusmanske/b5206189753ce2fb66ee to your computer and use it in GitHub Desktop.
MrMetadata: Get top 50 templates in failing files (example run in wikipedia/de; change path and replace "Datei" and "dewiki" for other languages)
( echo -n 'SELECT tl_title,count(*) AS cnt FROM page,templatelinks WHERE tl_from=page_id AND page_namespace=6 and page_title IN ("' ; cat *.html | grep 'Datei:' | sed -r 's|</a>.*||' | sed -r 's|^.+>Datei:||' | grep -v '"' | sed 's| |_|g' | sed ':a;N;$!ba;s/\n/","/g' ; echo -n '") GROUP BY tl_title ORDER BY cnt DESC' ) | sql dewiki_p | head -50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment