示例#1
0
文件: counts.py 项目: marklar/massiu
def num_tweets():
    minutes = fetch.get_minutes(NEW_STREAM, MINS_IN_HOUR)
    one_hour = sum(minutes)
    return {
        'hour': one_hour,
        'day':  one_hour * 24,      # bogus!
        'week': one_hour * 24 * 7   # bogus!
    }
示例#2
0
def get_daily_count(stream):
    minutes = fetch.get_minutes(stream, MINS_IN_DAY)
    return sum(minutes[:MINS_IN_DAY])