#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template, redirect
import feedparser
# python3 -m pip install feedparser
app = Flask(__name__)
@app.route("/")
def index():
url =
"https://rss-weather.yahoo.co.jp/rss/days/5110.xml"
#dictionary = feedparser.parse(url)
#print("dictionary={}".format(dictionary))
itemsList = []
for entry in
feedparser.parse(url).entries:
print(entry.title)
itemsList.append(entry.title)
return
render_template('weather-yahoo.html', itemsList=itemsList)
if __name__ == "__main__":
print("Reloding...")
print("app.url_map={}".format(app.url_map))
app.run(host='0.0.0.0', port=8080,
debug=True)
|