-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use metaprogramming to generate GET endpoints having no required arguments
- Loading branch information
1 parent
1ed9c55
commit 3600d4f
Showing
13 changed files
with
67 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
language: julia | ||
os: | ||
- linux | ||
- osx | ||
julia: | ||
- 0.6 | ||
- nightly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
######################################################################### | ||
# | ||
# Endpoints with no required arguments | ||
# | ||
######################################################################### | ||
|
||
endpoint_tuple = [ | ||
(:get_oauth, :get_help_configuration, "help/configuration.json"), | ||
(:get_oauth, :get_help_languages, "help/languages.json"), | ||
(:get_oauth, :get_help_privacy, "help/privacy.json"), | ||
(:get_oauth, :get_help_tos, "help/tos.json"), | ||
(:get_oauth, :get_application_rate_limit_status, "application/rate_limit_status.json"), | ||
(:get_oauth, :get_profile_banner, "users/profile_banner.json"), | ||
(:get_oauth, :get_blocks_ids, "blocks/ids.json"), | ||
(:get_oauth, :get_account_settings, "account/settings.json"), | ||
(:get_oauth, :get_oembed, "statuses/oembed.json"), | ||
(:get_oauth, :get_trends_available, "trends/available.json"), | ||
(:get_oauth, :get_user_suggestions, "users/suggestions.json"), | ||
(:get_oauth, :get_saved_searches_list, "saved_searches/list.json"), | ||
(:get_oauth, :get_lists_subscribers_show, "lists/subscribers/show.json"), | ||
(:get_oauth, :get_friendships_no_retweets, "friendships/no_retweets/ids.json"), | ||
(:get_oauth, :get_friends_ids, "friends/ids.json"), | ||
(:get_oauth, :get_followers_ids, "followers/ids.json"), | ||
(:get_oauth, :get_friendships_lookup, "friendships/lookup.json"), | ||
(:get_oauth, :get_friendships_incoming, "friendships/incoming.json"), | ||
(:get_oauth, :get_friendships_outgoing, "friendships/outgoing.json"), | ||
(:get_oauth, :get_friendships_show, "friendships/show.json"), | ||
(:get_oauth, :get_direct_messages, "direct_messages.json"), | ||
(:get_oauth, :get_direct_messages_sent, "direct_messages/sent.json"), | ||
(:get_oauth, :get_favorites_list, "favorites/list.json"), | ||
(:get_oauth, :get_friends_list, "friends/list.json"), | ||
(:get_oauth, :get_followers_list, "followers/list.json"), | ||
(:get_oauth, :get_lists, "lists/list.json"), | ||
(:get_oauth, :get_lists_statuses, "lists/statuses.json"), | ||
(:get_oauth, :get_lists_memberships, "lists/memberships.json"), | ||
(:get_oauth, :get_lists_subscribers, "lists/subscribers.json"), | ||
(:get_oauth, :get_lists_members_show, "members/show.json"), | ||
(:get_oauth, :get_lists_members, "lists/members.json"), | ||
(:get_oauth, :get_lists_show, "lists/show.json"), | ||
(:get_oauth, :get_lists_subscriptions, "lists/subscriptions.json"), | ||
(:get_oauth, :get_lists_ownerships, "lists/ownerships.json"), | ||
(:get_oauth, :get_mentions_timeline, "statuses/mentions_timeline.json"), | ||
(:get_oauth, :get_user_timeline, "statuses/user_timeline.json"), | ||
(:get_oauth, :get_home_timeline, "statuses/home_timeline.json"), | ||
(:get_oauth, :get_retweets_of_me, "statuses/retweets_of_me.json"), | ||
(:get_oauth, :get_verify_credentials, "account/verify_credentials.json"), | ||
(:get_oauth, :get_blocks_list, "blocks/list.json"), | ||
(:get_oauth, :get_users_lookup, "users/lookup.json"), | ||
(:get_oauth, :get_users_show, "users/show.json"), | ||
(:get_oauth, :get_users_contributees, "users/contributees.json"), | ||
(:get_oauth, :get_users_contributors, "users/contributors.json") | ||
] | ||
|
||
for (verb, func, endp) in endpoint_tuple | ||
@eval begin | ||
function ($func)(; options=Dict{String, String}()) | ||
|
||
r = ($verb)($"https://api.twitter.com/1.1/$endp", options) | ||
|
||
return r.status == 200 ? JSON.parse(String(r.data)) : error("Twitter API returned $(r.status) status") | ||
|
||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.