Get favorited photos using vk API - api

I want to download all my favorited photos from VK, but I couldn't find suitable method in documentation. User's faves are not album and it makes troubles. Is there a way to do what I want?

You should use method fave.getPhotos to get pictures available here.
Access items from response and extract picture link from fields photo_807, photo_604, photo_130 or photo_75 dependent on which size do you need.
You can download images using the links extracted.
https://vk.com/dev/fave.getPhotos?params[photo_sizes]=0&params[v]=5.67

Related

How to get other people or page video thumbnail from facebook?

is there a way you can get video thumbnail from another people video or post?
I tried searching in google and stackoverflow and all i found is getting your own video thumbnail which is working fine by using https://graph.facebook.com/v11.0/443055553744880/thumbnails?access_token=my_access_token but it is not working if i change the video_id to other people video_id (443055553744880 is the video_id). I want to get any public video thumbnail regardless of who post it, not just my own video. Is there anyway to do that?
Thanks in advance
No, that is not really possible.
For access to videos on pages you do not have admin access to, you would need the Page Public Content Access feature - only the purpose of that is to “Provide competitive benchmark analysis”, so it is probably unlikely you would get it approved for other purposes such as to show videos on your site.
And for access to any content on user profiles, you would need the individual user’s permission first.
If you just want to show the videos somewhere, then you can use the Embedded Video & Live Video Player for that, or the oEmbed endpoints.

youtube's api for app use

Can anyone guide me on how to get youtube's API's to play songs inside the app ?
I need to implement a view with UISearchBar where the user searches for any video on youtube (channel etc .. ) and the results are filtered in a UITableView with the thumbnail, title, and description.
The user gets to choose a video and this video gets opened in another view.
I just need the search because i've been searching for a week and i can't find any result.
PLEASE help.
Thanks.
Youtube api has a good tutorial page for their iOS helper library that you can find here.
In order to retrieve youtube videos using a search string, you'll need to use the youtube api.
You might have to make a get request to
GET https://www.googleapis.com/youtube/v3/search
The required parameters include
part -The part parameter specifies a comma-separated list of one or
more search resource properties that the API response will include.
Set the parameter value to snippet.
You may want to add the search string parameter as well (q), if you are searching for a particular string .
For example a query looks like:
GET https://www.googleapis.com/youtube/v3/search?part=id&q=hello&key={YOUR_API_KEY}
and you get the JSON response containing the youtube ids for the videos matching the search string provided.You can see the details here.
This youtube id can then be used to play the video in a Web View according to the iOS helper library.
[self.playerView loadWithVideoId:#"M7lc1UVf-VE"];

How to set message caption using Facebook Messenger SDK for iOS

I need to set a caption when I share a picture (QR code) from my app integrated with Facebook Messenger.
There is metadata NSString field but I don't see a way how to use it. Did anyone solve that problem?
metadata field You can see that we're passing options to the share
method. This contains two fields we want to send back to Messenger:
metadata and contextOverride.
The metadata field takes a NSString and is optional. It can be used to
give information about the content being shared. For example, you can
store a serialized JSON string. This is useful during replies as this
data is passed back to your app.
https://developers.facebook.com/docs/messenger/ios#bp_using_metadata
The metadata is meant for you, as a developer, to use. For example, when a user creates an image from your app you can attach metadata to it, at that point. This metadata is sent, in the background, together with the image to the recipient. When they decide to reply, using your app, you will receive the metadata there.
You can use this, for example, if in your app somebody selected a category to get the image. When you pass in this category in the metadata (which is up to you to format, but JSON is convenient), you get this metadata/JOSN in your app when the recipient replies. You can read the category and load the images on that category already.
The metadata does not set a caption to your image. Actually, there is no integrated way to add a caption to your images.
I would advise to generate the QR-code part of the image and the caption in your app. The image that you post to the Messenger API is thus a combination of the QR-code and a textual caption above or below it. Does that make sense?
ps: about the credible source; I'm a developer support engineer at Facebook :)

Google Custom Search API Search Image by Image URL

I am working on an application which will have an option for users to upload images. Once uploaded, the application will show other images from the web which look exactly similar, whether or not of the same size.
For this, I will create a temporary URL for the image so that I could provide Google custom search API the URL of the image. I would expect in response, URL's of images that are exactly the same or similar to it, perhaps in JSON format.
I did find a similar question posted in January. Till then Google did not support anything like this, apparently:
Google Javascript Custom Search API: Search images by image url
One can also simply do:
http://images.google.com/searchbyimage?site=search&image_url={Image URL}
Since that is not part of an official API, it may not be right to use this method.
Can someone help me?
Well, the answer quite simply is TinEye Commercial API https://api.tineye.com/welcome. I was looking in the wrong place I guess, I did not have any luck with Google Custom Search API.
Would you need a simple result?
If you are, you can use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API"
Third, click "JSON" tab menu on the result.
You can be seen JSON about similar images.

Graph API - Photo uploaded by API is not visible

I`m geting the following problem.
Using graph api I can create an album (exactly photo album of my app). There is no problem also to upload photo to already created album (I have aid of this album as result of previous operation). After uploading photo I get also pid of the photo.
The problem starts now at the moment when I would like to get photos of the album. Graph API returns an empty array. Also I don't see any new album when I go to app page. However if I go to wall of my app page, I see this photo on "last added photos" list. I can enlarge uploaded photo, and I even see info that it's located in the proper album. There is another wird thing. If I choose this album, Facebook notice me that it`s an empty album.
I doesn't mean those operations are not done well, because if I request for a particular photo using pid (which I know from upload photo operation) I get a proper result - photo exist. Unfortunately it's really uncomfortable to store all pids of album in data base and perform separated request to each of it.
If the Facebook App is in "sandbox" mode, the images will only be visible to the admin/developers/tester users. Public users will not see the images.
Turning sandbox mode off fixed this issue for me.