-
Notifications
You must be signed in to change notification settings - Fork 0
/
bandeco.py
27 lines (20 loc) · 839 Bytes
/
bandeco.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import bandecoapi.api as bandeco
from datetime import datetime
import tweepy
consumer_key=''
consumer_secret=''
access_key=''
access_secret=''
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_key, access_secret)
twt = tweepy.API(auth)
menus = ["lunch", "veglunch"]
refeicao = "O almoço"
if int(datetime.now().strftime("%H")) > 14:
menus = ["dinner", "vegdinner"]
refeicao = "A janta"
lunch = bandeco.get_menu(menus=menus)
# removes last part from menu because it's kinda useless and exceeds character count
#print(refeicao+' de hoje é:\n'+"\n".join(lunch['menu'][menus[0]].split('\n')[:-1]))
twt.update_status(refeicao+' de hoje é:\n'+"\n".join(lunch['menu'][menus[0]].split('\n')[:-1]))
twt.update_status(refeicao+' veg de hoje é:\n'+"\n".join(lunch['menu'][menus[1]].split('\n')[:-1]))