tAdd more film stocks and add today's price state - filmtools - various tools f… | |
git clone git://src.adamsgaard.dk/filmtools | |
Log | |
Files | |
Refs | |
--- | |
commit 3df21184b1937f8571f7c240f739210c749c3f96 | |
parent c2f50ac99f0e30f982b49baed8cc2819627277ec | |
Author: Anders Damsgaard <[email protected]> | |
Date: Sat, 18 Apr 2020 15:39:00 +0200 | |
Add more film stocks and add today's price state | |
Diffstat: | |
M filmprice.sh | 67 ++++++++++++++++++++++-------… | |
A filmprice_2020-04-18 | 44 +++++++++++++++++++++++++++++… | |
2 files changed, 92 insertions(+), 19 deletions(-) | |
--- | |
diff --git a/filmprice.sh b/filmprice.sh | |
t@@ -29,7 +29,7 @@ fotoimpex_path() { | |
fuji-fujicolor-c200) | |
printf '%s-135-36-single-pack.html' "$… | |
kodak-t-max-p3200) | |
- printf '%s-tmz-35mm-film.html' "$1";; | |
+ printf '%s-tmz-35-mm-film.html' "$1";; | |
kodak-portra-400|rollei*) | |
printf '%s-135-36.html' "$1";; | |
kodak-ektar-100) | |
t@@ -62,6 +62,10 @@ fotoimpex_url() { | |
printf 'https://www.fotoimpex.com/films/%s\n' "$(fotoimpex_path "$1" "… | |
} | |
+macodirect_url() { | |
+ printf 'https://www.macodirect.de/en/film/%s\n' "$(fotoimpex_path "$1"… | |
+} | |
+ | |
fotoimpex_extract_price() { | |
if grep -qE 'From *10' "$1"; then | |
if grep -qE 'From *5' "$1"; then | |
t@@ -98,7 +102,7 @@ get_html() { | |
else | |
die 'no suitable html fetcher found' | |
fi | |
- sleep 2 | |
+ sleep 1 | |
if [ $? -ne 0 ]; then | |
return 1 | |
fi | |
t@@ -108,6 +112,45 @@ eur_to_dkk() { | |
printf '%.2f' "$(printf '%s*7.46\n' "$1" | bc -l)" | |
} | |
+fotoimpex() { | |
+ out="fotoimpex_${1}_${2}.html" | |
+ url="$(fotoimpex_url "$1" "$2")" | |
+ if [ ! -e "$out" ]; then | |
+ if ! get_html "$url" > "$out"; then | |
+ rm -f "$out" | |
+ fi | |
+ fi | |
+ if [ -e "$out" ]; then | |
+ price="$(fotoimpex_extract_price "$out" "$2")" | |
+ if [ ! "$price" = "-- --" ]; then | |
+ printf '%-24s\t%s\t' "$1" "$2" | |
+ printf '%s\tEUR\t' "$price" | |
+ printf '%s\tDKK\t' "$(eur_to_dkk "$price")" | |
+ printf '%s\n' "$url" | |
+ fi | |
+ fi | |
+} | |
+ | |
+macodirect() { | |
+ out="macodirect_${1}_${2}.html" | |
+ url="$(macodirect_url "$1" "$2")" | |
+ if [ ! -e "$out" ]; then | |
+ if ! get_html "$url" > "$out"; then | |
+ rm -f "$out" | |
+ fi | |
+ fi | |
+# if [ -e "$out" ]; then | |
+# price="$(macodirect_extract_price "$out" "$2")" | |
+# if [ ! "$price" = "-- --" ]; then | |
+# printf '%-24s\t%s\t' "$1" "$2" | |
+# printf '%s\tEUR\t' "$price" | |
+# printf '%s\tDKK\t' "$(eur_to_dkk "$price")" | |
+# printf '%s\n' "$url" | |
+# fi | |
+# fi | |
+} | |
+ | |
+ | |
film_products="ilford-delta-100 | |
ilford-delta-400 | |
ilford-pan-f | |
t@@ -118,7 +161,7 @@ fuji-fujicolor-c200 | |
fuji-pro-400-h | |
kodak-t-max-100 | |
kodak-t-max-400 | |
-kodak-t-max-p3200-tmz-35mm-film | |
+kodak-t-max-p3200 | |
kodak-tri-x-400 | |
kodak-ektar-100 | |
kodak-portra-160 | |
t@@ -135,21 +178,7 @@ film_formats="135 | |
for p in $film_products; do | |
for f in $film_formats; do | |
- out="${p}_${f}.html" | |
- url="$(fotoimpex_url "$p" "$f")" | |
- if [ ! -e "$out" ]; then | |
- if ! get_html "$url" > "$out"; then | |
- rm -f "$out" | |
- fi | |
- fi | |
- if [ -e "$out" ]; then | |
- price="$(fotoimpex_extract_price "$out" "$f")" | |
- if [ ! "$price" = "-- --" ]; then | |
- printf '%-24s\t%s\t' "$p" "$f" | |
- printf '%s\tEUR\t' "$price" | |
- printf '%s\tDKK\t' "$(eur_to_dkk "$price")" | |
- printf '%s\n' "$url" | |
- fi | |
- fi | |
+ fotoimpex "$p" "$f" | |
+ macodirect "$p" "$f" | |
done | |
done | |
diff --git a/filmprice_2020-04-18 b/filmprice_2020-04-18 | |
t@@ -0,0 +1,44 @@ | |
+ilford-delta-100 135 6.60 EUR 49.24 … | |
+ilford-delta-100 120 5.65 EUR 42.15 … | |
+ilford-delta-100 4x5 58.20 EUR 434.17 … | |
+ilford-delta-100 30.5m 4.99 EUR 37.23 … | |
+ilford-delta-400 135 6.60 EUR 49.24 … | |
+ilford-delta-400 120 5.65 EUR 42.15 … | |
+ilford-delta-400 30.5m 4.99 EUR 37.23 … | |
+ilford-pan-f 135 7.10 EUR 52.97 … | |
+ilford-pan-f 120 6.10 EUR 45.51 … | |
+ilford-fp4 135 5.90 EUR 44.01 … | |
+ilford-fp4 120 4.90 EUR 36.55 … | |
+ilford-fp4 4x5 51.20 EUR 381.95 … | |
+ilford-fp4 30.5m 4.84 EUR 36.11 … | |
+ilford-hp5 135 5.60 EUR 41.78 … | |
+ilford-hp5 120 4.90 EUR 36.55 … | |
+ilford-hp5 4x5 50.20 EUR 374.49 … | |
+ilford-hp5 30.5m 4.42 EUR 32.97 … | |
+fuji-neopan-acros-ii-neu-100 135 12.95 EUR 96.61 … | |
+fuji-fujicolor-c200 135 2.99 EUR 22.31 … | |
+fuji-pro-400-h 135 9.90 EUR 73.85 … | |
+fuji-pro-400-h 120 8.15 EUR 60.80 … | |
+kodak-t-max-100 135 7.10 EUR 52.97 … | |
+kodak-t-max-100 120 7.10 EUR 52.97 … | |
+kodak-t-max-400 135 8.00 EUR 59.68 … | |
+kodak-t-max-400 120 7.10 EUR 52.97 … | |
+kodak-t-max-p3200 135 9.80 EUR 73.11 … | |
+kodak-tri-x-400 135 7.50 EUR 55.95 … | |
+kodak-tri-x-400 120 8.20 EUR 61.17 … | |
+kodak-tri-x-400 30.5m 9.95 EUR 74.23 … | |
+kodak-ektar-100 135 9.00 EUR 67.14 … | |
+kodak-ektar-100 120 6.80 EUR 50.73 … | |
+kodak-portra-160 135 9.10 EUR 67.89 … | |
+kodak-portra-160 120 9.25 EUR 69.00 … | |
+kodak-portra-400 135 9.55 EUR 71.24 … | |
+kodak-portra-400 120 9.00 EUR 67.14 … | |
+kodak-portra-800 135 12.60 EUR 94.00 … | |
+kodak-portra-800 120 11.70 EUR 87.28 … | |
+rollei-rpx-25 135 5.49 EUR 40.96 … | |
+rollei-rpx-25 120 5.00 EUR 37.30 … | |
+rollei-rpx-100 135 4.75 EUR 35.44 … | |
+rollei-rpx-100 120 5.15 EUR 38.42 … | |
+rollei-rpx-400 135 4.70 EUR 35.06 … | |
+rollei-rpx-400 120 5.15 EUR 38.42 … | |
+rollei-rpx-400 30.5m 3.29 EUR 24.54 … |