def index(request): day = request.GET.get('day', None) key = request.GET.get('key', None) domains = Minutely.by_day(starttime=day, endtime=day) total = len(domains) n = len(key.split('.')) + 1 if key else 2 domains = Minutely.analysis(domains, n, key) return {'domains':domains, 'total':total, 'day':day, 'key':key}
def index(request): day = request.GET.get("day", None) page = request.GET.get("page", None) day = day or datetime.date.today().strftime("%Y%m%d") domains = Minutely.by_day(day, day) total = len(domains) # FIXME if page is None: return {"domains": domains, "total": total} page = int(page) num = 100 if num * page > total: domains = [] else: domains = domains[num * page : num * (1 + page)] return {"domains": domains, "total": total}
def show(request): starttime = request.GET.get("starttime", None) endtime = request.GET.get("endtime", None) page = request.GET.get("page", None) if starttime is None and endtime is None: return {"domains": []} domains = Minutely.by_day(starttime, endtime) total = len(domains) # FIXME if page is None: return {"domains": domains, "total": total} page = int(page) num = 100 if num * page > total: domains = [] else: domains = domains[num * page : num * (1 + page)] return {"domains": domains, "total": total}