Simple compact weather tweet
https://twitter.com/weatherStorey
T: 18.5c
P: 1011.6mb steady
Humid: 88%
Rain: 5.56mm
Gust: 0.5mph
Bright: 19400lux
UV: 1.73
Strikes: 0 (25km Sun Jun 27 15:48:57 BST 2021)
Uses the https://github.com/jim-easterbrook/pywws library to send tweets Uses jq to parse the retrieve json
install jq
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-1.5.tar.gz
tar xfvz jq-1.5.tar.gz
example json
{"station_id":"YOURSTATIONID,"station_name":"YOURSTATIONNAME","public_name":"The Wood","latitude":52,"longitude":-3,"timezone":"Europe/London","elevation":24.7111644744873,"is_public":true,"status":{"status_code":0,"status_message":"SUCCESS"},"station_units":{"units_temp":"c","units_wind":"mph","units_precip":"mm","units_pressure":"mb","units_distance":"mi","units_direction":"cardinal","units_other":"imperial"},"outdoor_keys":["timestamp","air_temperature","barometric_pressure","station_pressure","pressure_trend","sea_level_pressure","relative_humidity","precip","precip_accum_last_1hr","precip_accum_local_day","precip_accum_local_yesterday","precip_minutes_local_day","precip_minutes_local_yesterday","wind_avg","wind_direction","wind_gust","wind_lull","solar_radiation","uv","brightness","lightning_strike_last_epoch","lightning_strike_last_distance","lightning_strike_count","lightning_strike_count_last_1hr","lightning_strike_count_last_3hr","feels_like","heat_index","wind_chill","dew_point","wet_bulb_temperature","delta_t","air_density"],
"obs":[{"timestamp":1617975655,"air_temperature":14.2,"barometric_pressure":1013.3,"station_pressure":1013.3,"sea_level_pressure":1016.5,"relative_humidity":46,"precip":0.0,"precip_accum_last_1hr":0.0,"precip_accum_local_day":0.0,"precip_accum_local_yesterday":0.0,"precip_minutes_local_day":0,"precip_minutes_local_yesterday":0,"wind_avg":1.0,"wind_direction":359,"wind_gust":1.7,"wind_lull":0.0,"solar_radiation":714,"uv":3.01,"brightness":85720,"lightning_strike_last_epoch":1615598133,"lightning_strike_last_distance":41,"lightning_strike_count":0,"lightning_strike_count_last_1hr":0,"lightning_strike_count_last_3hr":0,"feels_like":14.2,"heat_index":14.2,"wind_chill":14.2,"dew_point":2.7,"wet_bulb_temperature":8.6,"delta_t":5.6,"air_density":1.22845,"pressure_trend":"falling"}]}
crontab -e
# m h dom mon dow command
*/10 * * * * sudo python /home/user/weather/pywws/scripts/pywws-hourly.py -v /home/user/weather/data
This repository contains some example best practices for open source repositories:
These are optional
- dco.yml - This enables DCO bot for you, please take a look https://github.com/probot/dco for more details.
- travis.yml - This is a example
.travis.yml
, please take a look https://docs.travis-ci.com/user/tutorial/ for more details.
These may be copied into a new or existing project to make it easier for developers not on a project team to collaborate.
If you have any questions or issues you can create a new issue here.
Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
All source files must include a Copyright and License header. The SPDX license header is preferred because it can be easily scanned.
If you would like to see the detailed LICENSE click here.
#
# Copyright 2020- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#
Optionally, you may include a list of authors, though this is redundant with the built-in GitHub list of contributors.
- Author: New OpenSource IBMer [email protected]