Beispiel #1
0
def arp_display(pkt):
  global lastCalled
  if pkt[ARP].op == 1: #who-has (request)
    if (pkt[ARP].psrc == '0.0.0.0') and (datetime.datetime.now() - lastCalled > datetime.timedelta(minutes=1)): # ARP Probes will match this
        weather = getData.getWeather()
        subway = getData.getSubway()

        if pkt[ARP].hwsrc == 'f0:27:2d:86:7b:bf':
            lastCalled = datetime.datetime.now()
            call(['flite', '-voice', 'slt', getData.getDateTime()])
            call(['flite', '-voice', 'slt', weather['morning']])
            call(['flite', '-voice', 'slt', weather['day']])
            call(['flite', '-voice', 'slt', weather['evening']])
            call(['flite', '-voice', 'slt', subway['ace']])
            call(['flite', '-voice', 'slt', subway['nqr']])
            call(['flite', '-voice', 'slt', subway['oneTwoThree']])
        else:
            print "ARP Probe from unknown device: " + pkt[ARP].hwsrc
Beispiel #2
0
def montclairFunction():
    city = request.form['text']

    if city.lower() == "new york":
        city = "manhattan"
    elif city.lower() == "new york, ny":
        city = "manhattan"
    elif city.lower() == "new york, new york":
        city = "manhattan"
    elif city.lower() == "new york ny":
        city = "manhattan"
    elif city.lower() == "new york new york":
        city = "manhattan"

    try:
        data = getData.getWeather(city)
    except:
        return render_template("error.html")

    return render_template('results.html', data=data)
Beispiel #3
0
    def sendMessage(self):
        url = 'https://www.thecamp.or.kr/consolLetter/insertConsolLetterA.do?'

        data = {
            'traineeMgrSeq': 'xxxxxxx',
            'sympathyLetterSubject': self.title,
            'sympathyLetterContent': self.content,
            'boardDiv': 'sympathyLetter',
            'tempSaveYn': 'N',
        }

        resp = self.session.post(url, data=data)
        print(resp.text + str(resp.status_code))


weather = getData.getWeather()
tMessage = getData.getTelegramMessage()
news = '# 과학기술' + getData.getSciNews_tech(
) + '<br><br># 과학정책<br>' + getData.getSciNews_policy(
) + '<br><br># 과학문화<br>' + getData.getSciNews_culture()

camp = TheCamp('userId', 'userPw', '기견아 인편왔다!! ' + getData.today,
               tMessage + '<br><br>' + str(weather) + '<br><br>' + news)
camp.login()
camp.sendMessage()

tongilnews = getData.getNews_tongil()

camp = TheCamp('userId', 'userPw', '다른 소식들 ' + getData.today, tongilnews)
camp.login()
camp.sendMessage()