-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathdm.jl
55 lines (32 loc) · 1.29 KB
/
dm.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
#############################################################
#
# Direct Messages Functions
#
#############################################################
function get_direct_messages(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/direct_messages.json", options)
return to_TWEETS(r)
end
function get_direct_messages_sent(; options=Dict{String, String}())
r = get_oauth("https://api.twitter.com/1.1/direct_messages/sent.json", options)
return to_TWEETS(r)
end
function get_direct_messages_show(id::String; options=Dict{String, String}())
#Add required parameter(s) to options dict
options["id"] = id
r = get_oauth("https://api.twitter.com/1.1/direct_messages/show.json", options)
return to_TWEETS(r)
end
function post_direct_messages_destroy(id::String; options=Dict{String, String}())
options["id"] = id
r = post_oauth("https://api.twitter.com/1.1/direct_messages/destroy.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end
function post_direct_messages_send(text::String; options=Dict{String, String}())
#Add status into options Dict
options["text"] = text
r = post_oauth("https://api.twitter.com/1.1/direct_messages/new.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end