google product

<!DOCTYPE html>
<html>
<head>
<meta charset=‘utf-8‘ />
</head>
<body>
<!--Add a button for the user to click to initiate auth sequence -->
<button id="authorize-button" style="visibility: hidden">Authorize</button>
<script type="text/javascript">
// Enter a client ID for a web application from the Google Developer Console.
// The provided clientId will only work if the sample is run directly from
// https://google-api-javascript-client.googlecode.com/hg/samples/authSample.html
// In your Developer Console project, add a JavaScript origin that corresponds to the domain
// where you will be running the script.
var clientId = ‘564722376202-in1jqjg3n5eb3e6n7kg2deps2qka1ijs.apps.googleusercontent.com‘;

// Enter the API key from the Google Develoepr Console - to handle any unauthenticated
// requests in the code.
// The provided key works for this sample only when run from
// https://google-api-javascript-client.googlecode.com/hg/samples/authSample.html
// To use in your own application, replace this API key with your own.
var apiKey = ‘CjQaEhrHfbtQOjKreEQjrpRS‘;

// To enter one or more authentication scopes, refer to the documentation for the API.
var scopes = ‘https://www.googleapis.com/auth/plus.me‘;

// Use a button to handle authentication the first time.
function handleClientLoad() {
gapi.client.setApiKey(apiKey);
window.setTimeout(checkAuth,1);
}

function checkAuth() {
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);
}

function handleAuthResult(authResult) {
var authorizeButton = document.getElementById(‘authorize-button‘);
if (authResult && !authResult.error) {
authorizeButton.style.visibility = ‘hidden‘;
makeApiCall();
} else {
authorizeButton.style.visibility = ‘‘;
authorizeButton.onclick = handleAuthClick;
}
}

function handleAuthClick(event) {
gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthResult);
return false;
}

// Load the API and make an API call. Display the results on the screen.
function makeApiCall() {
gapi.client.load(‘plus‘, ‘v1‘, function() {
var request = gapi.client.plus.people.get({
‘userId‘: ‘6099994‘
});
request.execute(function(resp) {
var heading = document.createElement(‘h4‘);
var image = document.createElement(‘img‘);
image.src = resp.image.url;
heading.appendChild(image);
heading.appendChild(document.createTextNode(resp.displayName));

document.getElementById(‘content‘).appendChild(heading);
});
});
}
</script>
<!-- <script type="text/javascript" src="authorSample.js"/> -->
<!-- 例子:https://google-api-javascript-client.googlecode.com/hg/samples/authSample.html
参照网页: https://developers.google.com/api-client-library/javascript/samples/samples

maven版本:

<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-content</artifactId>
<version>v2-rev33-1.19.1</version>
</dependency>

-->

<script src="https://apis.google.com/js/client.js?onload=handleClientLoad"></script>
<div id="content"></div>
<p>Retrieves your profile name using the Google Plus API.</p>
</body>
</html>

时间: 2024-12-17 19:25:29

google product的相关文章

Open Source Projects Released By Google

Open Source Projects Released By Google Google has released over 20 million lines of code and over 900 projects. Many engineers work on open source projects full time, and even more use their 20% time to create new projects or contribute to their fav

100 个极其有用的搜索引擎

转载:http://huzhenjie.blog.51cto.com/863711/816772 搜索博客.游戏及论坛文章. Bloglines: 从该搜索引擎你可以查询到2003年至今世界各地的博客文章. FindSounds: 网页设计师和拖拉学生通过该网站可以查找到各种不同格式.信号源个数及分辨率的音频文件. Nicado: 该免费搜索引擎可以帮助你查询你很久未曾联系的老朋友或家庭成员的e-mail 地址及电话号码. Omgili: 通过关键词或主题查找你感兴趣的论坛文章及话题. (快速)

html5 Websockets development guidance

1. WebSockets -- full-duplex communication The main HTML5 pillars include Markup, CSS3, and JavaScript APIs For whole set of HTML5, visit html5rocks.com (google product)   The URL The following image shows the WebSocket URL example in tokens: schema

phonegap plugin.xml 示例

<?xml version="1.0" encoding="UTF-8"?><plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="com.phonegap.plugins.barcodescanner" ver

Another option for file sharing(转)

原文地址  https://security.googleblog.com/2017/02/another-option-for-file-sharing.html Another option for file sharing February 21, 2017 Posted by Andrew Gerrand, Eric Grosse, Rob Pike, Eduardo Pinheiro and Dave Presotto, Google Software Engineers Existi

自然语言11_情感分析

http://blog.csdn.net/erli11/article/details/23918751 斯坦福大学自然语言处理第七课"情感分析(Sentiment Analysis)" 转自:52opencourse.com/ http://52opencourse.com/235/%E6%96%AF%E5%9D%A6%E7%A6%8F%E5%A4%A7%E5%AD%A6%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86%E7

How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7

How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7 The problem Google developers seem to think that Red Hat Enterprise Linux 6 - aka RHEL 6 - and its free equivalents (e.g. CentOS 6 and Scientific Linux 6) are no longer worth suppor

Google官方教程之Selling In-app Products

1.原文链接[需FQ]:http://developer.android.com/training/in-app-billing/index.html 2.平时对于英文文档都是大概读一下,现在翻译文章,就需要咬文嚼字了,其中有很多觉得可能翻译错了或者翻译不好的都加了注解,希望高手回复个你觉得好的翻译. 3.本篇可能翻译第一,应用第二,实在没收获的就去看我先前的那篇支付博文^_^. 售卖In-app商品 依赖和前提条件 Android 2.2 or higher 需要阅读的 In-app Bill

美国政府关于Google公司2013年度的财务报表红头文件

请管理员移至新闻版块,谢谢! 来源:http://www.sec.gov/ 财务报表下载↓ 此文仅作参考分析. 10-K 1 goog2013123110-k.htm FORM 10-K UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C. 20549     FORM 10-K (Mark One)       ý ANNUAL REPORT PURSUANT TO SECTION 13 OR 15(d) OF TH