Foursquare venue image not displaying - foursquare

I have created an app in foursquare, I have the client_id and client_secret key. I need all the venues details. I can only get the venue info, but cannot get the image linked to it.
Please help me . Thanks in advance
https://api.foursquare.com/v2/venues/40a55d80f964a52020f31ee3?client_id=client_id&client_secret=client_secret&v=20161201

In the venue details response there is a photos object under response['photos'] that contains an array of venue photos. To construct the photo url we have documentation here.
From the docs:
To assemble a resolvable photo URL, take prefix + size + suffix, e.g.
https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.
size can be one of the following, where XX or YY is one of 36, 100,
300, or 500.
XXxYY
original: the original photo's size
capXX: cap the photo with a width or height of XX (whichever is larger). Scales the other, smaller dimension proportionally
widthXX: forces the width to be XX and scales the height proportionally
heightYY: forces the height to be YY and scales the width proportionally

you can get photos of a specific venue by this API
http://api.foursquare.com/v2/venues/VENUE_ID/photos?limit=5&client_id=Client_Id&client_secret=Client_Secret&v=20161107

Related

Image gets cropped while replacing image in google docs using google doc api

I'm trying to replace the image using google doc api. Image is replaced but it takes the dimensions of previous and so gets cropped.
I also tried by providing height and width but it didn't work.
When I reset the image manually in google doc then the full image is showing in doc and after reset image, its height and width can be changed accordingly. But google doc API did not provide an option to reset image.
Here is a little code which replaces the image in a Google doc :
"replaceImage": {
"imageObjectId": IMAGE_ID",
"uri": REPLACED_IMAGE_URL,
"imageReplaceMethod": IMAGE_REPLACE_METHOD,
}
Is there any possible way to replace the image so that it can replace the previous image properly.
Thanks.
I don't think it is possible to avoid cropping when using the replaceImage request. As it can be seen in the official documentation, the only valid value for imageReplaceMethod is CENTER_CROP, which "Scales and centers the image to fill the bounds of the original image. The image may be cropped in order to fill the original image's bounds. The rendered size of the image will be the same as that of the original image.".
I hope this is of any help.

Can you get the high resolution cover photo for your page through the Graph API?

When I get the cover photo for my page, for example (with Node.js):
FB.api(pageId, { fields: cover } )
The resulting JSON has a source property which is an image, but it's 720 by 405 and has JPG artifacts. When I inspect the actual Facebook page in the browser it uses a clearer 1920 by 1080 image.
How do I get that with the API?
One of the properties on the cover is an id. You can fetch this endpoint with the images field to return an array of sizes for that image, from 1080 height down to 130 (as of this writing).
FB.api(coverId, { fields: images } )
Unfortunately that's 2 requests to get 1 image - if anyone knows a better way, please let me know.

glide thumbnail for ImageView with fixed width but height wrap_content

I have been trying to implement a feed App like Instagram or Facebook. ImageViews have match_parent width (screen width) and wrap_content height.
The code I have used...
Glide.with(context)
.load(imageURL)
.thumbnail(0.1f)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imageView)
;
That results into loading thumbnail first. The thumbnail is very small in size. I was expected that the thumbnail will display a faded image with the original image height.
Without thumbnail, the ImageViews do not populate any image (when loading) and then suddenly the original images comes into picture. I cannot use any place holder image as the height of the place holder image may not match the actual image to be loaded, makes it a bad user experience.
I have also tried...
Glide.with(context)
.load(imageURL)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(null)
.into(imageView)
;
But it is not working! I was wondering how the Instagram App does those fade in loading with images (with original image height)?
I have looked into various websites including the Glide Github issues and stack overflow, but unable to find any solution! I have already wasted about 6 hours of my day. What is the way out of this problem?
Use override attribute:
Glide.with(context)
.load(imageURL)
.override(18,18)
.thumbnail(0.1f)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imageView);
Also as Instagram is owned by Facebook it might be the case that they use Fresco library (not sure though).

How can increase size of background image in Adaptive card for bot emulator?

I am creating a adaptive card with background image, i want to increase the size of the background image as 400X400.
AdaptiveCard card = new AdaptiveCard();
card.BackgroundImage = "https://www.w3schools.com/html/img_girl.jpg";
// Body content
// Add text to the card.
card.Body.Add(new TextBlock()
{
Text = "Hiya, I am testing Adaptice card background image. <a>https://www.google.co.in</a>",
Size = TextSize.Large,
Weight = TextWeight.Bolder
});
I am testing with bot emulator.
AFAIK, this feature is not supported for now, the background image will automatically cover the AdaptiveCard from card's top-left-corner, it will firstly be scaled to fit the available width and in the meantime keep its original aspect ratio. And card's rendering depends on different clients, some clients limits the height of card and some doesn't. For bot emulator, it will not limit the height of card, so the card's height will increase along with the content of AdaptiveCard.
So, if your image for background is not high enough than card's height, it can not cover the whole and if it is higher, the down part of image will be clipped.
This is how background image works for now, there is no method to control its size in our bot.

Continuously scrolling caroufredsel ticker with variable width items

I would like to create a continuously scrolling ticker which has got variable width items in it. This is going to be used for a news ticker where the news items are aligned one after each other depending on their width according to the news title length. I would need them to continuously scroll towards the left in a continuous manner in an equal, linear easing manner.
Is this possible through caroufredsel?
Set duration to .1
$("#foo").carouFredSel({
scroll: {
duration: 0.1
}
});
Source:
http://support.dev7studios.com/discussions/caroufredsel/UC-951092
Please have a look at this demo:
http://coolcarousels.frebsite.nl/c/23/
Try to check this example
http://caroufredsel.dev7studios.com/examples/continuously-scrolling.php
I think you just need to add - items: {width: "variable"} - and will work

Resources