Created
November 23, 2014 04:00
-
-
Save randyzwitch/062cf28ed1da503c36e9 to your computer and use it in GitHub Desktop.
Update: Macros in Julia for code refactoring
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
macro endpoint(name, path) | |
quote | |
function $(esc(name))(; options=Dict{String, String}()) | |
r = get_oauth($"https://api.twitter.com/1.1/$path", options) | |
return r.status == 200 ? JSON.parse(r.data) : r | |
end | |
end | |
end | |
@endpoint get_help_configuration "help/configuration.json" | |
@endpoint get_help_languages "help/languages.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment