diff -Nru wikipedia2text-0.11/debian/changelog wikipedia2text-0.12/debian/changelog --- wikipedia2text-0.11/debian/changelog 2016-05-06 00:10:42.000000000 +0000 +++ wikipedia2text-0.12/debian/changelog 2016-06-19 16:08:53.000000000 +0000 @@ -1,3 +1,12 @@ +wikipedia2text (0.12-1) unstable; urgency=medium + + * Fix link path in debian/watch file and massively simplify it. + * Import new upstream release. + + Update man page wrt. to new options. + * Switch Homepage URL from http:// to https://. (Suggested by DUCK.) + + -- Axel Beckert Sun, 19 Jun 2016 18:08:53 +0200 + wikipedia2text (0.11-6) unstable; urgency=medium * Replace dependency on lynx-cur with lynx. diff -Nru wikipedia2text-0.11/debian/control wikipedia2text-0.12/debian/control --- wikipedia2text-0.11/debian/control 2016-05-06 00:09:20.000000000 +0000 +++ wikipedia2text-0.12/debian/control 2016-06-19 15:54:39.000000000 +0000 @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 9~) Build-Depends-Indep: docbook-to-man Standards-Version: 3.9.8 -Homepage: http://blog.256bit.org/archives/126-Wikipedia-in-der-Shell.html +Homepage: https://blog.256bit.org/archives/126-Wikipedia-in-der-Shell.html Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/wikipedia2text.git Vcs-Git: https://anonscm.debian.org/git/collab-maint/wikipedia2text.git diff -Nru wikipedia2text-0.11/debian/watch wikipedia2text-0.12/debian/watch --- wikipedia2text-0.11/debian/watch 2015-04-27 19:15:26.000000000 +0000 +++ wikipedia2text-0.12/debian/watch 2016-06-19 15:44:25.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)[\-\.]?\d*)$/$1~$2/,dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \ -https://github.com/chrisbra/wikipedia2text/releases (?:.*/)?wikipedia2text[_\-\.]?(\d\S*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) +https://github.com/chrisbra/wikipedia2text/releases /chrisbra/wikipedia2text/archive/(.*)\.tar\.gz diff -Nru wikipedia2text-0.11/debian/wikipedia2text.sgml wikipedia2text-0.12/debian/wikipedia2text.sgml --- wikipedia2text-0.11/debian/wikipedia2text.sgml 2015-04-26 23:58:44.000000000 +0000 +++ wikipedia2text-0.12/debian/wikipedia2text.sgml 2016-06-19 16:07:42.000000000 +0000 @@ -70,6 +70,7 @@ patt lang base-url + "browser options" Query @@ -262,6 +263,17 @@ term. + + + browser-options + + pass through + browser-options to browser, + e.g. "-width 180". (Warning: must be in quotes if multiple + options should be passed; browser specific, not + checked.) + + diff -Nru wikipedia2text-0.11/README.md wikipedia2text-0.12/README.md --- wikipedia2text-0.11/README.md 1970-01-01 00:00:00.000000000 +0000 +++ wikipedia2text-0.12/README.md 2016-05-31 20:41:48.000000000 +0000 @@ -0,0 +1,17 @@ +#wikipedia2text +>A Shell script to query the Wikipedia. + +This script fetches Wikipedia articles (currently supports around 30 +Wikipedia languages) and displays them as plain text in a pager or +just sends the text to standard out. Alternatively it opens the +Wikipedia article in a (possibly GUI) web browser or just shows the +URL of the appropriate Wikipedia article. + +###Installation +copy wikipedia2text into your $PATH + +alternatively, on debian or derivitatives, you can install it using your +packages manager: `sudo apt-get install wikipedia2text` + +###License & Copyright +© Christian Brabandt, License: BSD diff -Nru wikipedia2text-0.11/wikipedia2text wikipedia2text-0.12/wikipedia2text --- wikipedia2text-0.11/wikipedia2text 2009-07-25 20:59:23.000000000 +0000 +++ wikipedia2text-0.12/wikipedia2text 2016-05-31 20:41:48.000000000 +0000 @@ -2,14 +2,12 @@ # # Shell script to query the Wikipedia. # -# It can be used to output Wikipedia articles to the console, but can also +# It can be used to output Wikipedia articles to the console, but can also # just open the article in any browser. # # Author: Christian Brabandt # License: BSD - -VERSION=0.11 -# SVN-ID: $Id: wikipedia2text 31 2009-07-21 15:42:44Z cb $: +VERSION=0.12 set -e @@ -19,31 +17,33 @@ This script uses text-browser to query and render Wikipedia articles. The output will be printed to standard out. - + SYNOPSIS - `basename $0` [-BCnNoOpPsSuU] [-b prog] [-c patt] [-i patt] [-l lang] query + `basename $0` [-BCnNoOpPsSuU] [-b prog] [-c patt] [-i patt] [-l lang] [-X browseroptions] query `basename $0` -o [-b prog] [-l lang] query `basename $0` [-h] `basename $0` -v|-r - + -n do not colorize -N simple colorization (alias -C) -p display using a pager -P don't use pager -o open Wikipedia article in browser -O don't open in browser -s display only a summary -S display whole article -u Just output the query URL -U open URL in browser - -v display version -h display help + -v display version -h display help - -r open Random Page - -i patt colorize pattern (case insensitive) - -I patt colorize pattern (case-sensitive, alias -c) - -b prog use prog as browser (by default to invoke elinks, links2, - links, lynx or w3m, if found) - -l lang use language (currently supported are: af, als, ca, cs, da, - de, en, eo, es, fi, fr, hu, ia, is, it, la, lb, nds, nl, nn, - no, pl, pt, rm, ro, simple, sk, sl, sv, tr) - -W url use url as base-URL for wikipedia (e.g. use a different - Wiki, Querying this URL will happen by appending the search - term. + -r open Random Page + -i patt colorize pattern (case insensitive) + -I patt colorize pattern (case-sensitive, alias -c) + -b prog use prog as browser (by default to invoke elinks, links2, + links, lynx or w3m, if found) + -l lang use language (currently supported are: af, als, ca, cs, da, + de, en, eo, es, fi, fr, hu, ia, is, it, la, lb, nds, nl, nn, + no, pl, pt, rm, ro, simple, sk, sl, sv, tr) + -W url use url as base-URL for wikipedia (e.g. use a different + Wiki, Querying this URL will happen by appending the search + term. + -X "browseroptions" pass through options to browser, e.g., "-width 180" + (warnings: must be in quotes; browser specific, not checked) Query can be any term to search for at Wikipedia. Special characters will be taken care of. Note that only one query term is @@ -76,7 +76,7 @@ else OUTPUT=$(echo -e "`cat`"|sed -s "s|\(${PATT}\)|\\\033\[0;31m\1\\\033\[0m|g") fi -echo -e "${OUTPUT}" +echo -e "${OUTPUT}" } function uri_decode(){ @@ -84,10 +84,10 @@ } function localize(){ -# Per default we use the english localized version of +# Per default we use the english localized version of # Wikipedia LOCAL=$(echo ${LOCAL:="en"}) -if [ "${LOCAL}" = "de" ]; then +if [ "${LOCAL}" = "de" ]; then #MARKER='Diese Seite' MARKER='^\s*Kategorien\?:' # MARKER='Kategorien:' @@ -242,7 +242,7 @@ # cause this is only the linkdump SED='sed -e "s|\\[[0-9]*\\]||g" -e "s|\\[IMG\\]||g" -e "/${MARKER}/,$ D" ' -if [ -n "${MARKER2}" ]; then +if [ -n "${MARKER2}" ]; then echo "`cat`"| eval ${SED} -e '"s#\[${MARKER2}\]##g"' else echo "`cat`"| eval ${SED} @@ -255,33 +255,33 @@ function summary(){ if [ "${COLOR}" = "true" ]; then - "${BROWSER}" -dump "${URL}" |grep -v copyright | head -n 22 \ - | tail -n 17 |stripOutput | colorize + summaryCommand="${BROWSER} ${BROWSEROPTIONS} -dump ${URL} |grep -v copyright | head -n 22 | tail -n 17 |stripOutput | colorize" else - "${BROWSER}" -dump "${URL}" |grep -v copyright | head -n 22 \ - | tail -n 17 | stripOutput + summaryCommand="${BROWSER} ${BROWSEROPTIONS} -dump ${URL} |grep -v copyright | head -n 22 | tail -n 17 | stripOutput" fi + eval ${summaryCommand} } function getInfo(){ #LINES=$("${BROWSER}" -dump "${URL}" |wc -l) #LINES=$(expr ${LINES} - 6) if [ "${COLOR}" = "false" ]; then - #"${BROWSER}" -dump "${URL}"| tail -n ${LINES} |stripOutput - "${BROWSER}" -dump "${URL}"| stripOutput + #"${BROWSER}" "${BROWSEROPTIONS}" -dump "${URL}"| tail -n ${LINES} |stripOutput + getInfoCommand="${BROWSER} ${BROWSEROPTIONS} -dump ${URL} | stripOutput" else - "${BROWSER}" -dump "${URL}"| stripOutput |colorize + getInfoCommand="${BROWSER} ${BROWSEROPTIONS} -dump ${URL} | stripOutput |colorize" fi + eval ${getInfoCommand} } -# First read in the Run configuration File, if one is found +# First read in the Run configuration File, if one is found if [ -r ~/.`basename $0`rc ]; then source ~/.`basename $0`rc ABROWSER=${BROWSER} fi # Process commandline parameters -while getopts "BCnNoOpPsSuvhrUl:b:c:i:B:W:" ARGS +while getopts "BCnNoOpPsSuvhrUl:b:c:i:B:W:X:" ARGS do case ${ARGS} in b) ABROWSER=${OPTARG} ;; @@ -304,6 +304,7 @@ U) OPENURL="true";; v) getVersion; exit 0 ;; W) WURL=${OPTARG} ;; + X) BROWSEROPTIONS=${OPTARG} ;; h) display_help; exit 0 ;; *) display_help; exit 1 ;; esac @@ -341,17 +342,15 @@ URL="$*" fi - - # Check for Alternative Browser if [ -n "${ABROWSER}" -o "${BROWSER}" ]; then - BROWSER=$(which "${ABROWSER}") || errorExit "${ABROWSER} not found" + BROWSER=$(which "${ABROWSER}") || errorExit "${ABROWSER} not found" else - { BROWSER=$(which w3m) || - BROWSER=$(which elinks) || - BROWSER=$(which links2) || - BROWSER=$(which lynx) || - BROWSER=$(which links.main) || + { BROWSER=$(which w3m) || + BROWSER=$(which elinks) || + BROWSER=$(which links2) || + BROWSER=$(which lynx) || + BROWSER=$(which links.main) || BROWSER=$(which links) ; } || errorExit "No Browser found" fi @@ -372,7 +371,7 @@ if [ "${RAND}" = "true" ]; then ARGUMENT="$(uri_decode "${RANDOMP}")" fi -if [ -z "${URL}" ]; then +if [ -z "${URL}" ]; then URL="http://${LOCAL}.wikipedia.org/wiki/${ARGUMENT}" fi; @@ -392,20 +391,21 @@ # Depending on some Variables, we do some different things here if [ "${USEBROWSER}" = "true" ]; then - openurl + openurl exit 0; fi if [ "${SHORT}" = "true" ]; then - summary + summary exit 0; fi if [ "${OUTPUTURL}" = "true" ]; then if [ "${COLOR}" = "false" ]; then - echo "${URL}" + echo "${URL}" + echo "${BROWSER}" "${BROWSEROPTIONS}" -dump "${URL}" else - echo -e "\033[0;34m${URL}\033[0m" + echo -e "\033[0;34m${URL}\033[0m" fi exit 0; fi