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
How/does "Convert Image URLs to Attachments" work? #1
Comments
Looking at the code, I see you match for http:// but not https://
You may want to add https:// as well. If I modify it I'll send you a pull request. I tried it with the following row, and the log still reported the tweet was too long. Looking further in the code. |
It seems that this line, is suspect:
as it never seems to be true even when the "Convert Image URLs to Attachments" field in the Settings tab is set to Yes. (I couldn't find where I tried commenting out this condition so it would always trigger if there was an image url
At that point, I got a new logged error which seems associated with the actions of
Any ideas? |
I notice that it is failing to authenticate to api.twitter.com not upload.twitter.com. Does that mean it successfully uploaded the media and then failed to send the tweet itself? Just to check, I removed the image URL and sent a test tweet and it tweeted successfully. Then failed on the next tweet with an image URL. Hmm. |
Looking at the script logger, I see:
So it appears that it successfully uploaded the image payload, got a media ID, and then failed to upload the tweet? Just to experiment, I revoked Twitter app authorization, test tweeted a tweet with an image URL, got the authorization screen, gave permission, and it still failed in the same way. |
By the way, I replaced the match and replace regex to:
though I have yet to test it properly because of the other problem that refused to let me tweet an image attachment. |
Further diagnosing, found the problem with properties.img:
should be
|
Okay, Zach, I may have discovered the problem. There are characters at the end of the Image URL that need to be extracted before the Tweet will successfully tweet. While I added some more logging output, the most important three changes I made were: 1/ handle https and caps in getMediaIds:
2/ fix properties.img in doTweet:
3/ handle https, caps, and trailing characters/query strings in image URLs in doTweet:
So altogether, the new version (0.5.2?) looks like this:
|
If you want to see it working after I fixed above issue: https://twitter.com/peoplesriver |
…n checking if tweet contains an image url or not.
The remainder of this suggestion has actually been incorporated into the code already. |
This should fix the "Cannot read property [0.0] from undefined" error
Hi Zach,
Thanks for the project.
Does Convert Image URLs to Attachments work? If so, how?
I turned the Settings option "Convert Image URLs to Attachments" to Yes. I included the image URL in a row of the "Every __" sheet, as in:
hoping it would be converted to an attachment. But the log showed that it failed because the tweet was too long (though that shouldn't matter if it is an attachment).
Then, as a test, I tried shortening the tweet to:
to see if it would attach the image. It teweeted successfully, but it appeared as a link in the tweet not an image attachment.
The legacy version has great instructions, but version 0.5.1 has no docs that I've found.
How do I have the script attach an image?
Thanks.
The text was updated successfully, but these errors were encountered: