CODE:

#!/usr/bin/python
# -*- coding: utf-8 -*- '''
Created on 2014-7-8
@author: guaguastd
@name: plot_frequencies_words.py
''' if __name__ == '__main__':
#import json # import Counter
from collections import Counter # import search
from search import search_for_tweet # import visualize
from visualize import visualize_for_frequencies # import login, see http://blog.csdn.net/guaguastd/article/details/31706155
from login import twitter_login # get the twitter access api
twitter_api = twitter_login() # import tweet
from tweet import extract_tweet_entities while 1:
query = raw_input('\nInput the query (eg. #MentionSomeoneImportantForYou, exit to quit): ') if query == 'exit':
print 'Successfully exit!'
break statuses = search_for_tweet(twitter_api, query)
status_texts,screen_names,hashtags,words = extract_tweet_entities(statuses) word_counts = sorted(Counter(words).values(), reverse=True)
visualize_for_frequencies(word_counts, "Word Rank", "Freq")

RESULT:

Input the query (eg. #MentionSomeoneImportantForYou, exit to quit): #MentionSomeoneImportantForYou
Length of statuses 100
Length of statuses 196

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZ3VhZ3Vhc3Rk/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

最新文章

  1. [收集]MVC3 HTML辅助方法集录
  2. spice server dpkg-buildpackage 打包编译备忘
  3. PHP文件的读取
  4. Python基于websocket实时通信的实现—GoEasy
  5. 资金归集率比率sql
  6. Delphi的属性Property
  7. 【C++】const
  8. Ubuntu上安装MongoDB(译)
  9. .Net 自己写个简单的 半 ORM (练手)
  10. 调试NodeJS应用
  11. Real-Rime Rendering (2) - 变换和矩阵(Translation and Matrics)
  12. cocos2d-x 几何绘制: DrawingPrimitives 和 CCDrawNode
  13. NLog 2.0.0.2000 使用实例
  14. mysql 只给更新表的某个字段的授权
  15. ModelAndView
  16. jmeter 使用jmeter 录制web脚本
  17. Windows Server 安装后无法使用无线与音频
  18. 汇编实现: C库常见函数,串操作指令作用
  19. clear session on close of browser jsp
  20. python+stomp+activemq

热门文章

  1. SSM框架 springMVC对静态资源访问的处理
  2. Map 的两种遍历方法详细说明
  3. 【bzoj1221】[HNOI2001] 软件开发 费用流
  4. BZOJ 3674 可持久化并查集加强版(主席树变形)
  5. 浅谈 easyui tabs 的href和content属性
  6. vue中如何将时间对象转换成字符串
  7. 使用 swagger组件给asp.net webapi文档生成
  8. HDU 4388 Stone Game II {博弈||找规律}
  9. Mongoose 参考手册
  10. win8.1 uefi引导