-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathusers.jl
153 lines (82 loc) · 3.82 KB
/
users.jl
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#############################################################
#
# Users Functions
#
#############################################################
function get_account_settings(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/account/settings.json", options)
end
function get_verify_credentials(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/account/verify_credentials.json", options)
return to_USERS(r)
end
function post_account_settings(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/account/settings.json", options)
end
function post_update_delivery_device(device::String; options=Dict{String, String}())
#Add required parameter(s) to options dict
options["device"] = device
r = post_oauth("https://api.twitter.com/1.1/account/update_delivery_device.json", options)
end
function post_update_profile(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/account/update_profile.json", options)
end
function post_update_profile_background(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/account/update_profile_background_image.json", options)
end
function post_update_profile_colors(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/account/update_profile_colors.json", options)
end
#Need to enforce type around image as base64 encoded, not sure how
function post_update_profile_image(image; options=Dict{String, String}())
#Add required parameter(s) to options dict
options["image"] = image
r = post_oauth("https://api.twitter.com/1.1/account/update_profile_image.json", options)
end
function get_blocks_list(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/blocks/list.json", options)
return to_USERS(r["users"])
end
function get_blocks_ids(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/blocks/ids.json", options)
end
function post_blocks_create(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/blocks/create.json", options)
end
function post_blocks_destroy(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/blocks/destroy.json", options)
end
function get_users_lookup(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/users/lookup.json", options)
return to_USERS(r)
end
function get_users_show(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/users/show.json", options)
return to_USERS(r)
end
function get_users_search(q::String; options=Dict{String, String}())
#Add required parameter(s) to options dict
options["q"] = q
r = get_oauth("https://api.twitter.com/1.1/users/search.json", options)
return to_USERS(r)
end
function get_users_contributees(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/users/contributees.json", options)
return to_USERS(r)
end
function get_users_contributors(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/users/contributors.json", options)
return to_USERS(r)
end
function post_account_remove_profile_banner(; options=Dict{String, String}())
r = post_oauth("https://api.twitter.com/1.1/account/remove_profile_banner.json", options)
end
#Need to enforce type around image as base64 encoded, not sure how
function post_account_update_profile_banner(banner::String; options=Dict{String, String}())
#Add required parameter(s) to options dict
options["banner"] = banner
r = post_oauth("https://api.twitter.com/1.1/account/update_profile_banner.json", options)
end
function get_profile_banner(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/users/profile_banner.json", options)
end