The most important twitter account
counts down the remaining days to
congress. Today there are just 19 days left until a hole opens in the universe
and excellent people appear to keep the base going.
Ignoring the large amount of realwork™ I have to do, there is a lot of
important stuff to be prepared for congress. I have tried to avoid committing to
doing anything on my holiday, but I plan to bring the following three ideas:
-
RGB Pixel Display
-
I have a 8x8 neopixel display with a small case. I am planning to make it controllable via UDP packets and leave it on the open network for other people to find and play with.
-
Slow TV
-
Multicast video feed showing relaxing slow paced video. I have a lot of driving from my trip to Iceland. I will include some other feeds I have picked up in the last few month. We might include a radio station a long side, but that bit hasn't been figured out yet.
-
Some sort of display showing:
-
rainbowstream
-
cool stuff pulled of the open wifi, images, password wall of sheep style.
Reading:
Virtual Light
I looked up reverse geocoding with openstreetmap and found a keyless api.
Reverse geocoding is the process of turning a location as a latitude and
longitude into a place name. This is handy for creating my daily post footer, I
want to have a script that will take in a lat/lng pair and output the full
location name and weather with a map link.
I can use the kindly provided nominatim reverse geocoding URI and a bit of
python. I guess openstreetmap thinks I am in a weird parallel UK that is made
up of states, that is easy to deal with thankfully.
base_url = "http://nominatim.openstreetmap.org/reverse?format=json&lat={}&lon={}&zoom=18&addressdetails=1"
uri = base_url.format(lat, lng)
fp = urllib.request.urlopen(uri)
response = fp.read()
location = json.loads(response.decode("utf8"))
fp.close()
city = location['address']['city']
country = location['address']['country']
if country == "UK" or country == "US":
country = location['address']['state']
return {'country':country, 'city':city}
I end up with a single script for generating the location/weather block. The
script will default my 'work' location or it will try and format a lat/lng out
of any arguments passed in.
#!/usr/bin/env python3.5
import forecastio
import pprint
import urllib.request
import json
import sys
api_key = "yer_key_here_bawbag"
lat = 57.168
lng = -2.1055
def forwardweather(lat, lng):
forecast = forecastio.load_forecast(api_key, lat, lng)
weather = forecast.daily().data[0]
temperatureMax = int(weather.apparentTemperatureMax)
temperatureMin = int(weather.apparentTemperatureMin)
summary = weather.summary
return {'temperature':temperatureMax, 'summary':summary}
def reversegeocode(lat, lng):
base_url = "http://nominatim.openstreetmap.org/reverse?format=json&lat={}&lon={}&zoom=18&addressdetails=1"
uri = base_url.format(lat, lng)
fp = urllib.request.urlopen(uri)
response = fp.read()
location = json.loads(response.decode("utf8"))
fp.close()
city = location['address']['city']
country = location['address']['country']
if country == "UK" or country == "US":
country = location['address']['state']
return {'country':country, 'city':city}
if __name__ == "__main__":
if len(sys.argv) == 2:
loc = sys.argv[1].split(',')
if len(loc) != 2:
exit()
lat = float(loc[0])
lng = float(loc[1])
if len(sys.argv) == 3:
lat = float(sys.argv[1])
lng = float(sys.argv[2])
print("Getting weather for: {}, {}\n\n".format(lat, lng))
weather = forwardweather(lat, lng)
location = reversegeocode(lat, lng)
base_url = "http://www.openstreetmap.org/search?query={}%2C%20{}"
uri = base_url.format(lat, lng)
print("[{}, {}][0]: {}°C, {}".format(location['city'], location['country'],
weather['temperature'], weather['summary']))
print("\n[0]: {}".format(uri))
Reading:
Virtual Light
I am still playing with other fields to stick onto the daily post. So far I
have been sticking on a reading field that can sort of track how I am
progressing with books. I want to include a fuzzy location and the state of the
weather around me, obviously I know where I am looking back it will be
interesting to me having a record of where I was when I posted.
I have tried with
outside
,
reality
,
being
and a load of other
vague terms, writing this out those all look ridiculous. Now I have tried just
letting the info hang there instead, my current lat/long converted to a place
name with a link to a map, followed by the weather.
Reading:
Cibola Burn, Virtual Light
Union Terrace Gardens has some excellent pieces that were put up as part of a
street art festival
. Adding culture to the city is great, but there is
something about 'santioned creativity' that really annoys me. I know the
residents around here would be up in arms if someone did a giant mural
overnight.
Reading:
Cibola Burn, Virtual Light
Location:
57.1578,-2.2143
Weather:
2°C Partly cloudy starting in the evening.
I think the weather stuff I played with
yesterday
is going to be an input
to a quantified self dashboard I have been toying with building for a long
time.
I have wanted to put together a dash for years, but I have always struggled to
find technologies that I want to work with. For a
demo at work
I have had
to put together a simple dash, all it does is show interface throughput for two
interfaces, but it has give a chance to play with the front end UI and backend
webserving components that I want to use.
I am lurking in a coffee shop now, which is a great time to have a first whack
at the idea.
It
is
Sunday, so that
makes
seven
days
of
writing
.
Reading:
Cibola Burn, Virtual Light
Location:
57.1446, -2.1060
Weather:
6˚C Clear.