コード例 #1
0
def _dict_to_question(d):
    question = Question()

    question.title = d['title']
    question.url = d['url']

    return question
コード例 #2
0
def _to_question(question_element, story):
    question = Question()

    question.title = _question_title(question_element, story)
    question.url = _question_url(question_element)

    return question
コード例 #3
0
ファイル: mongo.py プロジェクト: izzyleung/ZhihuDailyPurify
def _dict_to_question(d):
    question = Question()

    question.title = d['title']
    question.url = d['url']

    return question
コード例 #4
0
ファイル: official.py プロジェクト: youjiti/ZhihuDailyPurify
    def _to_question(question_element, story):
        question = Question()

        question.title = _question_title(question_element, story)
        question.url = _question_url(question_element)

        url_valid = ZhihuDailyOfficial._is_question_url_valid(question.url)

        return question if url_valid else None
コード例 #5
0
def _to_question(question_element):
    question = Question()

    question_title_element = _get_question_title_element(question_element)
    if question_title_element:
        question.title = question_title_element.get_text()

    question.url = _get_question_url(question_element)

    return question