def run(): data = [] print("fectching bible") data.append(bibleProc.consume(bibleIn.fetch())) print("done. Fetching news") data.append(tldrnewsProc.consume(tldrnewsIn.fetch())) print("done. Fetching weather") data.append(weatherProc.consume(weatherIn.fetch())) print("done. outputing") textOut.put(data,kindle+"dailyNews.txt") print("Network complete")
def run(): caleb_data = calebIn.fetch() data = [] print("fectching bible") data.append(bibleProc.consume(bibleIn.fetch())) print("done. Fetching weather") data.append(weatherProc.consume(weatherIn.fetch())) print("done. Fetching support stats") data.append(calebAmountsProc.consume(caleb_data)) data.append(calebSupportersProc.consume(caleb_data)) print("done. Fetching news") data.append(tldrnewsProc.consume(tldrnewsIn.fetch())) print("done. outputing") textOut.put(data,kindle+"dailyNews.txt") print("Network complete")
def consume(val): ret = "" forecasts = val["forecast"]["txt_forecast"]["forecastday"] for f in forecasts: add = "" add += f["title"] + ": " + f["icon"] + "\n\t" add += f["fcttext_metric"] + "\n\n" ret += add return ret if __name__ == "__main__": import weatherIn print(consume(weatherIn.fetch()))