-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple Twitter banner update throwing exception, but still updates banner #12
Comments
Huh. Makes sense that the update works, because that error is coming from the response handler (which is expecting the response to be map, but apparently it's a string). I can't imagine there's anything special about the POST account/update_profile_banner endpoint, so, weird.
|
I've done other api calls without issue like (twitter-api/user-settings
(twittier-api/users-profile-banner EDIT: I wrote this seeing what would happen. All of the work except the account-update-profile-banner (defn testing [tok sec]
(let [credentials (twitter-auth/map->UserCredentials {:user-token tok :user-token-secret sec :consumer-key "key" :consumer-secret "secret"})
image_location "https://pbs.twimg.com/profile_banners/1213616925156052993/1632396483/1500x500"
c1 (twitter-api/account-settings credentials)
c2 (twitter-api/users-profile-banner credentials :params {:screen_name "SasaCocic"})
c3 (twitter-api/followers-list credentials :params {:screen_name "SasaCocic"})
;; c4 - causes an the error
c4 (twitter-api/account-update-profile-banner credentials :params {:banner (.encodeToString (Base64/getEncoder) (:body (client/get "https://pbs.twimg.com/profile_banners/1213616925156052993/1632396483/1500x500" {:as :byte-array}) )) })
]
{:c1 c1
:c2 c2
:c3 c3
:c4 4})
)
Here's what I'm seeing from
also here's my project.clj dependencies
|
I'm trying to update my own twitter banner, but this exception keeps getting thrown. I've tried multiple different things, but I'm not convinced it's my code anymore. It's totally possible I'm making some mistake still. I've included what I think is a very simple call to the api that isn't working.
Ideally I could make the call without the exception popping up.
EDIT: also I know the code is partly working because it's still updating my Twitter banner.
The text was updated successfully, but these errors were encountered: