コード例 #1
0
ファイル: contentManager.py プロジェクト: horryq/TYSpider
def article(url):
    urlhash = hashlib.md5(url).hexdigest().lower()

    floor = db.getArticleFloor(urlhash)
    if floor == None:
        floor = "1"

    # print floor

    # article, floorCount = spider.getUrl(url, floor)

    title, article, floorCount = gspider.getArticle(url, floor)

    # print article

    db.appendArticle(urlhash, article)

    db.saveArticleFloor(urlhash, floorCount)

    db.saveArticleTitle(urlhash, title)

    return db.getAllArticle(urlhash)
コード例 #2
0
ファイル: contentManager.py プロジェクト: horryq/TYSpider
def articleWithHash(th):
    return db.getAllArticle(th)