summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README3
1 files changed, 3 insertions, 0 deletions
diff --git a/README b/README
index 5f4302c..da044bf 100644
--- a/README
+++ b/README
@@ -8,6 +8,9 @@ the following locales:
* danish (da) by Jonas Smedegaard <dr@jones.dk>
+Additionally, the configuration has been simplified to not mention non-Git VCS
+systems, and deprecated placeholder files has been removed from basewiki.
+
Getting the source
------------------
;;
  • via)
  • if [ $viacount -gt 0 ]; then
  • eval lastviabuffer=\"\${$word$viacount}\"
  • if [ -z "$lastviabuffer" ]; then
  • echo >&2 "ERROR: Empty via directive."
  • exit 1
  • fi
  • fi
  • viacount="$(($viacount+1))"
  • buffer="$word$viacount"
  • eval $buffer=
  • ;;
  • rejse|st|st.|station)
  • ;;
  • *)
  • case "$buffer" in
  • from|to|via[123])
  • eval $buffer=\"\${$buffer:+\$$buffer+}$word\"
  • ;;
  • *)
  • if [ -z "$from" ]; then
  • from="$word"
  • elif [ -z "$to" ]; then
  • to="$word"
  • else
  • echo >&2 "ERROR: More than 2 cities mentioned or missing from/to/via directive."
  • exit 1
  • fi
  • esac
  • ;;
  • esac
  • done
  • # FIXME: Handle more than a single via directive
  • if [ -n "$from" ] && [ -n "$to" ] && [ $viacount -gt 0 ]; then
  • url="http://www.rejseplanen.dk/bin/query.exe/mn?queryPageDisplayed=yes&S=$from+station&SBHF=2&Z=$to+station&ZBHF=2&V1=$via1+station&wai=yes&start=Find+rejse&start=Find+rejse"
  • elif [ -n "$from" ] && [ -n "$to" ]; then
  • url="http://www.rejseplanen.dk/bin/query.exe/mn?queryPageDisplayed=yes&S=$from+station&SBHF=2&Z=$to+station&ZBHF=2&wai=yes&start=Find+rejse&start=Find+rejse"
  • else
  • echo >&2 "ERROR: Too few cities, or missing from/to/via directive."
  • exit 1
  • fi
  • wget -O- "$(urlencode "$url")" \
  • | html2text -nobs -width 9999 \
  • | grep '^Din afrejse' | sed -e 's/Din afrejse fra/Afr./' -e 's/Din ankomst til/Ank./' -e 's/ er \(den [0-9.]\+ \)\?kl. / kl. /' -e 's/ er i spor / spor /'
  • ;;
  • benzin|benzinpris|diesel|dieselpris)
  • # Set defaults based on app name
  • case "$app" in
  • diesel*) flavor="diesel";;
  • fyr*|olie) flavor="olie";;
  • *) flavor="95";;
  • esac
  • # Resolve options
  • for word in "$@"; do
  • case "$word" in
  • 92|95|98|diesel|olie|fyringsolie) flavor="$word";;
  • [[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]]) site="$word";;
  • for|i|oktan|pris|amt) ;;
  • *) county="$word";;
  • esac
  • shift
  • done
  • case "$flavor" in
  • 92) flavorid=1;;
  • 95) flavorid=2;;
  • 98) flavorid=3;;
  • diesel) flavorid=6;;
  • olie|fyringsolie) flavorid=7;;
  • esac
  • case "$county" in
  • bornh*) countyid=1;;
  • frederiksborg) countyid=3;;
  • fyn) countyid=4;;
  • nordj*) countyid=6;;
  • ribe) countyid=7;;
  • ringk*) countyid=8;;
  • rosk*) countyid=9;;
  • k?benh*|stork*) countyid=5;;
  • storstr*) countyid=10;;
  • s?nderj*) countyid=11;;
  • vejle) countyid=12;;
  • vestsj*) countyid=13;;
  • viborg) countyid=14;;
  • ?rhus|aarhus) countyid=15;;
  • esac
  • # Lookup and compress results
  • if [ -n "$site" ]; then
  • wget -O- "http://www.fdmbenzinpriser.dk/wap/ShowStation.aspx?StationID=$site" | html2text -nobs -width 9999
  • elif [ -n "$countyid" ]; then
  • wget -O- "http://www.fdmbenzinpriser.dk/wap/AmtpriserPriceList.aspx?OctaneID=$flavorid&AmtID=$countyid" | html2text -nobs -width 9999
  • else
  • wget -O- "http://www.fdmbenzinpriser.dk/wap/Landspriser.aspx?ID=$flavorid" | html2text -nobs -width 9999
  • fi
  • ;;
  • esac