installed_progs.t: Python checks stdout too, 150 ok
[sunny256-utils.git] / wikipedia-export
blobfba0f70d304976c02da98f5652e175f546484294
1 #!/usr/bin/env bash
3 #=======================================================================
4 # wikipedia-export
5 # File ID: a7ef1800-5d49-11df-a875-90e6ba3022ac
6 # Exports a Wikipedia article as XML.
8 # Newest version available from
9 # http://svn.sunbase.org/repos/utils/trunk/wikipedia-export
11 # This complicated piece of software is licensed under the GNU General
12 # Public License version 2 or later.
13 # Made by Øyvind A. Holm <sunny@sunbase.org>.
14 #=======================================================================
16 curonly='&curonly=true'
17 [ "$1" = "-a" ] && { unset curonly; shift; }
19 if [ "$2" = "" ]; then
20 echo Syntax: $0 [-a] language_prefix \'article_name\'
21 echo
22 echo If -a is specified as the first parameter, all revisions are downloaded.
23 exit 1
26 wget -O "$1.$2.xml" http://$1.wikipedia.org/wiki/Special:Export?action=submit$curonly\&pages=$2
28 # This program is free software; you can redistribute it and/or modify it
29 # under the terms of the GNU General Public License as published by the
30 # Free Software Foundation; either version 2 of the License, or (at your
31 # option) any later version.
33 # This program is distributed in the hope that it will be useful, but
34 # WITHOUT ANY WARRANTY; without even the implied warranty of
35 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36 # See the GNU General Public License for more details.
38 # You should have received a copy of the GNU General Public License along
39 # with this program; if not, write to the Free Software Foundation, Inc.,
40 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA