コード例 #1
0
    def test_keywords_oper(self):
        db_session.execute("insert into {} ({}.keyword) values ('".format(
            keywords.name, keywords.name) + FAKE_STR + "')")
        assert len(KeywordsOper.get_search_keywords()) == 1

        KeywordsOper.set_useless_keyword('火影')
        assert len(KeywordsOper.get_search_keywords()) == 0
コード例 #2
0
    def test_keywords_oper(self):
        db_session.execute("insert into {} ({}.keyword) values ('".format(keywords.name, keywords.name)
                           + FAKE_STR + "')")
        assert len(KeywordsOper.get_search_keywords()) == 1

        KeywordsOper.set_useless_keyword('火影')
        assert len(KeywordsOper.get_search_keywords()) == 0
コード例 #3
0
def execute_search_task():
    keywords = KeywordsOper.get_search_keywords()
    for each in keywords:
        app.send_task('tasks.search.search_keyword',
                      args=(each[0], each[1]),
                      queue='search_crawler',
                      routing_key='for_search_info')
コード例 #4
0
ファイル: topic.py プロジェクト: OneCodeMonkey/WeiboCrawler
def execute_topic_task():
    keywords = KeywordsOper.get_search_keywords()
    for each in keywords:
        app.send_task('tasks.topic.search_keyword_topic',
                      args=(each[0], each[1]),
                      queue='topic_crawler',
                      routing_key='topic_info')
コード例 #5
0
ファイル: search.py プロジェクト: ResolveWang/WeiboSpider
def execute_search_task():
    keywords = KeywordsOper.get_search_keywords()
    for each in keywords:
        app.send_task('tasks.search.search_keyword', args=(each[0], each[1]), queue='search_crawler',
                      routing_key='for_search_info')