Example #1
0
def populate_sources():
    for source in sources:
        if 'tag' in source:
            ContentSource.get_or_create_content_source(db.session, source['url'], source['tag'])
        else:
            ContentSource.get_or_create_content_source(db.session, source['url'])

    for type_name in types:
        ContentType.get_or_create_content_type(db.session, type_name)
Example #2
0
def populate_sources():
    for source in sources:
        if 'tag' in source:
            ContentSource.get_or_create_content_source(db.session,
                                                       source['url'],
                                                       source['tag'])
        else:
            ContentSource.get_or_create_content_source(db.session,
                                                       source['url'])

    for type_name in types:
        ContentType.get_or_create_content_type(db.session, type_name)
Example #3
0
def aggregate_content():
    logger.info('starting content aggregation...')
    start_time = time.time()
    sources = ContentSource.get_all_sources()
    for source in sources:
        get_primary_content_data(source.url, source.id, session)
    logger.info('content aggregation completed in %s', str(timedelta(seconds=time.time() - start_time)))
Example #4
0
def aggregate_content():
    logger.info('starting content aggregation...')
    start_time = time.time()
    sources = ContentSource.get_all_sources()
    for source in sources:
        get_primary_content_data(source.url, source.id, session)
    logger.info('content aggregation completed in %s',
                str(timedelta(seconds=time.time() - start_time)))