Closed juxtin closed 9 years ago
thanks for doing this
No problem, thanks for the library! Do you have any plans to release a new version to Clojars soon?
I did today
On Wednesday, December 24, 2014, Justin Holguin notifications@github.com wrote:
No problem, thanks for the library! Do you have any plans to release a new version to Clojars soon?
— Reply to this email directly or view it on GitHub https://github.com/adamwynne/twitter-api/pull/60#issuecomment-68071190.
For many endpoints, it's possible to authenticate with just the application credentials and no user credentials at all. In this case, the application has its own separate rate limit (sometimes higher than the user-authenticated version), so it's possible to make at least twice as many requests per 15-minute period if one uses both the application-only and user-authenticated credentials. See Twitter's docs.
This commit extends
make-oauth-creds
with a new arity that takes two arguments: theapp-key
andapp-secret
, returning the application-only token. Theget-request-args
andoauth-header-string
functions are similarly extended to properly handle the application-only auth map.Finally, the
is-200
macro is extended to take an optional:app-only
arg, which causes the given function to be called with application-only credentials (seemake-app-only-test-creds
). I added additional tests using this macro where appropriate.