Example #1
0
def main(feed_file, start, end, kmax, outdir):

    os.system('find %s -type f -delete' % outdir)

    with open(feed_file) as fp:
        urls = [line.strip() for line in fp.readlines()]

    urls = validate_urls(urls)

    global NOW, START_TIME, END_TIME
    NOW = get_datetime(gmtime())
    START_TIME = NOW - timedelta(hours=start)
    END_TIME = NOW - timedelta(hours=end)

    print 'Fetching feeds between %s and %s...' % (as_local_time(START_TIME),
                                                   as_local_time(END_TIME))
    feeds = read_feeds(urls, START_TIME, END_TIME)
    print 'Got %d entries from %d feeds' % (sum(
        len(feed[1]) for feed in feeds), len(feeds))

    analyze(feeds, kmax, common_words, outdir)
Example #2
0
def main(feed_file, start, end, kmax, outdir):

    os.system('find %s -type f -delete' % outdir)

    with open(feed_file) as fp:
        urls = [line.strip() for line in fp.readlines()]

    urls = validate_urls(urls)

    global NOW, START_TIME, END_TIME
    NOW = get_datetime(gmtime())
    START_TIME = NOW - timedelta(hours=start)
    END_TIME = NOW - timedelta(hours=end)

    print 'Fetching feeds between %s and %s...' % (
        as_local_time(START_TIME),
        as_local_time(END_TIME))
    feeds = read_feeds(urls, START_TIME, END_TIME)
    print 'Got %d entries from %d feeds' % (
        sum(len(feed[1]) for feed in feeds),
        len(feeds))

    analyze(feeds, kmax, common_words, outdir)
Example #3
0
def format_table_page(*args, **kwargs):
    import utils
    preamble = utils.format_table([('Start:', as_local_time(START_TIME)),
                                   ('End:', as_local_time(END_TIME))])
    return utils.format_table_page(preamble, *args, **kwargs)
Example #4
0
def format_table_page(*args, **kwargs):
    import utils
    preamble = utils.format_table([('Start:', as_local_time(START_TIME)),
                                   ('End:', as_local_time(END_TIME))])
    return utils.format_table_page(preamble, *args, **kwargs)