예제 #1
0
def get_api(date):
    api = {"favorites": favorites,
        "news" : api_calls.get_news(date),
        "apod" : api_calls.get_nasa_apod(date),
        "nasa-news": api_calls.get_nasa_news(date)
        # add more if necessary
    }
    return api
예제 #2
0
def apod(date):
    apodJson = api_calls.get_nasa_apod(date)
    if "400, bad request" in apodJson:
        return jsonify(apodJson)
    url = apodJson["url"]
    if "hdurl" in apodJson:
        url = apodJson["hdurl"]
    return render_template("apod.html", url=url)
예제 #3
0
def apod(date):
    # View the Astronomy Picture of the Day: "YYYY-mm-dd"
    apodJson = api_calls.get_nasa_apod(date)
    if "400, bad request" in apodJson:
        return jsonify(apodJson)
    url = apodJson["url"]
    if "hdurl" in apodJson:
        url = apodJson["hdurl"]
    return render_template("apod.html", url=url)
예제 #4
0
def apod_today():
    apodJson = api_calls.get_nasa_apod(utils.getTodayString())
    if "hdurl" in apodJson:
        url = apodJson["hdurl"]
    return render_template("apod.html", url=apodJson["url"])
예제 #5
0
def api_apod_today():
    return jsonify(api_calls.get_nasa_apod(utils.getTodayString()))
예제 #6
0
def api_apod(date):
    return jsonify(api_calls.get_nasa_apod(date))
예제 #7
0
def api_apod(date):
    # return the api of date
    return jsonify(api_calls.get_nasa_apod(date))
예제 #8
0
def get_api(date):
    api = {"favorites": favorites}
    api["news"] = api_calls.get_news(date)
    api["apod"] = api_calls.get_nasa_apod(date)
    # add more if necessary
    return api