Change thumbnail size in Google custom search API result - thumbnails

I'm using Google Custom Search API for searching images to display in my website. But the thumbnail images are too small and I could not find a way to control the thumbnail size. Here is a response for my query:
{
"kind": "customsearch#result",
"title": "Big Ben Street London United Kingdom Photo Shared By Halsy16 ...",
"htmlTitle": "Big Ben Street \u003cb\u003eLondon United Kingdom\u003c/b\u003e Photo Shared By Halsy16 \u003cb\u003e...\u003c/b\u003e",
"link": "http://www.fansshare.com/photos/london/big-ben-street-london-united-kingdom-784722294.jpg",
"displayLink": "www.fansshare_com",
"snippet": "Robert Pattinson's new London",
"htmlSnippet": "Robert Pattinson's new \u003cb\u003eLondon\u003c/b\u003e",
"mime": "image/jpeg",
"image": {
"contextLink": "http://www.fansshare_com/gallery/photos/10677077/big-ben-street-london-united-kingdom/",
"height": 640,
"width": 1024,
"byteSize": 80611,
"thumbnailLink": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSZJRKQ-yIiSt1FCeYdBKLUEft54xHJo095_r9-rN8OrILnOZPnJZvcwNsG",
"thumbnailHeight": 94,
"thumbnailWidth": 150
}
Can someone please tell me if there's a way to get a bigger thumbnail? Or are there any alternative ways to display the search results like in Google Image Search?
Thank you very much!

I'm assuming you're using the Google Custom Search API since the Image API is deprecated.
There is no way to tell Google to serve a bigger thumbnail size AFAICS, but you have two possible workarounds:
use the image url as a CSS background-image property to an element of your chosing (for example, a div with class "portrait"), and use background-position:cover to make sure the image is scaled up or down to cover the whole element screen estate (Here is an example : Andy Warhol 's portrait is fetched via Google)
link to the full image instead of the thumbnail (the linkquery parameter you have in your example) (but that can be hazardous since you'll have to avoid huge and too small images)
Make sure to experiment with the api Explorer and its parameters.

Related

update my map with uploaded mbtiles tilesets Mapbox API

I want to update a custom map on Mapbox with my uploaded tilesets by the Mapbox API. The MBtiles were uploaded by using the mapbox-Python-SDK and stored as tilesets.
I need to get these Tilesets to a custom map by a script (The Files are Georeferenced pictures from a Drone, which I want to get displayed automatically on my map). Some kind of Livemapping. It works easy in the Mapbox Studio with the "Add tileset to style" - button, but I need to do it by the API.
I have no clue what's the best way to do it. Any Suggestions ?
You can add the source at runtime with map.addLayer, or map.addSource and then map.addLayer as in this example https://www.mapbox.com/mapbox-gl-js/example/query-similar-features/ (although in your case it sounds like your source would be of type: 'raster').
map.addSource("drone", {
"type": "raster",
"url": "mapbox://username.sourceid"
});
map.addLayer({
"id": "drone-layer",
"type": "raster",
"source": "drone"
});

Why can't I share this video on Facebook?

This is what I'm doing:
FB.ui({
method:       "feed",
link: "https://link-to-site.ninja",
source:       "https://url-to-s3-hosted-video.mp4",
caption:      "Video caption",
type:         "video",
description:  "Video desc"
}, function(response){});
(Also tried different combinations, with and without picture, in which case what would end up showing was the picture and not the clickable video)
And I'm getting either no preview whatsoever, or just the preview image if I provide one, not an actual clickable previewable video. What am I doing wrong? How do I can I get this right?
Thanks!
Turns out you need to put the source as link and it will work (as of 05/2016) but you cannot make it link to another place that's not the video itself.

How to change facebook app icon

I can't seem to find the right location of the settings since facebook redesigned admin panel ... screenshots appreciated , I can only change screenshots and banners but not the app icon itself
thanks
https://developers.facebook.com/apps/[your-app-id]/app-details/ -> "logo" is the way to go. If you uploaded a logo a while ago, it may look like the option to change it is not available, because your old logo isn't showing up (it's just a standard facebook image). That's because your old logo is probably too small. Upload a new logo, and your logo will change.
Info: It's not necessary to submit your app for approval first.
Update: Since "logo" is no longer listed as an option, I assume they have changed the setup form slightly...
New link:
https://developers.facebook.com/apps/[your-app_id]/app-details/.
Under the section: "Icons"...
Heres the docs
Scroll to the next section to see something which might be of interest too:
Promotional images (Cover image & Banners).
NOTE: You may have to do some image editing before uploading to meet the dimension restrictions they have in place (at the time of this post: 1024 x 1024 and size <= 5MB).

How are text images processed by Facebook?

This code is processed as goku image on FB chat:
[[236823566443944]][[236823583110609]][[236823586443942]][[236823596443941]][[236823609777273]]
[[236823629777271]][[236823636443937]][[236823649777269]][[236823663110601]][[236823673110600]]
[[236823683110599]][[236823686443932]][[236823696443931]][[236823699777264]][[236823709777263]]
[[236823716443929]][[236823733110594]][[236823736443927]][[236823749777259]][[236823753110592]]
[[236823756443925]][[236823759777258]][[236823769777257]][[236823779777256]][[236823783110589]]
[[236823789777255]][[236823793110588]][[236823796443921]][[236823806443920]][[236823809777253]]
How FB creates image from this? I found the code on symbols-n-emoticons in comments below, copied&pasted into FB chat and - black magic - the image was there.
So I took your example and did some testing. If yout right click on the image in chat and look at it URL, you can find following:
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/227547_236823636443937_1841629131_n.jpg
It's one tile from the goku image. The middle part of the URL corresponds to one value in you code. So this code are actually shortcuts to images stored on FB servers, and the chat window simply replaces the code with image.
I think it could be due to latest update in FB, which allows you to attach images directly to posts.
[EDIT]
I have tried several other images and it worked for all images hosted akamaihd.net aka Facebook hosting. Just grab the secod number and past it in chat in double brackets.
The image is always resized to 16x16px, hence the code for Goku is so long, it's actually made from tiles.

Facebook RSS Feed big image

Helle every one,
I'm currently working with a Facebook page RSS feed and I need to retrieve images on it.
the problem is that those images are just thumbnail. I would like to donwload the big one.
For exemple I have these feed : https://www.facebook.com/feeds/page.php?id=126044397444435&format=rss20
I have this image on the feed : https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/393656_257350694313804_126044397444435_712409_344887174_s.jpg
But I would like this one : https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s320x320/393656_257350694313804_126044397444435_712409_344887174_n.jpg
How can I solve this problem ?
Thanks !
Look at the URLs
https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/393656_257350694313804_126044397444435_712409_344887174_s.jpg
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s320x320/393656_257350694313804_126044397444435_712409_344887174_n.jpg
The subdomain for the large image is fbcdn-sphotos-a instead of fbcdn-photos-a, it has a s320x320 directory name inserted before the filename, and the filename is suffixed with _n instead of _s
The 320x320 is a max size, the following url returns the image at 480 px height
https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/s480x480/393656_257350694313804_126044397444435_712409_344887174_n.jpg