我可以汇总Facebook喜欢,推文和Google优惠吗?

时间:2013-01-09 15:11:10

标签: facebook facebook-like google-plus tweets

我正在我的新网站cabinethardware.org上建立一个投票申请表。我希望投票能够以某种方式完成,当有人投票支持项目(获得1000美元的重建补助金)时,鼓励他们通过社交网络插入项目。我的程序员在使用应用程序时遇到了困难,我想到一种方法是在网站上放置like,tweet和G +按钮并将它们添加到一起。因此,如果一个项目得到24个喜欢,12个推文和18个G +,它将有64票。如果有人在所有三个引擎上投票,那就不会打扰我了。

在项目有资格获得资助之前,必须获得100票。我的问题是,有没有一种方法可以汇总喜欢,推文和G +,以便我可以在后端看到每个项目有多少票,而无需进入每个项目并手动添加它们?另外,我想向客户展示合计的总数。

有没有人知道如何将这三者的数量结合起来?

1 个答案:

答案 0 :(得分:2)

对于Google+,您只需要对将要搜索Google+公开数据的Google+ API执行一次API调用。正在搜索Google+公开数据is demonstrated in the API explorer

帖子回复包含有关转发和+ 1的信息:

   "verb": "post",
   "object": {
   "objectType": "note",
    "content": "Setting up a server-side flow project that accesses Google+ data using the .NET stack can be a little tricky, I walk you through it in this blog post.",
    "url": "https://plus.google.com/109716647623830091721/posts/g8LjdGAXdDc",
    "replies": {
     "totalItems": 0,
     "selfLink": "https://www.googleapis.com/plus/v1/activities/z125srm50lf1slxrd04cfftatqyoglnoqio/comments"
    },
    "plusoners": {
    "totalItems": 6,
    "selfLink": "https://www.googleapis.com/plus/v1/activities/z125srm50lf1slxrd04cfftatqyoglnoqio/people/plusoners"
    },
    "resharers": {
     "totalItems": 0,
     "selfLink": "https://www.googleapis.com/plus/v1/activities/z125srm50lf1slxrd04cfftatqyoglnoqio/people/resharers"
    },

对于Facebook,您可以使用Pages API计算您网页的内容,您可以experiment with this in their API explorer

以下数据显示了他们的回复数据:

{
  "about": "Build and distribute amazing social apps on Facebook.    https://developers.facebook.com/ ", 
  "company_overview": "Facebook Platform enables anyone to build social apps on Facebook, mobile, and the web.\n\n", 
  "is_published": true, 
  "talking_about_count": 39241, 
  "username": "FacebookDevelopers", 
  "website": "http://developers.facebook.com", 
  "were_here_count": 0, 
  "category": "Product/service", 
  "id": "19292868552", 
  "name": "Facebook Developers", 
  "link": "https://www.facebook.com/FacebookDevelopers", 
  "likes": 952596, 
  "cover": {
    "cover_id": "10151121467948553", 
    "source": "https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash4/s720x720/299374_10151121467948553_45631061_n.png", 
    "offset_y": 0
  }
}

喜欢只是响应数据中的一员。

对于Twitter,您可以查询具有their search API的用户的提及,并将用户的搜索字符串作为@user传递。结果中的对象计数将是您的提及计数。这里的回复数据有点太多了,但这里只有an example query using their API