Jump to content

Wikipedia talk:WikiProject Mountains/List of mountain ranges

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Re-generating the list

[edit]

For those who cannot use AutoWikiBrowser, using the "What links here" link in the toolbox menu on the left hand side, works just as well, although requires a number of manual steps.

[edit]

First, you will need to install the Pywikipedia robot framework in order to quickly extract the links into a format that can be posted into the article.

  1. Get the list of links to {{Infobox mountain range}} by clicking the following link (if you are using tabs in Firefox, you might want to use the key combination to open the link in a new tab).
    http://en.wikipedia.org/w/index.php?title=Special:Whatlinkshere/Template:Infobox_mountain_range&limit=5000&namespace=0
  2. Save the page as a local file (In Firefox, select "Save Page As..." from the File menu).
  3. When there are more than 5,000 articles linking to the template, click the "Next 5,000 links" and save as a local file as well using a different name.
  4. Run the extract_wikilinks.py script in the Pywikipedia framework, giving it the name of the files you saved the pages under in the previous steps. Make sure you redirect the output to a file.
    python extract_wikilinks.py links_a.txt > links2.txt
    python extract_wikilinks.py links_b.txt >> links2.txt
  5. Sort the file and redirect the output to another file (if you have a Unix based system such as Mac OS X or Linux, use the "sort" command).
    sort -k 3 links2.txt > links_sorted.txt
  6. There are probably duplicate lines output by "What links here" so you can use the "uniq" Unix command to remove them.
    uniq links_sorted.txt links_unique.txt
  7. Edit the file and remove any common site links as well as any pages in the Wikipedia, talk and user name spaces.
  8. Add a "# " to the start of each line. Again, if you have a Unix based system, you can use "vi" to do this: %s/^/# /
  9. Copy and paste the updated list into the List of mountain ranges.