示例#1
0
    def _get_timemap_query(self, params):
        from_ts = params.get('from')
        if from_ts:
            from_ts = pad_timestamp(from_ts, EARLIEST_DATE)
        else:
            from_ts = EARLIEST_DATE

        to_ts = params.get('to')
        if not to_ts:
            to_ts = timestamp_now()
        else:
            to_ts = pad_timestamp(to_ts, LATEST_DATE)

        query = 'exacturlexpand:{0} date:{1}-{2}'.format(
            params.get('url'), from_ts, to_ts)

        return query
示例#2
0
    def _get_timemap_query(self, params):
        from_ts = params.get('from')
        if from_ts:
            from_ts = pad_timestamp(from_ts, EARLIEST_DATE)
        else:
            from_ts = EARLIEST_DATE

        to_ts = params.get('to')
        if not to_ts:
            to_ts = timestamp_now()
        else:
            to_ts = pad_timestamp(to_ts, LATEST_DATE)

        query = 'exacturlexpand:{0} date:{1}-{2}'.format(params.get('url'),
                                                         from_ts, to_ts)

        return query
示例#3
0
    def _get_closest_query(self, params):
        closest = params.get('closest')
        closest = pad_timestamp(closest, EARLIEST_DATE)
#        query = 'closestdate:{0} exacturlexpand:{1}'.format(closest,
#                                                      params.get('url'))
        query = 'exacturlexpand:{0} date:19960101000000-20291222163016'.format(params.get('url'))
        print 'novo date search'
        return query
示例#4
0
文件: cdxops.py 项目: yumatchlab/pywb
def cdx_clamp(cdx_iter, from_ts, to_ts):
    """
    Clamp by start and end ts
    """
    if from_ts and len(from_ts) < 14:
        from_ts = pad_timestamp(from_ts, PAD_14_DOWN)

    if to_ts and len(to_ts) < 14:
        to_ts = pad_timestamp(to_ts, PAD_14_UP)

    for cdx in cdx_iter:
        if from_ts and cdx[TIMESTAMP] < from_ts:
            continue

        if to_ts and cdx[TIMESTAMP] > to_ts:
            continue

        yield cdx
示例#5
0
 def _get_closest_query(self, params):
     closest = params.get('closest')
     closest = pad_timestamp(closest, EARLIEST_DATE)
     query = 'closestdate:{0} exacturlexpand:{1}'.format(
         closest, params.get('url'))
     return query
 def _get_closest_query(self, params):
     closest = params.get('closest')
     closest = pad_timestamp(closest, EARLIEST_DATE)
     query = 'closestdate:{0} exacturl:{1}'.format(closest,
                                                   params.get('url'))
     return query