-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtimelines.jl
53 lines (33 loc) · 1.69 KB
/
timelines.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
#############################################################
#
# Timelines Functions
#
#############################################################
function get_mentions_timeline(; options=Dict{String, String}())
#TODO: This method can only return 800 tweets maximum, 200 at a time
#TODO: Incorporate paging to retrieve all 800 tweets, as well as warning message for trying to retrieve too many
r = get_oauth("https://api.twitter.com/1.1/statuses/mentions_timeline.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end
function get_user_timeline(; options=Dict{String, String}())
#TODO: Warning/Error message that a screen_name or user_id must be specified for each function call
#TODO: Incorporate paging to retrieve all 3200 max tweets, as well as warning message for trying to retrieve too many
r = get_oauth("https://api.twitter.com/1.1/statuses/user_timeline.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end
function get_home_timeline(; options=Dict{String, String}())
#TODO: This method can only return 800 tweets maximum, 200 at a time
#TODO: Incorporate paging to retrieve all 800 tweets, as well as warning message for trying to retrieve too many
r = get_oauth("https://api.twitter.com/1.1/statuses/home_timeline.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end
function get_retweets_of_me(; options=Dict{String, String}())
#TODO: Warning message if count > 100
#I think you can request 100 in one shot, no need for paging
r = get_oauth("https://api.twitter.com/1.1/statuses/retweets_of_me.json", options)
#Return array of type TWEETS
return to_TWEETS(r)
end