Uusi Conky sääscripta (ilmatieteenlaitos.fi)

Onkohan chromesta apua ?

Sillä saa tulostettua DOM-puun tiedostoksi.

google-chrome --headless --disable-gpu --dump-dom http://ilmatieteenlaitos.fi/paikallissaa >saa.html

En jaksanut tutkia enempää itl:n sivuja, mutta siitä saattaa olla apua sinulle.

ja chromium kanssa, ja myös vivaldi!

kiitos, tästä on tosiaan apua; raskas riippuvuus se on, mutta monilla on varmaan joku näistä asennettu.

tutkin nyt myös phantomjs jne.

nettisivu käyttää uudet kuvakkeet, ja ne un numeroitu eri tavalla, jonka takia scripta ei näytä kuvakkeita enää.

kohta tulee kunnon päivistys, mutta tällä saa scriptan taas toimimaan:

#!/bin/bash

path=( "img/fc-img-svg" "img/fc-img-orig" "img/fc-img-alpha80" "img/fc-img-less-alpha80" "img/fc-img-gray" )
sep="________________"

cat <<EOF

Download icons straight from the Finnish Meteorological Insitute's website.
===========================================================================
Apply some conversions.
=======================

Colorful vector icons as seen here: http://ilmatieteenlaitos.fi/saa/helsinki

The SVG icons (unusable by conky) will be downloaded first, then
converted to 4 different 60px PNG icon sets:
    - original
    - original, 80% opacity
    - 90% brightness, 90% saturation, 80% opacity
    - 70% brightness, 0% saturation, 100% opacity

It is best if you call this script from the base directory of the
conky-itl-weather repository. Make sure you have write permissions for the 
present working directory.

Requirements: wget for downloading, imagemagick (convert) for all conversions.

EOF

read -p "Press <Enter> to continue... "

! which wget >/dev/null 2>&1 && echo "Could not find wget in PATH. No downloading. :(" && exit 1

i=0
mkdir -vp "${path[i]}" || exit 1
printf "\nThe vector icon set is now downloaded to %s\n" "${path[i]}"

for ((c=0 ; c<200 ; c++)); do
	wget -O "${path[i]}/$c.svg" https://cdn.fmi.fi/symbol-images/smartsymbol/p/$c.svg >/dev/null 2>&1
	printf '.'
done
printf "\n"
# delete all the empty files wget produced.
find "${path[i]}" -maxdepth 1 -empty -type f -delete

! which convert >/dev/null 2>&1 && echo "Could not find convert (imagemagick) in PATH. No conversion. :(" && exit 1

for (( i=1 ; i<${#path[@]} ; i++ )); do
	printf "\nCreating directory ${path[i]}\n$sep\n"
	mkdir -p "${path[i]}"

	case $i in
	1)	command="convert -background none -resize 60"
	;;
	2)	command="convert -background none -channel A -evaluate divide 1.25 +channel -resize 60"
	;;
	3)	command="convert -background none -channel A -evaluate divide 1.25 +channel -define modulate:colorspace=HSB -modulate 100,90,90 -resize 60"
	;;
	4)	command="convert -background none -grayscale rec601luma -define modulate:colorspace=HSB -modulate 100,100,70 -resize 60"
	;;
	esac
	printf "\nUsing command \n$command\nConverting ${path[0]}/*.svg to ${path[i]}/*.png\n$sep\n"; 
	for file in "${path[0]}"/*.svg; do
		$command "$file" "${file%.*}.png"
	done
	mv "${path[0]}"/*.png "${path[i]}/"
done

printf "\nSuccess! Now you can adjust your config file to include one of:\n"
for (( i=1 ; i<${#path[@]} ; i++ )); do
	echo "FcImgDir=\"${path[i]}\""
done

Kaikki on nyt päivitetty kunnolla, testattu debianilla (stretch) ja Xubuntulla (16.04.3) mun oman archlinux koneen lisäksi.
Olen muuttanut aika paljon, joten kannattaa katsoa vähän tarkemmin jos jotain ei toimi ihan automaattisesti.
Huom: kuvakkeita on nyt pakko ladata itse ilmatieteen laitoksen verkkosivuilta! mutta geticons.sh-scriptan avulla se onnistuu helposti.
kuvakaappaus
https://github.com/ohnonot/conky-itl-weather/

Tästä lähtien projektini löytyvät täältä:
https://notabug.org/ohnonot -
tai täältä:
https://framagit.org/ohnonot (molemmat aina samalla tasolla).

goodbye github!

Hei, ilmeisesti päädyttiin GitHubin käyttäjäksi ja sittemmin GitLabin käyttöliittymää muistuttavaan , mutta Git-keskusteluun heittäisin vielä jotain. Gitea toimii vaikka Raspberry Pi:llä ja siten olisi omassa hallinnassa.

Hieno projekti!

Gitea
https://gitea.io/en-us/
https://docs.gitea.io/en-us/comparison/

Hei, tämä projekti on vielä elossa.
Pahoittelen etten jaksa dokumentoida kaiken kahdella kielellä - tässä englanninkielinen README:


The scripts in this repository will

  • download forecast information for a given location
  • format it according to configuration settings
  • display it in a conky in a separate window (to be executed by a hotkey or menu icon)

Installation

Clone the repository or download the zip to a folder of your choice. Keep in mind that all files need to stay together.

From framagit.org | Download zip file

From notabug.org | Download zip file

Dependencies

For the main script get_weather:

  • jshon, curl, sed (for conky formatted output)

  • bash

  • the coreutils package

  • a conky version with lua support - on Arch Linux this most likely means conky-lua-nv or conky-cairo.
    On other distros, if you’re unsure, look out for a package named conky-all. The script itself doesn’t require conky; its plain text output can be used elsewhere.

  • Some helper scripts have their own dependencies, but they will tell you if something’s missing.

  • yad for location-select (available in most distro repositories)

  • Recommended: the “Roboto Condensed” font, available through most ditributions’ package management.

Quickstart

$ cd /path/to/conky-fmi-weather/
$ ./location-select

Allows you to choose your location & immediately display the forecast window.

If one location is enough, you can start the conky immediately after choosing a location for the first time.

Usage & Configuration

The location and additional stuff can be configured in files/get_weather.d/conf. Please see the output of

$ ./get_weather -h

This script gets weather data from widget.weatherproof.fi/android/androidwidget.php, downloads icons from cdn.fmi.fi/symbol-images/smartsymbol/v31/p, and wind gust data from opendata.fmi.fi.

Most data and files are cached in files/get_weather.d and only re-downloaded when necessary.

Other scripts in this repository

  • The get_location_id bash script will get your location’s id from geonames.org (location-select uses it).
  • The get_weather_opendata bash script is an alternative implementation that uses only data from opendata.fmi.fi.
  • The wfs_describeStoredQueries bash script allows you to get more information about what sort of data you can
    get from opendata.fmi.fi.

All scripts have -h switches for help.

If you experience problems

If you don’t know conky, check this out first.

  • It might be a network problem.
  • make sure the shell scripts are executable:
    chmod +x ./get_* (this normally shouldn’t be an issue).
  • Have a look at the lua templates in files (used by ./get_weather to create conky-readable output).
  • for personal changes to the templates copy them to e.g. *.my.lua first, and remember to refer to them as such when calling the script, e.g.: ./get_weather -f my.lua
  • Take a look inside files/get_weather.d; all files therein can be deleted if they’re corrupt.
  • This is old info now: I have not been able to test on a conservative distro. There were some changes recently to how conky/lua deals with SVG files, and I had to fix things. I don’t know if these fixes are backwards compatible. You might need at least conky version 1.13.
  • Conky is damn buggy, at least on Arch Linux, and has been for a long time :angry:

If you found a bug please open an issue in one of the git repos.

This is ugly!

But it’s more precise than most “weather widgets”.

The reason I use this is because IMHO a locally retrieved weather forecast is always superior to one from a large international
website somewhere halfway around the globe, and because the Finnish Metereological Institute is not trying to sell me anything.

I am trying as far as possible to mirror the website’s way of displaying information (except for making it vertical).
It might look unwieldy, but it has more granularity and objectivity than most weather widgets out there.


Happy customizing and don’t forget to look out the window sometimes!