Javascript 我们能在g&x2B上发布一些东西吗;使用力矩插入法的墙?
我想使用java脚本在我的g+墙上发布一些内容。我可以使用共享按钮。但我的要求是没有显示共享弹出窗口,一些内容应该张贴在我的墙上。为此,我可以使用MomentInsert方法GoogleAPI。我已经尝试过了,我得到了一些回应,但没有在我的墙上贴任何东西。这是我的密码,请核对一下。提前谢谢Javascript 我们能在g&x2B上发布一些东西吗;使用力矩插入法的墙?,javascript,google-plus,Javascript,Google Plus,我想使用java脚本在我的g+墙上发布一些内容。我可以使用共享按钮。但我的要求是没有显示共享弹出窗口,一些内容应该张贴在我的墙上。为此,我可以使用MomentInsert方法GoogleAPI。我已经尝试过了,我得到了一些回应,但没有在我的墙上贴任何东西。这是我的密码,请核对一下。提前谢谢 gapi.client.load('plus', 'v1',function(){ url = "https://developers.google.com/+/plugins/snippet
gapi.client.load('plus', 'v1',function(){
url = "https://developers.google.com/+/plugins/snippet/examples/thing";
var payload = {
"type":"http:\/\/schema.org\/AddAction",
"startDate": "2012-10-31T23:59:59.999Z"
};
if (url != undefined){
payload.target = {
'url' : url
};
}else{
payload.target = {
"id" : "a-special-report-old-foes",
"image" : "http:\/\/www.google.com\/s2\/static\/images\/GoogleyEyes.png",
"description" : "Testing Testing Testing",
"type" : "http:\/\/schema.org\/AddAction",
"name":"An example of AddAction"
};
}
gapi.client.plus.moments.insert(
{ 'userId' : 'me',
'collection' : 'vault',
'resource' : payload
}).execute(function(result){
console.log(result);
});
});
我得到了这样的回应
Object {kind: "plus#moment", type: "http://schemas.google.com/AddActivity", target: Object, result: Object, startDate: "2012-10-31T23:59:59.999Z"…}
id: "Eg0xMzUxNzI3OTk5OTk5GJLK-KbPiOfVxgEpCHuQgEQo0AkyAhAUQgcY3ufnoLwG"
kind: "plus#moment"
result: Object
startDate: "2012-10-31T23:59:59.999Z"
target: Object
type: "http://schemas.google.com/AddActivity"
__proto__: Object
瞬间不会直接发布到流中。正如上面所说: 在用户许可的情况下,个人应用程序活动可以出现在他们的Google+个人资料上,对他们选择与之共享的人可见 您的瞬间“vault”显示在您的个人资料的“应用程序”部分下。点击一个应用程序,你会看到记录下来的时刻。从这里,用户可以选择将其共享到他们的流中,但这需要他们的特定操作 没有办法做你想做的事情-Google+的设计要求用户明确批准他们流中显示的任何内容