Skip to content

API(pipeline) of news in China (Including 36 Mainstream news media). Including function of getting contents, size, keyword, sentiment, etc.

License

Notifications You must be signed in to change notification settings

UlionTse/news_api

Repository files navigation

The document of news_api

  • Usage:
from news_api import news

for data in news.generate():
    print(data)
import pymysql
from news_api import news

conn = pymysql.connect(host='xxx.xx.xx.xx',
                       port=3306,
                       user='xxxx',
                       password='xxxx',
                       database='xxxx',
                       charset='utf8mb4',
                       cursorclass=pymysql.cursors.DictCursor)
                               
keyPool = {'新闻': ['科技', '财经', '体育']}
news.generate(keyPool=keyPool,pymysql_conn=conn,tableName='t_news')

# run, see luck in your database!
  • Tips:
generate(keyPool=None,outTitle=None,outContent=None,minLength=200,perKeyNum=20,sentimentApi=None,
        pymysql_conn=None,tableName='News')

About

API(pipeline) of news in China (Including 36 Mainstream news media). Including function of getting contents, size, keyword, sentiment, etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages