Python 获取新浪微博指定用户的微博列表
2014-07-18 07:49
886 查看
CODE:
RESULT:
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2014-7-18 @author: guaguastd @name: statusesUserTimeline.py ''' if __name__ == '__main__': # import json import json # get weibo_api to access sina api from sinaWeiboLogin import sinaWeiboLogin sinaWeiboApi = sinaWeiboLogin() # import sinaWeoboStatuses from sinaWeiboStatuses import userTimeline # get the new 200 weibo content = userTimeline(sinaWeiboApi, 200) print json.dumps(content, indent=1)
RESULT:
[ { "darwin_tags": [], "favorited": false, "mid": "3731076012679100", "in_reply_to_user_id": "", "truncated": false, "text": "Python \u63d0\u53d6\u65b0\u6d6a\u516c\u5171\u5fae\u535a\u4e2d\u8f6c\u8f7d\u6b21\u6570\u6700\u591a\u7684\u5fae\u535a\u8f6c\u8f7d\u6570\uff0c\u7528\u6237\u540d\uff0c\u5185\u5bb9 http://t.cn/RvFMuci", "created_at": "Fri Jul 11 09:15:04 +0800 2014", "mlevel": 0, "reposts_count": 0, "idstr": "3731076012679100", "visible": { "type": 0, "list_id": 0 }, "attitudes_count": 0, "pic_urls": [], "in_reply_to_screen_name": "", "user": { "bi_followers_count": 0, "domain": "", "avatar_large": "http://tp2.sinaimg.cn/3286717353/180/0/1", "verified_source": "", "ptype": 0, "statuses_count": 4, "allow_all_comment": true, "id": 3286717353, "verified_reason_url": "", "city": "8", "province": "11", "block_app": 0, "follow_me": false, "verified_reason": "", "followers_count": 1, "location": "\u5317\u4eac \u6d77\u6dc0\u533a", "verified_trade": "", "mbtype": 0, "verified_source_url": "", "profile_url": "u/3286717353", "block_word": 0, "avatar_hd": "http://tp2.sinaimg.cn/3286717353/180/0/1", "star": 0, "description": "", "friends_count": 4, "online_status": 1, "mbrank": 0, "allow_all_act_msg": false, "profile_image_url": "http://tp2.sinaimg.cn/3286717353/50/0/1", "idstr": "3286717353", "verified": false, "geo_enabled": true, "class": 1, "screen_name": "beyondzhou8", "lang": "zh-cn", "weihao": "", "remark": "", "favourites_count": 0, "name": "beyondzhou8", "url": "", "gender": "m", "created_at": "Tue Aug 20 00:41:09 +0800 2013", "verified_type": -1, "following": false }, "in_reply_to_status_id": "", "comments_count": 0, "geo": null, "id": 3731076012679100, "source": "<a href=\"http://weibo.com/\" rel=\"nofollow\">\u5fae\u535a weibo.com</a>" }, { "darwin_tags": [], "favorited": false, "mid": "3730684251828947", "in_reply_to_user_id": "", "truncated": false, "text": "Python \u5bf9\u65b0\u6d6a\u5fae\u535a\u7684\u5143\u7d20 (Word, Screen Name)\u7684\u8bcd\u6c47\u591a\u6837\u6027\u5206\u6790 http://t.cn/Rvk5vp3", "created_at": "Thu Jul 10 07:18:21 +0800 2014", "mlevel": 0, "reposts_count": 0, "idstr": "3730684251828947", "visible": { "type": 0, "list_id": 0 }, "attitudes_count": 0, "pic_urls": [], "in_reply_to_screen_name": "", "user": { "bi_followers_count": 0, "domain": "", "avatar_large": "http://tp2.sinaimg.cn/3286717353/180/0/1", "verified_source": "", "ptype": 0, "statuses_count": 4, "allow_all_comment": true, "id": 3286717353, "verified_reason_url": "", "city": "8", "province": "11", "block_app": 0, "follow_me": false, "verified_reason": "", "followers_count": 1, "location": "\u5317\u4eac \u6d77\u6dc0\u533a", "verified_trade": "", "mbtype": 0, "verified_source_url": "", "profile_url": "u/3286717353", "block_word": 0, "avatar_hd": "http://tp2.sinaimg.cn/3286717353/180/0/1", "star": 0, "description": "", "friends_count": 4, "online_status": 1, "mbrank": 0, "allow_all_act_msg": false, "profile_image_url": "http://tp2.sinaimg.cn/3286717353/50/0/1", "idstr": "3286717353", "verified": false, "geo_enabled": true, "class": 1, "screen_name": "beyondzhou8", "lang": "zh-cn", "weihao": "", "remark": "", "favourites_count": 0, "name": "beyondzhou8", "url": "", "gender": "m", "created_at": "Tue Aug 20 00:41:09 +0800 2013", "verified_type": -1, "following": false }, "in_reply_to_status_id": "", "comments_count": 0, "geo": null, "id": 3730684251828947, "source": "<a href=\"http://weibo.com/\" rel=\"nofollow\">\u5fae\u535a weibo.com</a>" }, { "darwin_tags": [], "favorited": false, "mid": "3730665490725827", "in_reply_to_user_id": "", "truncated": false, "text": "Python \u5bf9Twitter\u4e2d\u6307\u5b9a\u8bdd\u9898\u7684\u88ab\u8f6c\u8f7dTweet\u6570\u91cf\u7684\u9891\u8c31\u5206\u6790 http://t.cn/RvkGP6L", "created_at": "Thu Jul 10 06:03:48 +0800 2014", "mlevel": 0, "reposts_count": 0, "idstr": "3730665490725827", "visible": { "type": 0, "list_id": 0 }, "attitudes_count": 0, "pic_urls": [], "in_reply_to_screen_name": "", "user": { "bi_followers_count": 0, "domain": "", "avatar_large": "http://tp2.sinaimg.cn/3286717353/180/0/1", "verified_source": "", "ptype": 0, "statuses_count": 4, "allow_all_comment": true, "id": 3286717353, "verified_reason_url": "", "city": "8", "province": "11", "block_app": 0, "follow_me": false, "verified_reason": "", "followers_count": 1, "location": "\u5317\u4eac \u6d77\u6dc0\u533a", "verified_trade": "", "mbtype": 0, "verified_source_url": "", "profile_url": "u/3286717353", "block_word": 0, "avatar_hd": "http://tp2.sinaimg.cn/3286717353/180/0/1", "star": 0, "description": "", "friends_count": 4, "online_status": 1, "mbrank": 0, "allow_all_act_msg": false, "profile_image_url": "http://tp2.sinaimg.cn/3286717353/50/0/1", "idstr": "3286717353", "verified": false, "geo_enabled": true, "class": 1, "screen_name": "beyondzhou8", "lang": "zh-cn", "weihao": "", "remark": "", "favourites_count": 0, "name": "beyondzhou8", "url": "", "gender": "m", "created_at": "Tue Aug 20 00:41:09 +0800 2013", "verified_type": -1, "following": false }, "in_reply_to_status_id": "", "comments_count": 0, "geo": null, "id": 3730665490725827, "source": "<a href=\"http://weibo.com/\" rel=\"nofollow\">\u5fae\u535a weibo.com</a>" }, { "darwin_tags": [], "favorited": false, "mid": "3687339672990740", "in_reply_to_user_id": "", "truncated": false, "text": "Hi", "created_at": "Wed Mar 12 16:42:28 +0800 2014", "mlevel": 0, "reposts_count": 3, "idstr": "3687339672990740", "visible": { "type": 0, "list_id": 0 }, "attitudes_count": 0, "pic_urls": [], "in_reply_to_screen_name": "", "user": { "bi_followers_count": 0, "domain": "", "avatar_large": "http://tp2.sinaimg.cn/3286717353/180/0/1", "verified_source": "", "ptype": 0, "statuses_count": 4, "allow_all_comment": true, "id": 3286717353, "verified_reason_url": "", "city": "8", "province": "11", "block_app": 0, "follow_me": false, "verified_reason": "", "followers_count": 1, "location": "\u5317\u4eac \u6d77\u6dc0\u533a", "verified_trade": "", "mbtype": 0, "verified_source_url": "", "profile_url": "u/3286717353", "block_word": 0, "avatar_hd": "http://tp2.sinaimg.cn/3286717353/180/0/1", "star": 0, "description": "", "friends_count": 4, "online_status": 1, "mbrank": 0, "allow_all_act_msg": false, "profile_image_url": "http://tp2.sinaimg.cn/3286717353/50/0/1", "idstr": "3286717353", "verified": false, "geo_enabled": true, "class": 1, "screen_name": "beyondzhou8", "lang": "zh-cn", "weihao": "", "remark": "", "favourites_count": 0, "name": "beyondzhou8", "url": "", "gender": "m", "created_at": "Tue Aug 20 00:41:09 +0800 2013", "verified_type": -1, "following": false }, "in_reply_to_status_id": "", "comments_count": 3, "geo": null, "id": 3687339672990740, "source": "<a href=\"http://weibo.com/\" rel=\"nofollow\">\u5fae\u535a weibo.com</a>" } ]
相关文章推荐
- 求助:php通过新浪微博接口 api 如果获取某一地区下所有用户的微博列表?或使用包含某一关键词的微博列表
- 无法获取到新浪微博中指定用户的第一条微博??
- Python:获取新浪微博用户的收听列表和粉丝列表
- Python:获取新浪微博用户的收听列表和粉丝列表
- 无法获取到新浪微博中指定用户的第一条微博??
- C#获取指定数据库服务器下某用户可访问的数据库列表
- 新浪微博APP开发应用示例之获取指定微博账户的微博内容记录
- python 获取指定文件列表
- python 获取指定用户的属主
- 新浪微博(十九)显示用户微博列表(WeiBoListActivity类)
- python获取的信息列表微信公共平台和用户头像
- 新浪微博APP开发应用示例之获取指定微博账户的微博内容记录
- Python 获取新浪微博的最新公共微博实例分享
- 获取某条新浪微博的所有转发用户列表(使用repost_timeline接口)
- 新浪微博数据挖掘食谱之十三: 微博篇 (批量获取用户的微博)
- 使用Python脚本获取指定格式文件列表的方法
- Python 获取新浪微博的最新公共微博
- 新浪微博接口,获取用户粉丝列表
- python中获取指定目录下所有文件名列表的程序
- 新浪微博客户端开发之授权登录+获取微博列表