Last active
August 29, 2015 14:09
-
-
Save randyzwitch/ac7addbb6f2ddf6f6651 to your computer and use it in GitHub Desktop.
Metaprogramming in Julia
This file contains hidden or 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
| funcname = (:get_help_configuration, :get_help_languages, :get_help_privacy, :get_help_tos, :get_application_rate_limit_status) | |
| endpoint = ("help/configuration.json", "help/languages.json", "help/privacy.json", "help/tos.json", "application/rate_limit_status.json") | |
| for (func, endp) in zip(funcname, endpoint) | |
| @eval function ($func)(; options=Dict{String, String}()) | |
| r = get_oauth($"https://api.twitter.com/1.1/$endp", options) | |
| return r.status == 200 ? JSON.parse(r.data) : r | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment