可以动态创建Facebook开放图对象吗? [英] can facebook open graph objects be created dynamically?

查看:143
本文介绍了可以动态创建Facebook开放图对象吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Facebook应用程序。我在打开的图中创建了一个自定义对象,下面列出的是我关心的一些问题

I am developing a facebook application. I have a custom object created in the open graph, below listed are few of my concerns


  1. 执行特定对象类型下的每个对象实例都需要吗一个独特的网页?

  2. 我正在使用JS SDK来发布打开的图形操作,是否有任何规则要求我在js函数中使用对象url(以下代码中的 myobjectrul)例如:

FB.api('/ me / myapp:myaction'+'?myobject = myobjecturl& access_token = myaccessToken',
'post',
{scrape:true},

FB.api('/me/myapp:myaction' + '?myobject=myobjecturl&access_token=myaccessToken', 'post', { scrape: true },

         function (response) {
             var msg = 'Error occured';
             if (!response || response.error) {
                 if (response.error) {
                     msg += "\n\nType: " + response.error.type + "\n\nMessage: " + response.error.message;
                 } alert(msg);
             } else {
                 alert('Post was successful! Action ID: ' + response.id);
             }
         });

应该与对象元标记中的og:url相同吗?

should be same with the og:url in the metatag in the object?


  1. 我们可以传递任何查询字符串以及可以在对象页面中检索到的对象url吗?

  1. can we pass any query strings along with the object url that can be retrieved in the object page?

我们如何发布具有不同对象属性的相同对象类型(例如,不同的图像,不同的url等)

How can we post the same object type with different object properties(for eg. different image, different urls etc.)

我们将不胜感激。

推荐答案

答案是肯定的。对象的每个实例都映射到一个页面,无论是html,C#,php ...等等。因此,如果您是一个jquery ajax动态程序员,则您将不得不改变架构或不使用开放图。

The answer is yes. Every instance of an object maps to a page, be it html, C#, php... whatever. So if you are a jquery ajax dynamic programmer you will have to shift your architecture or go without open graph.

我的公司 http://www.fuhshnizzle.com 使用jquery,ajax,Amazon S3创建在播放器中运行的视频播放列表。这是一个非常轻量级的体系结构。最近,我们分配了资源以直接将播放列表发布到打开的图表。我们的高级建筑师最初并没有意识到这不是动态的。他们假设他们可以定义诸如C#类之类的对象,然后在发布时动态实例化它们。

My company http://www.fuhshnizzle.com uses jquery, ajax, Amazon S3 to create video playlists that run in the player. This is an extremely lightweight architecture. Recently we allocated resources to publish playlists directly to the open graph. Our senior architects did not initially grasp that this was not dynamic. They assumed they could define the objects like C# classes for example, and then instantiate them dynamically at publish time.

在我们这个案例中,我们有很多的疑惑必须为每个播放列表发布一个网页,然后出现CRUD问题。如果用户更改了播放列表,删除了播放列表等,该怎么办。从本质上讲,需要将html页面转换为等效的数据库记录。

There was quite a bit of consternation that in our case we would have to publish one web page per playlist and then the issue came up as to CRUD. What if the user changes the playlist, deletes it, etc. In essence one would need to turn html pages into the equivalent of database records.

从成本/收益的角度来看,这很粗糙。如果我们每天创建100,000个播放列表,我们现在是否必须发布和维护100,000个网页?答案是肯定的。这是一个非常昂贵的提议,似乎忽略了Web通过参数和脚本动态创建内容的功能。经过多次情感交流后,不得不创建静态内容对我的公司来说是一个交易障碍。

From a cost/benefit perspective this is ROUGH. If we have 100,000 playlists created daily do we now have to publish and maintain 100,000 web pages? The answer is YES. That is a very expensive proposition that seems to ignore the power of the web to create content on the fly via parameters and scripts. Having to create static content was a deal breaker for my company after many emotional meetings.

我们的首席建筑师大声疾呼有关尾巴摇狗的事情。对于我值得考虑的是,这是必须根据您的业务模型做出的业务决策。

Our chief architect stormed out muttering something about the "tail wagging the dog." For what it is worth my thoughts are this is a business decision that must be made depending on your business model.

发布对象

打开图对象只是带有打开图元标记的网页。

动态生成Facebook Open Graph元标记

这篇关于可以动态创建Facebook开放图对象吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆