所以我有一个使用firebase的应用程序。在这个应用程序中,我想抓取结束时间大于或等于当天的事件。我做了这个功能,我相信完成了。但是,它什么都不返回
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import pw
import json
access_token = pw.access_token
access_token_secret = pw.access_token_secret
consumer_key = pw.consumer_key
consumer_secret = pw.consumer_secret
class StdOutListener(StreamListener):
def on_data(self, data):
dicto = json.loads(data)
print(dicto['user'])
return True
def on_error(self, status):
print(status)
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, StdOutListener())
stream.filter(track="music")
事件节点下我树中的一个孩子看起来像这样
static func show(forEventKey eventKey: String, completion: @escaping (Event?) -> Void) {
print(eventKey)
let ref = Database.database().reference().child("events").child(eventKey).child("event:datetime")
// print(eventKey)
//pull everything
print(Date().timeIntervalSince1970)
ref.queryOrdered(byChild: "end").queryStarting(atValue: Date().timeIntervalSince1970).observeSingleEvent(of: .value, with: { (snapshot) in
print(snapshot)
guard let event = Event(snapshot: snapshot) else {
return completion(nil)
}
completion(event)
}) { (err) in
print("couldn't grab event due to \(err)")
}
}
任何人都可以看到我的查询出错了,因为我有点困惑吗?