I'm trying to get a thumbnail of flickr pictures in PHP.
All I saw was this in their API:
http://www.flickr.com/services/api/misc.urls.html
Which is a overkill. In instagr.am/twitpic and others I found a very easy way of doing so (just adding to the url the request).
Is there an option with flickr I'm missing?
If you have the URL to the Flickr image, all you have to do is modify the suffix to get a different size of the photo. For example:
http://farm1.staticflickr.com/2/1418878_1e92283336_m.jpg
This URL loads the medium sized photo. If we simply change the _m to _t, we would get the thumbnail:
http://farm1.staticflickr.com/2/1418878_1e92283336_t.jpg
You can also use s for small, z for medium, and b for large.
You could just use a PHP wrapper around Flickr API and keep it simple - http://phpflickr.com/
You can parse the photo's ID out of the URL and get the thumbnail URL via flickr.photos.getSizes. This is likely how Twitpic/Instagram handle it.
For future readers, flickr doesn't support the simple functionality that other photo sharing services does. So the answer to my question is you can't.
If you know the username of the flickr user you can try to use this small bot. It uses the feed to retrieve the last images of the user, so it works only on the last images... I hope it will help you.
Related
I'm trying to publish an image from URL with Twitter API and PHP but I can't do it.
I have seeked in many post but I could find only how to upload an image.
Is possible to do it?
As you have discovered, this is not possible.
One way around it is for you to download the image first, and then upload it.
For example
file_put_contents("temp-img.jpg", file_get_contents("http://example.com/flower.jpg"));
Then, using whichever Twitter library you have, you can post temp-img.jpgdirectly.
I'm using the following URL to search eBay:
http://open.api.ebay.com/shopping?callname=FindPopularItems&version=849&siteid=3&appid=app_id_removed8&MaxEntries=100&ItemSort=EndTime&ItemType=FixedPriceItem&IncludeSelector=SearchDetails&responseencoding=XML&QueryKeywords=breaking+bad&HideDuplicateItems=true&outputSelector=PictureURLLarge&descriptionSearch=false
It works, but the gallery images it returns are so small.
e.g.
http://thumbs1.ebaystatic.com/pict/2311096735168080_1.jpg
How can i make it return large images?
I've read this: eBay API - How to get large item pictures?
Which suggested I add &outputSelector=PictureURLLarge&descriptionSearch=false but I just get the same response.
FPI is an old API call and doesn't support a lot of the parameters that newer API calls allow, such as an output selector, item sorting, description search, etc.
To get larger images, you may need to use a simple brute force find/replace on the thumbnail URLs.
If you search/replace "8080_" with "4040_" or "9696_" you'll get larger images. Try it right now in your browser with any eBay item# and it should work.
See "eBay API Gallery Image Resizing" on my eBay tech tips site for more info on this.
I am trying to use the Facebook graph api to publish a swf file on my wall, and was wondering if there is anyway I can control the height of the swf file. It looks like facebook sets the height to 259px automatically. Any help would be really appreciated!
Thanks.
Facebook will automatically set the size to width:398px;height:259px.
The movie will be stretched to accomodate this.
If your movie is a different size, the best thing to do is to make sure it is at least the same aspect ratio.
The answer was to use the still not completely deprecated REST api, which has that functionality.
I'm trying to integrate the Flickr API with Jquery Gallerific. If you're familiar with Gallerific you know photos in the Gallery can have a caption. I'm trying to pull photos from a specific set from a user using flickr.photosets.getPhotos to get thumbnails. However, with this method it's not possible to get description for each thumbnail, only for the set so I'm having to run flickr.photos.getInfo for each photo in the set, which works but is pretty much useless as a page takes 10+ seconds to load. Does anyone know how to obtain flickr photos from a set with the individual description for each photo? I've looked through the API but can't seem to find anything.
Thanks in advance!
Never actually used the Flickr API but what about just loading the thumbnails initially, then using JSONP (or a custom "proxy" of sorts) to query photo information asynchronously after the page has loaded. Or, better yet, when the user actually hovers over an image.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How does Facebook Sharer select Images?
When I attach a link on facebook I get the title, url, description and images from that page.
But facebook separates the images and gives just the important ones. And this is what I don't understand.
For example, attach this link
http://tonlinegames.com/
- This is a gaming site with photos about the games.
When you attach it facebook will give you as results only the image about the games, but there are a lots of other images like buttons and so one.
Facebook makes use of Open Graph meta tags when available:
http://developers.facebook.com/docs/opengraph
Otherwise, it probably just uses common sense heuristics (title, h1, p tags, large images, etc).
There is an official tool called URL Linter that displays which info facebook takes from the page. It doesn't explain which exact rules it uses but there is some useful info in the "debug" section.
there some patterns that facebook could be trying.
like the first image that is greater than 50x50 (usually the first big image is the right one).
or maybe it looks for the image that is a link to the site itself, since many sites have one like this.
probably facebook combines more than one of these kind of patterns to be more accurate.
It probably just looks at the largest images within the body of the website. I'm sure they also have some constraints on what image size can be. Too small wouldn't work when coming up in somebodies feed.