コード例 #1
0
def get_wiki_summary(title):

    summary = None
    f = WikiwareFetch()
    html = f.fetch_api_parse(title=title, section="0")
    if html:
        p = WikiwareAPIParseSummary(content=html)
        summary = p.get_summary()
    return summary
コード例 #2
0
ファイル: wiki.py プロジェクト: flyeven/python-wikiware
def get_wiki_summary(title):

    summary = None
    f = WikiwareFetch()
    html = f.fetch_api_parse(title=title, section="0")
    if html:
        p = WikiwareAPIParseSummary(content=html)
        summary = p.get_summary()
    return summary
コード例 #3
0
ファイル: geo.py プロジェクト: un33k/python-wikiware
def get_wiki_summary(title):
    """ Get the summary for a geography section of a wiki page """
    summary = None
    f = WikiwareFetch()
    html = f.fetch_api_parse(title=title, section="0")
    if html:
        p = WikiwareAPIParseSummary(content=html)
        if p.is_category(defaults.WIKIWARE_CATEGORY_TYPE_GEOGRAPHY):
            p.set_attr(attr={'id': pattern_coordinates})
            summary = p.get_summary()
    return summary
コード例 #4
0
ファイル: geo.py プロジェクト: un33k/python-wikiware
def get_wiki_summary(title):
    """ Get the summary for a geography section of a wiki page """
    summary = None
    f = WikiwareFetch()
    html = f.fetch_api_parse(title=title, section="0")
    if html:
        p = WikiwareAPIParseSummary(content=html)
        if p.is_category(defaults.WIKIWARE_CATEGORY_TYPE_GEOGRAPHY):
            p.set_attr(attr={"id": pattern_coordinates})
            summary = p.get_summary()
    return summary
コード例 #5
0
ファイル: wiki.py プロジェクト: hassanNS/python-wikiware
from fetcher import WikiwareFetch
from parser import WikiwareAPIParse

if __name__ == '__main__':
    title = 'France'
    format = 'json'
    fetcher = WikiwareFetch()
    content = fetcher.fetch_api(title=title, format=format)
    parser = WikiwareAPIParse(content=content, format=format)
    text = parser.parse()

    print "\n\n"
    print text
    print "\n\n"