Skip to content

Instantly share code, notes, and snippets.

@HairyFotr
Created August 1, 2014 20:45
Show Gist options
  • Save HairyFotr/504314ada36d9dda6f7f to your computer and use it in GitHub Desktop.
Save HairyFotr/504314ada36d9dda6f7f to your computer and use it in GitHub Desktop.
readWeather
#!/bin/bash
#usage: readWeather [IMAGE URL or FILE]
#example: readWeather http://www.eurometeo.com/english/meteomed/img_014M
#dependencies: wget, imagemagick, tesseract-ocr
pic="$(mktemp)"
if [[ "$1" == http:* ]] || [[ "$1" == https:* ]]; then wget -q -O "$pic" "$1"; else cp "$1" "$pic"; fi
convert "$pic" -scale 252%x266% -fill grey61 -fuzz 39% -floodfill 75%x75% grey10 -fuzz 53% -trim -brightness-contrast 0x-10 -fill gray4 -adaptive-sharpen 1x0.73 -swirl 0.52 -swirl 0.11 -solarize 14% -white-threshold 75% -negate "$pic" &&
tesseract "$pic" stdout
rm "$pic"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment