-
Notifications
You must be signed in to change notification settings - Fork 19
/
examples.py
92 lines (82 loc) · 1.87 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env python
# encoding: utf-8
import doubanrobot
email = '[email protected]'
password = 'password'
auth = doubanrobot.Auth(email, password)
# 个人相关接口
people = doubanrobot.People(auth)
# 发状态
# people.talk_status("hhhhhh")
#
# 发豆邮
# people.send_doumail("66902522", 'Hallo, linsir.')
#
# 获取关注的人
# print(people.get_contacts_list())
#
# 获取关注我的人
# print(people.get_contacts_rlist())
#
# 取消关注
# people.remove_contact("66902522")
#
# 关注
# people.add_contact("66902522")
#
## 关注已注销的用户
# people.add_contact("76326966")
#
# 获取黑名单
# print(people.get_blacklist())
#
# 添加到黑名单
# people.add_to_blacklist("76326966")
#
# 移出黑名单
# people.remove_from_blacklist("76326966")
# 小组相关接口
group = doubanrobot.Group(app)
# 获取加入的小组
# print(group.get_joined_groups())
#
# 加入不需要验证的组
# group.join_group("TurboGears")
#
# 加入需要验证的组
# group.join_group("343477", "申请加入!!!")
#
# 退出小组
# group.quit_group("TurboGears")
#
# 我发起的帖子列表
# print(group.get_my_publish_topics(reply=False))
#
# 我回复的帖子列表及回应数
# print(group.get_my_reply_topics(reply=False))
#
# 删除我发起的帖子(会删除所有评论)
# group.delete_my_topic("129875286")
# for topic in my_topics:
# group.delete_topic(topic)
#
# 获取帖子评论列表
# group.get_other_comments_list("41603339", 155)
#
# 获取帖子我回应评论列表
# group.get_reply_comments_list("81705524")
#
# 发表新帖子
# group.new_topic("centos", "test", "hahah.")
#
# 抢沙发
# group.sofa("CentOS",['aaaa', 'bbbb', 'cccc'])
#
# 顶帖子
# group.topics_up(["129875286"],['xxx', 'yyy', 'zzz'])
#
# 删除所有回应的评论
# group.delete_reply_topic_comments()
#
# 删除所有发布的帖子
# group.delete_my_publish_topics