我有类型的页面video.other(有效的开放图元标记)并尝试发布监视操作.使用Javascript SDK,使用以下代码发布:
FB.api('/me/video.watches', 'POST', {
video: 'my_video_url_is_here',
'fb:explicitly_shared' : true
},
function(response) {
if (!response || response.error) {
console.log(response.error);
} else {
console.log(response);
}
});
Run Code Online (Sandbox Code Playgroud)
回应是:
{"id" : "a_fb_id"}
Run Code Online (Sandbox Code Playgroud)
虽然没有错误,但我无法在时间轴或活动日志页面中看到该操作,并且无法使用此URL访问:
https://www.facebook.com/me/activity/a_fb_id
Run Code Online (Sandbox Code Playgroud)
使用url https://graph.facebook.com/a_fb_id?access_token=MY_ACCESS_TOKEN,我得到这个json数据:
{
"id": "a_fb_id",
"from": {
"name": "MY_NAME",
"id": "MY_FACEBOOK_ID"
},
"start_time": "2013-12-04T09:50:58+0000",
"end_time": "2013-12-04T09:50:58+0000",
"publish_time": "2013-12-04T09:50:58+0000",
"application": {
"name": "MY_APP_NAME",
"namespace": "MY_APP_NAMESPACE",
"id": "MY_APP_ID"
},
"data": {
"video": {
"id": "video_fb_og_id",
"url": "MY_VIDEO_URL",
"type": "video.other",
"title": "MY_VIDEO_TITLE"
}
},
"type": "video.watches",
"no_feed_story": false,
"likes": …Run Code Online (Sandbox Code Playgroud) 我想用这组路线完成所有东西之后设置cookie但是当我使用"过滤前"时,它会返回一个响应,然后停止做另一件事.
我该怎么办?
这是我的代码
Route::filter('setcookie',function() {
$test = Input::get('test',0);
$cookie = Cookie::forever('cookie',Input::get('test'));
return Response::make(View::make('pages.home'))->withCookie($cookie);
});
Run Code Online (Sandbox Code Playgroud)
Route::group(array('before' => 'setcookie'),function()
{
Route::get('/', function() {
return View::make('pages.home');
});
Route::controller('productrest', 'ProductRestController');
Route::resource('product', 'ProductController');
});
Run Code Online (Sandbox Code Playgroud)