Tagged: data

Hakology – How to grab openweathermap data using python.

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

run the file using …
python displayweather.py

import requests
r = requests.get('http://api.openweathermap.org/data/2.5/forecast/city?id=YOURCITYIDGOESHERE&APPID=YOURAPIKEYGOESHERE')
data = r.json()
mystring = ""
mystring = mystring + data['city']['name'] + " "
mystring = mystring + "Temp:" + str(int(data['list'][0]['main']['temp'] - 273.15)) + "C "
mystring = mystring + "Max:" + str(int(data['list'][0]['main']['temp_max'] - 273.15)) + "C "
mystring = mystring + "Min:" + str(int(data['list'][0]['main']['temp_min'] - 273.15)) + "C "
mystring = mystring + "Hum:" + str(data['list'][0]['main']['humidity']) + "% "
print mystring

Click here to download the file.

Hakology Day 9 : Blog Entry

So it begins, late night last night, got the SDR working under windows. Todays goals, get the SDR working under linux and gqrx, look at what I managed to capture in the log and start a video showing how to setup SDR#.

Really don’t want to stop logging messages lol, but I suppose its time to start making notes. Once I can get this running on the RPi ill leave it logging 24/7 for a while so I can analyse the data. Still lots of data being sent that shouldn’t be, names, phone numbers, address information, IP addresses, email addresses, URLs … and I’m sure if I log for long enough the obligatory username and password.

So I can’t show or share any of the data I’m collecting. Hibby just pointed me to (Legal stuff) … even though I can’t share the data I can show you how to demodulate the signals yourself.

Written up notes for SDR# installation.

Executing operation tidy up for recording later also doing a few other chores.

Still tidying 🙁 b/c I’m a messy bugger.

Random picture for today …
Since I’m working on radio stuff here’s my baofeng handset its the uv-5r, a great starting handset for people looking to get in to HAM radio and start learning. I bought one relatively cheap on ebay around £20, before I got my licence so I could scan and listen a little. I’ve some other scanners and sets but ill save those for another day.

meh RL … need to script my house work or hack together some sort of roomba capable of washing up and making tea/coffee on demand.

Chilling out time for a coffee and some food. BBL

A few pages of notes written and a rough idea for an introduction to SDR. Time for a brew and to record / talk through the audio. Will report back in a while.

Useful links:

Captured a little extra audio for the hakology introduction too.

Sleep required.

Woke up after a few hours sleep been doing a little radio research, too early to start the next blog entry, too late to be editing this one hmmm.
No vblog for day nine either will have to make up for it later.

Hakology – LinkStats – Introduction and demo (http(s) data mining)

In this video we’ll be looking at a tool I programmed about 12 months ago for mining data from web pages. Easily find file extensions and embedded objects. Let me know what you think. More soon. Peace Tea

Git hub page : https://github.com/caffeinemonster/LinkStats