Exemple #1
0
//check saved data and run browser if needed
func checkSavedTeachers() {
	var openFlg bool
	ths := th.GetsavedTeachers()
	//open browser
	if len(ths) != 0 {
		//save status
		if redisFlg {
			openFlg = saveStatusLog(rd.Get(), ths)
		} else {
			openFlg = saveStatusLog(tt.Get(), ths)
		}
		fmt.Println(openFlg)
		if openFlg {
			if mailFlg {
				// for sending mail
				ml.Send(ths)
			} else {
				//Browser Mode
				openBrowser(ths)

				//emit a sound
				_ = exec.Command("say", "Found").Start()
			}
		}
	}
}
func clear() {
	if redisFlg {
		clearData(rd.Get())
	} else {
		clearData(tt.Get())
	}
	//deleteTxt(txtPath)
	//deleteRedisKey()

	*jsPath = ""
}