-
Notifications
You must be signed in to change notification settings - Fork 246
/
mutes.go
54 lines (45 loc) · 1.61 KB
/
mutes.go
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
package anaconda
import (
"net/url"
"strconv"
)
func (a TwitterApi) GetMutedUsersList(v url.Values) (c UserCursor, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/mutes/users/list.json", v, &c, _GET, response_ch}
return c, (<-response_ch).err
}
func (a TwitterApi) GetMutedUsersIds(v url.Values) (c Cursor, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/mutes/users/ids.json", v, &c, _GET, response_ch}
return c, (<-response_ch).err
}
func (a TwitterApi) MuteUser(screenName string, v url.Values) (user User, err error) {
v = cleanValues(v)
v.Set("screen_name", screenName)
return a.Mute(v)
}
func (a TwitterApi) MuteUserId(id int64, v url.Values) (user User, err error) {
v = cleanValues(v)
v.Set("user_id", strconv.FormatInt(id, 10))
return a.Mute(v)
}
func (a TwitterApi) Mute(v url.Values) (user User, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/mutes/users/create.json", v, &user, _POST, response_ch}
return user, (<-response_ch).err
}
func (a TwitterApi) UnmuteUser(screenName string, v url.Values) (user User, err error) {
v = cleanValues(v)
v.Set("screen_name", screenName)
return a.Unmute(v)
}
func (a TwitterApi) UnmuteUserId(id int64, v url.Values) (user User, err error) {
v = cleanValues(v)
v.Set("user_id", strconv.FormatInt(id, 10))
return a.Unmute(v)
}
func (a TwitterApi) Unmute(v url.Values) (user User, err error) {
response_ch := make(chan response)
a.queryQueue <- query{a.baseUrl + "/mutes/users/destroy.json", v, &user, _POST, response_ch}
return user, (<-response_ch).err
}