Пример #1
0
def getLastMenu():
	googleData = getData(google_id_place)

	if googleData['boolean']:
		return msgs.noMenu((title + " (" + googleData['status'] + ")"), link, ("Horaires : " + googleData['hours']))
	else:
		return msgs.buildClosed((title + " (" + googleData['status'] + ")"), link,
								(googleData['hours'] + "\nDemain : " + googleData['tomorrow']))
Пример #2
0
def getMenu(status_open, hours, phone_number):
    json = getRawJson()

    dayNumber = now.strftime("%d")
    start = now.strftime("%Y-%m-")
    today = start + dayNumber
    yesterday = start + str(int(dayNumber) - 1)

    cleanStuff = ["<p>", "</p>", "<b>", "</b>"]
    datePublish = json[0]['date'].split("T")[0]
    publish = json[0]['content']['rendered']
    publishTitle = json[0]['title']['rendered']

    if datePublish == today or datePublish == yesterday:
        for stuff in cleanStuff:
            publish = publish.replace(stuff, "")
        publish = publish.rstrip().replace("\n", "\n- ")
        return msgs.buildMenu((title + " (" + status_open + ")"), link,
                              ("Menu du " + publishTitle.lower()),
                              json[0]['link'], ("- " + publish))

    return msgs.noMenu((title + " (" + status_open + ")"), link, hours)