This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

radio weather weather_for_ips: take ips from sys.argv optionally

+5 -1
+5 -1
2configs/services/radio/weather_for_ips.py
··· 4 4 import requests 5 5 import os 6 6 import random 7 + import sys 7 8 8 9 9 10 # https://open-meteo.com/en/docs ··· 76 77 geoip = geoip2.database.Reader(os.environ['MAXMIND_GEOIP_DB']) 77 78 seen = {} 78 79 output = [] 79 - ips = list(fileinput.input()) 80 + if len(sys.argv) > 1: 81 + ips = sys.argv[1:] 82 + else: 83 + ips = list(fileinput.input()) 80 84 if len(ips) > 5: 81 85 output.append('weather report.') 82 86 for ip in fileinput.input():