本文整理汇总了Python中API.API.gettop方法的典型用法代码示例。如果您正苦于以下问题:Python API.gettop方法的具体用法?Python API.gettop怎么用?Python API.gettop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API.API
的用法示例。
在下文中一共展示了API.gettop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: API
# 需要导入模块: from API import API [as 别名]
# 或者: from API.API import gettop [as 别名]
#list religious sources
sources['5'] = ['news_va_en', 'Buddhism_Now', 'HinduismToday', 'Pearlsofprophet', 'YourJudaism', 'HuffPostRelig', 'RNS']
#list entertainment sources
sources['6'] = ['MTV', 'Rock Music', 'TheGRAMMYs', 'TheAcademy', 'bbcentertain', 'EntMagazine', 'EW', 'mashentertain', 'CBSShowbiz']
#job and careers sources
sources['7'] = ['GuardianCareers', 'CareerBuilder', 'LinkedIn', 'indeed', 'TweetMyJobs', 'USNewsCareers', 'UCSBcareer', 'BI_Careers']
#weather sources
sources['8'] = ['weatherchannel', 'bbcweather','wunderground', 'weathernetwork', 'capitalweather', 'CNNweather']
#random/other sources
sources['9'] = ['Seldomaniac', 'Callamasta', 'jwharris', 'don_brown', 'lou1derful', 'ChrisPawelski']
api = API(sources)
api.gettweets()
api.cleantweets()
api.tokenizetweets()
api.writetofile()
top = api.gettop()
api.getfeatures()
print top
print api.train()