-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py-template
71 lines (50 loc) · 1.87 KB
/
config.py-template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# database, last tweet timestamp
conf_storage = "/tmp/.air_tweet"
# the sensor ids
conf_particle_sensor_id = 90887
conf_temperature_sensor_id = None
# url used to fetch the avg sensor of the last hour
conf_url_pm_sensor = "https://api.luftdaten.info/static/v2/data.1h.json"
conf_url_th_sensor = "https://api.luftdaten.info/static/v2/data.1h.json"
# sensor graphs to embed in the tweet
conf_luftdaten_graph_url = "http://192.168.0.43:3000/render/d-solo/eDF152mRk/twitter?panelId=2&orgId=1&from={}&to={}&width=800&height=500&tz=UTC%2B02%3A00"
conf_luftdaten_graph_mime_type = "image/png"
# PM 10 limit
conf_limit_pm_10_0 = 50
# quiet period after a tweet has been published
conf_quiet_period_in_hours = 6
# stuff to embed in the tweet
conf_luftdaten_map_url = "https://maps.sensor.community/#15/48.8040/9.2280"
# mastodon credentials
mastodon_enabled = True
mastodon_api_base_url = 'https://mastodon.online'
mastodon_access_token = ''
# bluesky credentials
bluesky_enabled = False
bluesky_handle = '....bsky.social'
bluesky_password = '...'
# Dedicated templates to handle varying maximum length constraints.
#
# templates - supported jinja2 template variables:
# - pm10
# - pm25
# - temperature
# - humidity
# - current_time
# - luftdaten_map_url
mastodon_jinja2_template = '''
⚠ #Feinstaub in #Cannstatt / #Stuttgart ({{ current_time }})
PM10: {{ pm10 }} µg/m³
PM2.5: {{ pm25 }} µg/m³
Details: {{ luftdaten_map_url }}
This is a bot. Code is available on github aschuma/air_tweets.
#Luftverschmutzung #Particulatematter #Opendata #Civictech #Airrohr #Airpollution #Airquality
'''
bluesky_jinja2_template = '''
DAILY AIR QUALITY UPDATE
#Feinstaub in #Cannstatt / #Stuttgart ({{ current_time }})
PM10: {{ pm10 }} µg/m³
PM2.5: {{ pm25 }} µg/m³
Details: {{ luftdaten_map_url }}
#Luftverschmutzung #Particulatematter #Opendata #Civictech #Airrohr #Airpollution #Airquality
'''