Exemple #1
0
def tweet():
    with app.test_request_context() as request:
        now = datetime.datetime.now().strftime("%Y-%m-%dT %H:%M")
        tong2 = SeeOhClient(_feed='74539')
        tong2_tweepy.api.update_status(
            u'통이 입니다. 온도는 %(temp)s도, 습도가 %(humidity)s퍼센트, 땅의 수분은 %(moisture)s퍼센트, 밝기는 %(light)s 입니다.  - %(now)s'
            % {
                "temp": tong2.get_temperature(),
                "humidity": tong2.get_humidity(),
                "moisture": tong2.get_moisture(),
                "light": tong2.get_light(),
                "now": now
            })
        dokgi = SeeOhClient(_feed='74540')
        dokgi_tweepy.api.update_status(
            u'난 독기야~. 온도: %(temp)s도, 땅의 수분: %(moisture)s퍼센트. 밝기: %(light)s. - %(now)s'
            % {
                "temp": dokgi.get_temperature(),
                "moisture": dokgi.get_moisture(),
                "light": dokgi.get_light(),
                "now": now
            })
    return True
Exemple #2
0
def index():
    see = SeeOhClient(_feed='74539')
    temperature = see.get_temperature()
    return render_template('index.html', temperature=temperature)