How to get the facebook cover image after authenticating through loopback - facebook

I am integrating passport with loopback (Facebook Authentication), and works fine, the problems is how to get the cover image.
Now i got some facebook data like email,name,profile image like that.
I want the facebook cover photo.
Is it possible ?
provider.son
"facebook-login":
{
"provider": "facebook",
"module": "passport-facebook",
"clientID": "*****************",
"clientSecret": "*******************",
"callbackURL": "https://localhost/auth/facebook/callback",
"authPath": "/auth/facebook",
"callbackPath": "/auth/facebook/callback",
"successRedirect": "/auth/account",
"failureRedirect": "/login",
"scope": [
"email",
"public_profile"
],
"profileFields": [
"id",
"email",
"gender",
"is_verified",
"languages",
"picture.type(large)",
"name",
"verified"
],
"failureFlash": true
}

The API reference says that there is a cover field: https://developers.facebook.com/docs/graph-api/reference/user/
...but it seems to be deprecated with v3.0: https://developers.facebook.com/docs/graph-api/changelog/version3.0
I assume it is not possible to get the cover image anymore.

Related

How to use roomHint and structureHint with smarthome actions on Google

We are currently setting un a Smarthome action, and we would like to provide roomHint on the first sync (not on request sync) as it's really tedious to set up rooms on the first sync, but it does not work.
We tried to name rooms in english and also in italian, (as it's not really clear from the documentation if there is a list on room names that we can use?) but no way.
So can you please give us a hint how to use the roomHint field?
Also in the API doc we've found structureHint, does it work? The documentation for SYNC intent does not mention this field.
Here is our SYNC intent with one device and room, we took office from the example JSON:
{
"requestId": "3582198904737125163",
"payload": {
"agentUserId": "xyz#qwertyz.com",
"devices": [
{
"id": "deviceID",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Lampadina",
"defaultNames": [
"Lampadina_XYZ"
],
"nicknames": [
"Lampadina"
]
},
"willReportState": false,
"customData": {
"modelType": "DEVICE"
},
"roomHint": "office"
}
]
}
}
Thanks
Unfortunately, I believe the structureHint is only in the HomeGraph API sync response.
It cannot be used in the Sync intent.
If someone can tell me I'm wrong and how to use it, you'd be a hero.

Actions on Google Smart Home Skill: Room Hint / Home Graph

The documentation at https://developers.google.com/actions/smarthome/create-app#actiondevicessync mentions that the roomHint field of the JSON response to the sync request can be used to have Google automatically assign devices to correct rooms.
However, no matter what I return in that field, the user still has to manually assign every device to a room and I cannot get Google to automatically recognize the correct room using this roomHint field
Here's an example response:
{
"requestId": "500166151965294748",
"payload": {
"devices": [
{
"id": "9",
"type": "action.devices.types.LIGHT",
"traits": [
"action.devices.traits.OnOff"
],
"name": {
"name": "Light"
},
"willReportState": false,
"roomHint": "Attic"
}
]
}
}
Right now supplying a value for the roomHint is not used by the HomeGraph to determine which room this device is in.

How can I get Fan Page Additional Contact Info (e.g. Twitter, Instagram) by using Facebook Graph API?

I can use my app_token to call the Graph API Explorer to get the basic information of the Fan Page email, website etc...
Just using /v2.6/20531316728?fields=emails,website,name
But how can I get the Fan Page Additional Contact Info (e.g. Twitter, Instagram, WeChat, LINE, YouTube, etc...) using app_token?
Further research after my comment turns up the following...
While not intuitive through the docs, this is available via the Facebook Graph API for Pages. The field you are looking for is screennames.
https://graph.facebook.com/nasa?fields=screennames&access_token=TOKEN
Example Response
{
"screennames": {
"data": [
{
"service_name": "Twitter",
"value": "nasa"
},
{
"service_name": "Instagram",
"value": "nasa"
},
{
"service_name": "Snapchat",
"value": "nasa"
},
{
"service_name": "YouTube",
"value": "nasa"
}
]
},
"id": "54971236771"
}
Note that it returns the free text that people type in the input type on the Facebook Page edit screen. Sometimes you'll see just the social media name, other times you might see a full or partial url.

Sharing Spotify link to Facebook and retrieving the link from graph api?

I have posted a link to a spotify track on my facebook account - something like this:
http://open.spotify.com/track/0aXxt38KBHHSmwNsHtIonU
Facebook appears to pick up the link (I get the track image and other data appearing in my feed)
But when I make a request to it via /me/feed in the graph api, there's no link or data relating to the track itself. All I get back is object that looks like this:
..{
"id": "{{some_id}}",
"from": {
"id": "{{my_id}}",
"name": "Si Davies"
},
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/y0/r/nAApRnfWfNW.gif",
"actions": [
{
"name": "Comment",
"link": "{{link to the post}}"
},
{
"name": "Like",
"link": "{{link to the post}}"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "link",
"status_type": "shared_story",
"created_time": "2014-06-17T02:17:06+0000",
"updated_time": "2014-06-17T02:17:06+0000"
}...
Which isn't much use to me - I've tried specifying a link field with something like me/feed?fields=link and also mucked around granting various permissions with little or no effect.. how can I see what spotify track was added to my feed from the graph api?
Spotify seems to use the global music.listens Facebook OpenGraph action. Have a look at https://developers.facebook.com/docs/opengraph/music/
You should be able to retrieve your data by issuing
GET /me/music.listens
according to the docs at https://developers.facebook.com/docs/reference/opengraph/action-type/music.listens#read Remember to grant the user_actions.music permission to be able to read the data (https://developers.facebook.com/docs/facebook-login/permissions/v2.0#reference-opengraph)

google chrome extension perform action on loading pages doesnt work with google and facebook

I am developing a chrome extention that do some action on page load for example alert welcome
I am using Jquery to dect the document.ready it works perfect with all sites but facebook and google I need it works with FB
here is the manifest.json file
{
"name": "Me",
"version": "1.0",
"manifest_version": 2,
"description": "ME",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"http://api.flickr.com/"
],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["jquery.js", "popup.js"]
}
]
}
and here is pop.js
jQuery(document).ready(function () {
console.log("Welcome");
alert("Welcome");
});
and even I don't use Jquery and used the JS method directly still doesnt work
alert("Welcome");
You may have HTTPS enabled on Facebook and Google, your content scripts will run on HTTP sites only.
Change your "matches" field value to "<all_urls>" to include HTTPS sites.