【问题标题】:get google + share count coldfusion获取 google + 分享次数
【发布时间】:2014-10-02 17:24:58
【问题描述】:

我想获取 google + 共享计数,而不是 + 按钮,而只是数字计数。我想在coldfusion中使用它:-

<cfhttp url="https://clients6.google.com/rpc?key=XXXXXXX" method="post">                
                    <cfhttpparam name="method" type="url" value="pos.plusones.get">
                    <cfhttpparam name="id" type="url" value="p">
                    <cfhttpparam name="params" type="url" value='{"id":"url of the page I want to show on","source":"widget","userId":"@viewer","groupId":"@self"}'>
                    <cfhttpparam name="jsonrpc" type="url" value="2.0">
                    <cfhttpparam name="key" type="url" value="p">
                    <cfhttpparam name="apiVersion" type="url" value="v1">
                    <cfhttpparam name="Content-type" type="header" value="application/json">

                </cfhttp>
                <cfoutput>#cfhttp.Filecontent#</cfoutput><cfabort>

我收到了这样的回复:-

{"error":{"code":400,"message":"Invalid request","data":[{"domain":"global","reason":"invalidParameter","message":"Invalid request"}]}}

【问题讨论】:

    标签: coldfusion count google-plus share


    【解决方案1】:

    根据在https://www.sharedcount.com/documentation.php 上找到的信息,您的语法是错误的。应该是这样的:

     <cfhttp url="https://clients6.google.com/rpc?key=XXXXXXX" method="post"> 
        <cfhttpparam type="header" name="Content-Type" value="application/json" />
        <cfhttpparam type="body" value="#serializeJSON('[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"http://www.yourdomain.com/","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]')#">
     </cfhttp>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-15
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多