示例#1
0
#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()