Example #1
0
def main():
	matchIds,matches = net.getLiveMatches()
	if matches[0] == "No Match in progress":
		op.popUp("Cricket","No match in progress or scheduled soon",0)
		return
	options = ["Matches:"]
	for elem in matches:
		options.append(elem)
	options.append("Back")

	try:
		optionChosen = ip.getUserInput(options)
	except KeyboardInterrupt:
		exitApp()

	if optionChosen == len(options)-1 :
		return

	minutes = ip.getMinutes(1)
	if minutes == "":
		main()
		return
	pb = ip.getPB()
	op.popUp("Notification Set","{} every {} minute(s)".format(options[optionChosen],minutes),0)
	app.DICTIONARY["Cricket"].append({"matchId":matchIds[optionChosen-1] , "Teams":options[optionChosen], "Interval":minutes*10 , "Counter":minutes*10 ,"PB":pb})
Example #2
0
def getEvents(site):

	if site == "Hackerearth":
		lis = net.getHackerEvents()
	else:
		lis = net.getOtherEvents(site)

	if len(lis) == 0:
		op.popUp(site,"No Upcoming Challenges",0)
	options = ["Upcoming challenges on {}".format(site)]
	for elem in lis:
		options.append("{:<50} {:<40} {:>20}".format(elem["Title"],"StartTime : "+elem["Start"],"EndTime : "+elem["End"]))
	options.append("Back")
	try:
		optionChosen = ip.getUserInput(options)
	except KeyboardInterrupt:
		exitApp()
	if optionChosen == len(options)-1 :
		main()
	else:
		minutes = ip.getMinutes(30)
		if minutes == "":
			getEvents(site)
			return
		pb = ip.getPB()
		app.DICTIONARY["Coding"].append({"Title":"{} Challenge".format(site),"Message":options[optionChosen],"Interval":minutes*10,"Counter":minutes*10,"PB":pb})
		op.popUp("Notification Set","For {} every {} minute(s)".format(lis[optionChosen-1]["Title"],minutes),0)
Example #3
0
File: tweet.py Project: pk16/notify
def getData():
	hashtag = ip.inputData("Hashtag","Enter the hashtag")
	if hashtag == "":
		return
	minutes = ip.getMinutes(1)
	if minutes == "":
		main()
		return
	pb = ip.getPB()
	#IN LIST
	app.DICTIONARY["Tweets"].append({"HashTag":hashtag , "Interval":minutes*10 , "Counter":minutes*10 ,"PB":pb})
	op.popUp("Notification Set","Tweets for \"{}\" every {} minute(s)".format(hashtag,minutes),0)
Example #4
0
def getData():
	title = ip.inputData("Title","Enter the title")
	if title == "":
		return
	msg = ip.inputData("Message","Enter the message for notification")
	if msg == "":
		return
	minutes = ip.getMinutes(10)
	if minutes == "":
		return
	pb = ip.getPB()
	#IN LIST
	app.DICTIONARY["Custom"].append({"Title":title , "Message":msg , "Interval":minutes*10 , "Counter":minutes*10 , "PB":pb})
	op.popUp("Notification Set","For title \"{}\" and message \"{}\" every {} minute(s)".format(title,msg,minutes),0)
Example #5
0
File: tweet.py Project: pk16/notify
def trending(name,woeid):
	options = ["Top 10 {}".format(name)]
	op.popUp("Notify","Fetching Data",0)
	trend = net.getTrending(woeid)
	options = options + trend
	options.append("Back")
	try:
		optionChosen = ip.getUserInput(options)
	except KeyboardInterrupt:
		exitApp()
	if optionChosen == len(options)-1 :
		main()
	else:
		minutes = ip.getMinutes(1)
		if minutes == "":
			trending(name,woeid)
		app.DICTIONARY["Tweets"].append({"HashTag":options[optionChosen] , "Interval":minutes*10 , "Counter":minutes*10 })
		op.popUp("Notification Set","Tweets for \"{}\" every {} minute(s)".format(options[optionChosen],minutes),0)