User:BryceHarrington/Code examples 1

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>MZMcBride at 01:22, 29 August 2013 (bug!). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code Examples:

Hmm, good idea. Here's code to do it:

First thing, nuke all the empty pages that just say "Describe the new page..."

mkdir /tmp/emptypages
cd [....]/wiki/lib-http/db/wiki/html
for file in `find . -type f -size -1400c ! -name '*["]*' -print | xargs grep 'Describe the new page here.' | cut -d: -f1`; do mv $file /tmp/emptypages; done

Review and delete the stuff in /tmp/emptypages at your convenience.

Now for the fun part

cd [....]/wiki/lib-http/db/wiki/html
for file in `find . -type f -size -1800c -print`; do ls -ol $file; done

This one gets a listing of all the pages which have fewer than about 500 characters worth of content. Knock the number up or down depending on where you wish to draw the line.

-- BryceHarrington