-
Notifications
You must be signed in to change notification settings - Fork 70
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
schedule twitter #17
Comments
It should happen automatically, since the library stores credentials in the property store that you set. Just use the same getService() function in both cases to ensure the settings are the same. |
I think I've not explained myself well enough. I'll put some code down below to illustrate. First up I have the functions to authorize (function AUTHORIZE() being the one that's called initially) function AUTHORIZE() { function oAuth() { next the function that schedules my tweets:
} The checkschedule function will gather the data and finally call out the function sendouttweets:
var imgurlenc = encodeURIComponent(imgurl); var imageurl = UrlFetchApp.fetch(imgurl); var requestBody = Utilities.newBlob( requestBody = requestBody.concat(imgdatablob.getBytes()); var optionsimg = { var uploadimgres = service.fetch("https://upload.twitter.com/1.1/media/upload.json", optionsimg);
} It's in this last function that I have to somehow use a oauth object. Do I need to do the oAuth() function again? And if so, doesn't that trigger that callback again? |
Yes, you should just call the oAuth() function again. It doesn't automatically trigger the OAuth flow, and service.hasAccess() should be true. |
Ok, so I added following code:
to first that the access and if true, to upload the image, but I get a hasacc = null. I feel i'm missing something :p |
Hi, I'm using this library to connect my google spreadsheet with twitter so I can schedule my tweets. I have a function that authorizes my app. Then I schedule my tweets and use a trigger to send out the tweets. However, in the function that sends them out, I somehow have to get such a oauth object without going through the whole authenticating process again. Can someone help me with this?
The text was updated successfully, but these errors were encountered: