I’ve been playing with the openweathermap api thought i’d share a little code, the following pulls the json and constructs a string containing the location, temp, tax temp, min temp and humidity. You will need to sign up for an API key and free user account 1st. The free account at the time of writing this allows 50k calls a day so if you’re writing for a small personal project 50k calls should be fine.
Copy the code below to a file eg. displayweather.py
chmod the file if needed … sudo chmod +x displayweather.py
Reflecting on the weekend, have been working on a few projects. One using the max7219 LED matrix driver, which I’m considering writing my own library for as everything i’ve tried seems to fail, I have it working and can address each LED individually but haven’t been able display anything useful ie. fonts or text effects … anyway that’s a work in progress. I turned my hand to configuring a small 1.3″ OLED screen someone donated a while back now I can see it was some kind of addressing issue in the code I initially got it running (there were 2 pixels columns on the far right filled with random bits and a couple of leading pixel columns missing) anyway its working now I noticed the version I was running was from the google code repo and checked github see if the project was still live and found some more recent libraries, installed those and that seems to have remedied the problem.
Managed to sort out a good method for screen capture in gnome3 debian jessie. Was having issues capturing the screen in a format I was able to get in to my editing suite. Inadvertently I found out that debian jessie has built in screencapture/screencast ability. Pressing shift+ctrl+alt+R, a small red dot will appear in a panel near your login/logout panel to show if you are recording, files are automatically saved to your home videos folder, to stop recording just hit the keyboard shortcut again.
These files happen to be in webm format, I havent yet tried running the webm files through handbrake to see if I can convert them to mp4 as my editing suite doesnt natively support webm and one huge problem with the built in screencast is it only records my desktop and no audio. (Maybe I’m doing something wrong, would be easier to just use the built in screencapture)
So eventually my final solution was to record using kazam to mp4, this captured the video + audio, was even hoping I wouldnt have to transcode it again, but still the default format output by kazam isnt compatible with vegas, I then ran the files through handbrake and imported them and everything seems ok … now all the audio syncs with the video perfectly.
Its a bit of a mess/bodge job but it works, maybe if I get some time in future I might have a look see if its possible to edit the default screencast settings to capture audio+video and output to a compatible format preferably mp4.
NB. The default screen recorder only allows you to record for 30 seconds use the following line in terminal to change the maximum record time. gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 45