【问题标题】:How do i use the Google API classes in my website using PHP and javascript?如何使用 PHP 和 javascript 在我的网站中使用 Google API 类?
【发布时间】:2012-07-30 10:37:07
【问题描述】:

var jasonData = UrlFetchApp.fetch("http://graph.facebook.com/"+url);
var object = Utilities.jsonParse(jasonData.getContentText());


像这些类一样,我需要在我的代码中包含并使用它。我该怎么做?

【问题讨论】:

    标签: php google-apps-script


    【解决方案1】:

    您只能在 https://script.google.com 上编写的 Apps 脚本代码中使用这些特定功能。如果您需要使用 JavaScript 或 PHP 访问 Google API,您可以选择:

    Google JavaScript API client

    Google PHP API Client

    【讨论】:

      【解决方案2】:

      Google Apps 脚本是一种类似于 PHP 的服务器端脚本语言。你不能混合这两个。 PHP 已经具有获取 url(即load(url, options))和解析 json(即json_decode)的函数。

      检查 here 以获取 PHP 中的所有可用函数等

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多