让我先说,我以前从来没有用python编写过代码。在
我正在考虑使用https://github.com/shariq/firebase-python连接到我的Firebase数据库。我正在使用IFTTT将数据从另一个源推送到Firebase。当更新发生时,我希望它自动推送到我的python代码中。在
我有以下内容:
import firebase
updatesUrl = 'baseball/updates'
updatesSubscription = firebase.subscriber(updatesUrl, refreshDisplay())
def refreshDisplay():
# how do i get the value of the last update here?
使用firebase for python似乎有点棘手。 主要的缺点是订阅URL后,订阅者每15分钟轮询firebase一次。在
以下是您可以使用代码执行的操作:
在执行python代码之后,打开firebase数据库,并对要监视的字段进行一些更改。 大约15分钟后,您将在python控制台上收到更新的值,比如
^{pr2}$建议:使用PubNub而不是firebase。在
相关问题 更多 >
编程相关推荐