Google Docs Thumbnails link missing on upload without conversion - google-docs-api

I have been using the Gdocs API to upload images without conversion. In the response, I used to see a thumbnail entry under feed.entry.link[x]. This appears to be missing since 2 days ago. Does anyone know if a change has been made to the API? Is there an alternate method of getting the thumbnail URL of an uploaded file?
Thanks!
Roderick Forsythe

I'm not aware of any change to the API, the thumbnail should still be available as the link with rel="http://schemas.google.com/docs/2007/thumbnail".
Can you show us your request and the response which doesn't include the thumbnail link?
EDIT: It takes a short amount of time before the thumbnail gets generated and you might not get it in the response of the creation request. It will show up if you GET the resource after you create it.

Related

Zapier: How to post tweets from trello multiple attachments of images?

I am using a zapier zap to post tweet from trello card added to a specific list.
The description part goes to tweet text and attachment image goes to image of tweet.
In case of one image attachment works well. I use zapier formatter to extract an image url from trello card's attachment.
But I want to tweet more than 1 images. In that case zapier pass the multiple attachments as one zipped file contains attached images. So it fails to pass it to the twitter as invalid media format because it is zipped format but not image format just like .jpg, or .png.
How can I implement this?
Thank you in advance.
What you're describing is expected behavior in how the hydration process is handled for multiple images.
You might be able to use a third-party service like - https://zapier.com/apps/convertapi/integrations app to get these files unzipped within the editor.
With that said, afaik, unless you're creating your own private dev Twitter app, the main app only able to accept one image per post at the moment.

Google Drive API v3 for iOS : How to get thumbnails?

In the past, with Google Drive API v2, I could easily get thumbnails for pictures or videos with the property thumbnailLink on GTLDriveFile.
But now, with the API v3 which I currently use with Swift, the thumbnailLink of the files I get from Google Drive is nil, so what can I do to get thumbnails of images and videos stored in the user's Google Drive. I need to display theses in my iOS app.
Make sure to specify thumbnailLink in fields, such as
let query = GTLQueryDrive.queryForFilesList()
query.fields = "files(id, name, thumbnailLink)"
then you can access the property thumbnailLink for images and videos
You'd have to use the Drive REST API method Files: get. The result of that method contains thumbnailLink but according to the documentation it is 'a short-lived link to the file's thumbnail. Typically lasts on the order of hours.
Alternatively, you can cache the thumbnail in your application, reducing the count of drive api requests and thus improve your page performance. You need to fetch the information for the uploaded file. The easiest way of caching is to simply download the thumbnail and save it like fileid_thumb somewhere and upon the next request, you check if such a file exists before actually requesting the thumbnail. Check here the detailed explanation.
You can also upload a thumbnail by setting the contentHints.thumbnail property on the File resource during an insert or update call as follows:
Set contentHints.thumbnail.image to the URL-safe Base64-encoded image (see RFC 4648 section 5)
Set contentHints.thumbnail.mimeType to the appropriate type for the image format
You can also check the accepted answer in this SO question.
Hope this helps!

Post image base64 from iOS to twitter using request.js

I am working on iOS. In my app user can take photo and upload from Library then it will store as image base64 in database. I want to post this image into Twitter when I select from database. But I always get error message below
{"errors":[{"code":189,"message":"Error creating status."}]}'
I have found a post below really familiar my problem but I still could not make it works.
Twitter update with media with request.js
Much appreciate for your help!
Finally, I found this solution under this post:
Twitter image upload error : media parameter is missing
But one thing to note: make sure your image base64 is not contained full path. This driven me very crazy until I found it. Real example for me
var imageBase64 = data:image/jpeg;base64,4793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b43984983437493747394793747394739473943473734793743...................................................................7979
It is not working. So I have to split as below:
var splitImageBase64 = imageBase64.split(",")[1];
Then it works.
I hope this may help someone else.

Youtube upload api duplicated video (get the right ID)

When a video is duplicated (let's say v = GgVH5fXXYSE) , is there a way i can find the videoid of the "good" one (the one that should work) with the duplicated id.
(so with GgVH5fXXYSE i could find eNqZgEgOfsw)
Thanks!
Unfortunately, there's no way to get this information. It's come up as a feature request a number of times in the past, and there are technical reasons why this can't be exposed in the YouTube Data API response.
If you have APP, that solely uploads file to particular (authorized) youtube account(s), then you can get it done using following method. Maintain a hash of all input files and while uploading file, check ,if you have old file having same hash as current file upload, and that old file was uploaded successfully, then don't upload that file and use youtube link = old file's ( having same hash as current file) youtube link.

get thumbnails of a website from their urls

I want to save the thumbnails of a website by just entering their urls , e.g if I enter http://www.google.com , it should generate the thumbnail of the google search page .
One such API that I was using till now is http://counter2.goingup.com/thumboo/image.php.
A sample url for that :
http://counter2.goingup.com/thumboo/image.php?i=1f899e4e1abf9473ccae69de4f3ec1ca|||www.google.com|||80x50
But , off late it's showing the error "URL not found" . Do anybody know what exacly has gone wrong with this API ?
Is there any other such convenient third party API out there which can be of some help to me . By convenient , I mean, it should not show a lame Screenshot queued up message everytime it fails to find any pre-existent snapshot for that website in their db.
Use PhantomJS to create screenshots. PhantomJS comes with an example called rasterize.js, which does exactly this. Example:
phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png
Docs here. Related projects including web services here.
http://snapit.io works well, and gives you historical caching on a CDN. For example this URL would look like
http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls
if you wanted a thumbnail of 200x200 pixels (keeping aspect ratio) you could do
http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls&max_width=200&max_height=200
There's a lot of other services just like this out there, most require a subscription for any substantial amount of use though (including snapit.io), http://url2png.com, http://www.shrinktheweb.com, http://www.thumbalizr.com.

Resources