I am using user profile picture I get from Facebook SDK. Do I need to cache photo or url is enough to cache? Is it possible once url will invalid? Is it possible once loading url will not be possible Facebook provided?
I.e. my profile pic url is here, still able to load photo, but for how long it is available? https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/12592388_10208092332220228_4815371318375925057_n.jpg?oh=cc3ba223afc6f123e381ef18fabbc40d&oe=57E3BD91
In general, you should not store any URL of the Facebook CDNs, Facebook cannot guarantee that it will still be available later, with the same URL. If you need it later, download it to your own server...or get it with the API again.
Related
Everyone knows https://graph.facebook.com/[facebook_id]/picture?redirect=false will retrieve the URL of the profile picture.
I've tried it on browsers, NestJS back end, etc.
I don't know why it turns into a silhouette picture but when I provided the access_token the URL was changed to https://platform-lookaside.fbsbx.com/.... that not return the silhouette anymore. This gives me the profile picture but it is always downloaded rather than just displayed. Moreover, the URL from my latest approach is a signed URL and it has expiration time but I need a static URL for the profile picture.
Did anyone have an idea for this? Thank you.
According to the docs
GET /{user-id}/picture requests made by apps in Development mode using either (1) a Client access token or (2) tokenless requests on an App-Scoped User ID will receive a silhouette image instead of the app user's profile image in response.
See full documentation
here
It's solved!
Just use the url directly in src of img
In Facebook API, when we fetch user information we can get profile picture.
The URL is like this:
https://graph.facebook.com/{some_app_user_fb_id}/....
Using this URL, anyone can get the facebook id of the user and can get the facebook account of the user.
My question : Is there any way to make the profile picture URL secure in facebook API or something where no one can make out the original account of the facebook without uploading the profile picture to some other place ?
Similarly I want to ask about google plus profile picture.
The URL is something like this:
https://lh3.googleusercontent.com/{some id}/{something here}/{something}/{somethingelse}/s11-c/photo.jpg
Google picture seems to be more secure, and I don't think anyone can access the main google plus account or gmail email using this picture URL.
2nd Question: So is google plus profile secure ?
I'm not the owner of a facebook page (eg. TESLA) but I'm trying to use graph api to get the number of user that liked the pages over time. Based on graphi api documentation (insight/page_fans), I'm just getting empty json documents. Any ideas how I can get this data?
Only two page-related metrics are available publicly, page_fans_country and page_storytellers_by_country.
Everything else is only accessible to an admin user of the page, resp. using a page access token.
You can not get the data you want for pages you do not have admin access to.
So I was going through Instagram's API and I implemented it. However it isn't as useful as I thought it would be because when trying to get and OAuth2 token a user is taken to a page to authorize them in what looks to be and effort of insuring that the user realizes that they are about to view and share Instagram content with my application. This all makes sense to me although not ideal. You can find it in detail here(Step One: Direct your user to our authorization URL).
Then I saw this press release from a company called Celtra who says they can pull the the most recent images off any Instagram feed and put them in an Ad. I checked it out and somehow they are pulling the images of other companies without this authorization page I am encountering. Basically without page scrapping I don't know how to do this with Instagrams API, and I realize scraping violates Instagrams terms of service. Does anyone have this functionality, where I can pull down images from Instagram and not take a user to an authentication page working legally as I am assuming Celtra is doing? Guidance or documentation on how to achieve this would be ideal.
Instagram recently added an endpoint that will allow you to any instagram account's photos without oauth or needing access_token, you can specify client_id and make API call to get photos.
Just register for an app account at here and add the client_id to this endpoint and make call:
https://api.instagram.com/v1/users/3/media/recent/?client_id=YOUR-CLIENT_ID
You only need access_token to get users' likes, follower feed and to like/comment/follow.
update: you need to have access_token with the new API changes, cannot
access API with just client_id anymore
To do this simply, you could authenticate your app from a dummy profile or your own personal profile and then use the access_token to request the feeds of any account. Then, when an end user goes to use your product, instead of authenticating them, you can just pull content from the Instagram API using your access_token.
I'm creating a web app where I'd like to 1) upload a photo to an app-specific album on Facebook and then 2) share that photo as a LARGE item/image (not a thumbnail) on the users' Timeline. I know this is doable via User Generated Photo optional parameter but is there any other way to accomplish this for a web app?
There is nothing stopping web apps from publishing Open Graph actions with User Generated Photos. It's a simple process:
Setup Facebook auth on your site, your simplest option being to use the Javascript SDK with getLoginStatus. Make sure to request publish_actions permission from users.
Create an Open Graph action and your OG object types
When the user takes the appropriate action, make an API call of the following form (signed with the user access token and POST'd):
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_APP_ACTION?
YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&
image[0][url]=YOUR_PHOTO_URL&
image[0][user_generated]=true
Step 1 is the hardest part and you'd have to do that anyway if you weren't going down the Open Graph actions route.
As an example, Instagram use took as their action and a photo as their object. Their objects URLs are simply the individual photo pages on the Instagram website. So their API POST call would look like this:
https://graph.facebook.com/me/instagram:took?
photo=http://instagram.com/p/ABCD1234/&
image[0][url]=http://distilleryimage.instagram.com/somerandomstring.jpg&
image[0][user_generated]=true
As mentioned in the User Generated Photos documentation this will show up as a large, full-width photo on the users Timeline and feed.
The simplest way to perform all these API calls from a web app is to use the Javascript SDK and the FB.api function. You won't need to use any server-side code at all in that case!
Just fill this code on your photo caption
"took a ##[0:[124024574287414:1:photo]] with #[124024574287414:0]"
(without double quote symbol)
It clickable to instagram website, It's my own custom code, I made it for a week :(