約 5,117,072 件
https://w.atwiki.jp/devlabo/pages/29.html
参考ページ:PhpSpreadsheetのTIPSあれこれ https //qiita.com/BRSF/items/ed32311d48161be7c719 参考にさせていただきました。ありがとうございます。
https://w.atwiki.jp/api_programming/pages/181.html
下位ページ Calendar Drive Gmail Logger SpreadSheet Content 基本文法やメソッドはjavascriptに準ずる Eclipseから編集する webアプリケーションとして CORS スクリプト中で別のスクリプトを呼びたしたいリンクさせて使えるか? メッセージボックス 外部APIを叩く(Httpリクエストを送る) 外部からAPIで操作する 別プロジェクトの、自作ライブラリを使用する 基本文法やメソッドはjavascriptに準ずる Javascript Eclipseから編集する プラグインがある。機能上に制約があるので、通常はScript Editerで良さそう。たまにインデントが乱れたりするので、そのような場合はEclipseに持ち帰って、コードチェックを掛けるとか? 同じファイルを、①Script Editorで編集→②保存、③Eclipseで編集→④保存としたら、ちゃんと④で警告が出た。 ただし、 プロジェクトの新規作成は非対応(プロジェクトのインポートのみ) プロジェクト名の変更もできなさそう。 gsファイル、htmlファイルはルートフォルダに。その他のタイプのファイルや、サブフォルダのファイルはgoogleドライブではApps Scriptの一部にみなされない。 自動補完機能はライブラリに対しては提供されていない?(Autocomplete suggestions are not provided for libraries or advanced Google services.) ごくごく最近追加されたメソッドにも対応していないかも。スクリプトエディタで有効なら、ま、まだちゃんと走るけど。 Eclipse 使い方:先に作っておく? ファイル→インポート→google→GAS 新しいファイルの追加 File New File拡張子は.gsか.html 編集内容のアップロード 自動的にされている Eclipseでの保存時に、プロジェクトのファイルビューのアイコンに×マークがでる(アップロード未完)。バツが消えたらアップロード完。 webアプリケーションとして htmlファイルを設定 https //developers.google.com/apps-script/guides/html/ ようするに、getリスエストが来た時の関数 doGet内に、表示させるhtmlを指定しておけばよい。 return HtmlService.createHtmlOutputFromFile( index ); CORS https //developer.mozilla.org/ja/docs/HTTP_access_control あるドメインから取得したページ内で、別のドメインのページを呼び出せない。 imgタグ内、scriptタグ内など、例外はある(ので、CORSを知らないとなんでできないの?と思ってしまう) 実際には、上記のような例外をのぞいて、ドメインが違うサーバへのリクエスト(レスポンス)は受け付けない。 ここを読む限り、GASサーバへのXMLHttpRequestは不可。 GAS内で表示された、htmlから(クライアントから)実行するための機能はある(google.script.run)が、あんまり解決になってない。やりたいことが、よそのサーバから自分のscript(Spreadsheet)とも連携、なので。 スクリプト中で別のスクリプトを呼びたしたい まだ実施していないが、スクリプトファイルを公開状態にすれば使えるようになるみたい。 使われるスクリプトを開いて「ファイル」→「プロジェクトのプロパティ」 プロジェクトキーを控える 使うスクリプトで「リソース」→「ライブラリ」 ライブラリのキーを入力する http //itami.info/tech/14-memorandum/188-googleappsscriptincludfunctions.html Google Apps Scriptで作った関数類をライブラリ化しよう リンクさせて使えるか? 無理っぽい。HTMLならできるけど。 無理やりやるなら、こんな方法。 GASのライブラリを使って楽したい② 外部のJSライブラリを使ってみる( 3」[_] http //qiita.com/soundTricker/items/5a7e050a2a20f3e3938a メッセージボックス Browser.msgbox(str) msgBox(prompt) 外部APIを叩く(Httpリクエストを送る) Class UrlFetchApp GASで外部APIと連携 - Qiita External APIs 外部からAPIで操作する Google App Scriptではなく、Java(とかの)プログラムから操作したい とりあえずJavaでプログラムを組むか。 https //developers.google.com/api-client-library/java/ ライブラリを取得する APIの使用許可を得る(認証) http //a-auto50.blogspot.jp/2015/06/drive-rest-apijavagoogle-drive.html 別プロジェクトの、自作ライブラリを使用する 大まかな流れ 自作ライブラリ側スクリプトIDをメモる 使用するプロジェクト側リソース - ライブラリ で スクリプトID を指定して読み込む http //redsnapper.hatenablog.com/entry/2017/05/30/153241 ライブラリを使い側 https //developers.google.com/apps-script/guides/libraries?hl=ja
https://w.atwiki.jp/hasuda-sokutei/pages/14.html
マップ作成元データには、下記リンクからアクセス可能です。 蓮田市内の測定データ ◎蓮田市内-測定データ (別窓で開きます) https //docs.google.com/spreadsheet/ccc?key=0As1jkkpDL2wadFJSOW9xSF9qNE1vMExNTlZPRmN0RlE&hl=ja 周辺地域の測定データ ◎伊奈町-測定データ (別窓で開きます) https //docs.google.com/spreadsheet/ccc?key=0As1jkkpDL2wadERUTnc1U0x5blhPZjhWRVBLOWpqblE&hl=ja ◎白岡町-測定データ (別窓で開きます) https //docs.google.com/spreadsheet/ccc?key=0As1jkkpDL2wadE1fOTN5SlEwcEJYbWpOYk1oQllyclE&hl=ja 【データ更新履歴】 2011.10.03 蓮田市内保育園測定データを追加(9/21分) 2011. 9.15 蓮田市内の測定データ9/15分まで更新済み(公園の測定データも追加) 2011. 9.11 白岡町の測定データのリンクを追加 2011. 9.10 蓮田市内の測定データ9/9分まで更新済み 伊奈町の測定データのリンクを追加 【ご意見や質問等はこちら】 ※ツリー型のコメント投稿フォームです。 前の投稿に返信をしたい場合には、返信元にチェックを入れてコメントを投稿してください。 (こちらはデータに関する質問やご意見等になります。入力間違い等見つけたら教えてください) テスト投稿です。 - てすと 2011-09-10 18 25 23 テスト2 - 名無しさん 2011-09-10 18 25 53 名前
https://w.atwiki.jp/keiplus/pages/205.html
Form2Spread GoogleAppsScript gas 本項は書きたての記事です。正確な情報は公式サイト、公式ドキュメント、記載の参照サイトでご確認ください。 目次 + 読む Form2Spread目次 簡易なフォーム+SpreadSheet連携 GAS処理 参考 簡易なフォーム+SpreadSheet連携 GASを書く必要はない。 手順 カテゴリ 内容 設定・コード 結果 1 GoogleForm フォームを作成 特に何もしなくてよい 2 GoogleForm タブ「回答」で回答先の選択を設定 以下のラジオボタンを選択状態にする「新しいスプレッドシートを作成 無題のフォーム(回答)」「作成」を押下 自動的にSpreadSheet「無題のフォーム(回答)」が作成され表示される 3 GoogleForm フォームURLを送信する ボタン「送信」を押下ポップアップ「フォームを送信」のメール送信先を自身が受取れるメアドを設定ボタン「送信」をクリック メールが宛先に届いていること 4 GoogleForm フォームに記入して送信テスト Gmailに届いているHTMLメール本文の「フォームに記入する」をクリックフォームページがブラウザで開くので、フォームに入力。ボタン「送信」をクリック SpreadSheet「無題のフォーム(回答)」に、フォームで入力した内容が出力されていること 5 以上 ※ 自動生成されたSpreadSheetは削除することが出来ない。削除するにはフォームと関連付けられたSpreadSheetをフォームのタブ:回答で「フォームのリンクを解除」する必要がある。 GAS処理 参考 [ 【簡単!】Googleフォーム送信時にGASを自動実行する方法 - Yuki s bnb blog ] ( https //www.yukibnb.com/entry/form_trigger ) [ 【GAS】Google フォームとスプレッドシートを連携して選択肢を動的に入力する。そして注文フォームを作ってみる。 - ファーマーズハウスさわ ] ( https //www.nakakamado.com/2021/09/form-gas.html )
https://w.atwiki.jp/api_programming/pages/34.html
下位ページ AppEngine AppScript Calendar Charts GAS Sheets API 認証 認証(Oauth 2.0) Content Google関連 APIの使用 初回の承認フロー 保存されている認証情報で承認する GoogleAuthorizationCodeFlow javascriptでのAPI操作事前準備 流れ AppEngine Google Cloud での操作プロジェクトの指定 Google関連 Google Apps Script (GAS) Google App Engine (GAE) Google Calendar, Gmail, ... AppEngine AppScript Calendar Charts GAS Sheets API 認証 認証(Oauth 2.0) #lsd2 APIの使用 Codezine Developer Projectを作成する プロジェクトページでAPIの使用を有効にする client id をもらうリダイレクト先や、javascriptでの呼び出し先(クロスドメインの話のため?) 登録したら ID と シークレットキーをもらう 初回の承認フロー Google デベロッパー アカデミー/ドライブの認証と承認について Google ドライブがユーザーに OAuth ダイアログを表示し、データをリクエストしているアプリケーションを承認するよう求めます。 ユーザーが承認すると、そのユーザーはアプリケーションの URL にリダイレクトされ、URL の code パラメータにある承認コードが提供されます。 アプリケーションが認証情報と引き換えに承認コードを渡します。この情報には、アクセス トークンと有効期間が長いリフレッシュ トークンが含まれます。 アプリケーションが User Info サービスを呼び出して、ID とメールを取得します。ID は有効期間の長いリフレッシュ トークンを保存するためのメイン キーとして使用されます。 アプリケーションが、後でアクセス トークンを取得できるように、リフレッシュ トークンとメールをユーザー ID でインデックス付けして保存します。 Authorization CodeをもらうためのURL 保存されている認証情報で承認する 初回の承認フローが正常に終了した後でユーザーがアプリケーションにアクセスした場合、エンドユーザーにメッセージは表示されません。アプリケーションは、保存されているリフレッシュ トークンを使用してリクエストを承認できます。 アプリは、データベースからリフレッシュ トークンを探し出してサーバー側のセッションに保存できます。アクセス トークンが期限切れになると、このリフレッシュ トークンを再使用して新しいアクセス トークンをリクエストします。 アプリケーションが Google ドライブ ファイルへアクセスすることをユーザーが既に承認している場合の承認フローは、次のようになります ブラウザがアプリケーションの URL にリダイレクトされ、URL の code パラメータにある承認コードが提供されます。 アプリケーションが認証情報と引き合えに承認コードを渡します。ユーザーは既にアクセスを承認しているので、リフレッシュ トークンは返されません。返されるのは、有効期間が短いアクセス トークンのみです。 アプリケーションが User Info サービスを呼び出して、有効期間が長いリフレッシュ トークンを探す場合にマスター キーとして使用するユーザー ID を取得します。 アプリケーションがデータベースからリフレッシュ トークンを取得し、そのトークンをサーバー側のセッションに保存します。リフレッシュ トークンが取り消されたり無効になったりした場合は、これを検出し、適切な措置を取る必要があります。詳しくは、こちらをご覧ください。 GoogleAuthorizationCodeFlow エンドユーザーの証明書を操作、保持する This is designed to simplify the flow in which an end-user authorizes the application to access their protected data, and then the application has access to their data based on an access token and a refresh token to refresh that access token when it expires. ユーザーがすでに証明書を持っているか、チェックする 持っていない場合はnewAuthorizationUrl()で認証ページヘ遷移。ブラウザは、codeパラメータを持たせてリダイレクトページへ。newTokenRequest(String) を使う。 最後は #createAndStoreCredential(TokenResponse, String)で証明書を保管。 http //javadoc.google-api-java-client.googlecode.com/hg-history/0dd03fb10eb0ec8e66259d5a19e712bb274b68bc/1.10.0-beta/jdiff/Google%20API%20Client%20Library%20for%20Java%201.9.0-beta/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.html#newAuthorizationUrl%28%29 http //javadoc.google-api-java-client.googlecode.com/hg/1.16.0-rc/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeFlow.Builder.html GAE Servlet google-api-client-1.18.0-rc.jar ○ ○ google-api-client-appengine-1.18.0-rc.jar ○ google-api-client-servlet-1.18.0-rc.jar ○ ○ google-oauth-client-1.18.0-rc.jar ○ ○ google-oauth-client-appengine-1.18.0-rc.jar ○ google-oauth-client-servlet-1.18.0-rc.jar ○ ○ google-http-client-1.18.0-rc.jar ○ ○ google-http-client-appengine-1.18.0-rc.jar ○ commons-logging-1.1.1.jar ○ gson-2.1.jar ○ ○ httpclient-4.0.1.jar ○ httpcore-4.0.1.jar ○ jackson-core-asl-1.9.11.jar ○ ○ jackson-core-2.1.3.jar ○ ○ jdo2-api-2.3-eb.jar ○ ○ jsr305-1.3.9.jar ○ ○ protobuf-java-2.4.1.jar ○ ○ transaction-api-1.1.jar ○ ○ xpp3-1.1.4c.jar ○ ○ javascriptでのAPI操作 Google APIs Client Library for JavaScript (Beta) 事前準備 APIキー、クライアントIDの取得 流れ Google APIs Client Library を読み込む APIキーを使って、認証 ユーザー固有の情報にアクセスする場合はauth認証 使いたいAPIを読み込む AppEngine web.xmlに日本語が混ざっていると、アップロードに失敗 Google Cloud での操作 プロジェクトの指定 何も指定しないとその時点でのデフォルトプロジェクトに対する操作になる。例えば、デプロイとか。 明示的にしていする場合は `--project=[PROJECT]` をつける。 別解:全コマンドでプロジェクトを明示的に指定する
https://w.atwiki.jp/kabutempra/pages/85.html
TOPページへ トップページ? メニューへ メニュー? 質問FAQへ http //www9.atwiki.jp/kabutempra/pages/15.html#id_97612891? Gooogleの使い方 ウェブ イメージ ニュース New! グループ ディレクトリ ______________ _____ |ティック 用語 | |Google検索| 検索オプション  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄  ̄ ̄ ̄ ̄ ̄ 表示設定 〇ウェブ全体から検索 ◎日本語のページを検索 ↑このように調べたい単語にスペースを空けて用語と入れてみましょう ググりかたの基本 わからない単語を調べる 1:○○とは でググる 2:○○って何 でググる 3:○○ 意味 でググる 4:○○ 株 用語 でググる 株価を調べたい 株価コード又は会社名 スペース 株価、といれてググってみましょう 例:「9984 株価」これでググる 為替レートを調べたい 例:「100ドルを日本円で」 これでぐぐる Googleの特殊機能 通貨換算 http //www.google.co.jp/intl/ja/help/features.html#currency ちょっとした計算がしたい 例:「100+100*2」 これでググる(エクセルの様に頭に=を入れる必要はありません) フィルターをはずす方法 グーグルの窓の横の「表示設定」で言語を英語にして画面下の「保存」で設定変更、 英語版グーグルでもう一度「表示設定」(prefeces)にして、画面下の方の「DO not filter~」に チェックを入れて、真下の「Save prefeces」で設定保存、で、言語を日本語に戻す。 そうすると言語は日本語だけど、フィルターが除去されて規制が取っ払われる。 (注意:ウィルスサイト踏む危険も高くなる) その他 Google 基本検索 http //www.google.co.jp/intl/ja/help/basics.html 「○○××」っで検索しても「○○ ××」と同じような結果が出る ""でかこむ 例:「"○○××"」 いらない単語がある 「○○ -××」でググる ブログがうざい。 「-blog*」 でぐぐる Blogless Google ttp //www.multithread.jp/blogless/ 「-hatena -ブログ -blog -amazon -wiki -2ch -yahoo」 これを単語登録して、検索する時に簡単に出せるようにしておく フィーリングラッキーを使う GO ○○ でググる イメージ検索がウザい仕様変更してる javascript切れば今まで通りのイメージ検索 右クリックでgoogle 2chブラウザ Janeの便利な使い方 Janeの便利な使い方? 外部コマンドの欄 ツールバー Google ツールバー http //toolbar.google.com/T4/intl/ja/index.html Yahoo!ツールバー http //toolbar.yahoo.co.jp/ タブブラウザにはたいてい標準で検索バーがついています タブブラウザ推奨委員会 http //tabbrowser.info/ 他の検索サイト 検索デスク SearchDesk スタートページ http //www.searchdesk.com/ 調べる.net 簡単便利に調べるための検索リンク集 http //siraberu.net/ vivisimo http //vivisimo.com/ Internet Archive http //www.archive.org/index.php Google ヘルプ センター http //www.google.co.jp/support?hl=ja Google Docs オンライン上で使う表計算サービス http //docs.google.com/ Google Docs & Spreadsheetsが日本語対応、アップロード時の文字化けも解消 http //www.itmedia.co.jp/bizid/articles/0703/20/news094.html googoleニュースアーカイブサーチ http //news.google.com/archivesearch/ 過去100年以上のニュース検索(英語・有料記事あり) Google Trends キーワードの検索数グラフ http //www.google.com/trends?q=wii,ps3,xbox360 amp;date=2006-11 amp;ctab=2 amp;sa=N Soople googleの検索オプションを簡単に使えるサイト http //www.soople.com/ Googleサービスの使い方!まとめサイトのリンク集 http //g.1o4.jp/ Gメール http //mail.google.com/mail/ GMail Drive shell extension http //www.softpedia.com/get/Internet/E-mail/Mail-Utilities/GMail-Drive-shell-extension.shtml Gメールをファイルのように使うソフトですが 使ってるとアカウントを消されます 小ネタ:Googleのコールセンターから電話が http //blogs.itmedia.co.jp/serial/2007/02/google_a13f.html
https://w.atwiki.jp/nogoogle/pages/21.html
今後スレ立て・修正依頼される方は、トリップ付けるルールで、お願い致します。 スレタイ倉庫 トリップ倉庫 過去ログリンク倉庫 スレタイ倉庫 Don t Be EvilからEvilに方向転換してきたGoogleから離れたい人のためのスレッドです。 Googleは2012年3月から各サービス別に分かれていたプライバシーポリシーを廃止し、 それらを統合した新しいポリシーを導入すると発表しました。 新ポリシーでは、検索単語やアクセスしたサイト、送受信したGmailの内容、YouTubeで観た動画、 Android端末から送信された情報といったデータがユーザーの氏名、メールアドレス、IPアドレス、 電話番号、クレジットカード番号などと結び付けられて一カ所に集められることになります。 Googleはこれらのまとめられた個人情報をユーザーに断りなく広告に反映させたり、 情報処理を他社や個人に委託することが可能になります。 インターネット上での自分の行動が何もかもGoogleに掴まれ、利用される日がすぐそこまで 来ているのかもしれません。 脱Google@wiki http //www4.atwiki.jp/nogoogle Google関連ソフトのアンインストール手順、通信遮断、代替サービスなど まずはこのwikiを読んでから質問を!今からでも遅くない! ※注)このwikiにもGoogle AdsenseやGoogle AnalyticsのトラッカーCookieがあります。 気にする人は 2以降の対策を実施してからアクセスしてください。 前スレ 【軍事も家電も】脱Google総合★26【買収するよ】 http //toro.2ch.net/test/read.cgi/google/1392288202/ 過去スレ 【メール本文も】脱Google総合★25【広告利用】 http //toro.2ch.net/test/read.cgi/google/1383643594/ 【収集も紐つけも】脱Google総合★24【脱税も】 http //toro.2ch.net/test/read.cgi/google/1372165095/ 【Googleカード】脱Google総合★23【履歴丸見え】 http //toro.2ch.net/test/read.cgi/google/1350699738/ ※全過去スレリンクの履歴は、wikiトップページ下部に記載されています。 ※陰謀論はスレ違いですので、該当スレにて話してください。 Googleに関する陰謀を考える http //toro.2ch.net/test/read.cgi/google/1329880579/ 以下 2以降テンプレ ■脱Googleのために、今すぐやっておきたい事 1~6番までは確実にやっておきたい必須事項です。7番は、今後2度とGoogleに関わりたくない人向け。 8番は困難を伴いますが、次の携帯端末はAndroid以外にしましょう。 1:Googleに登録してある、あらん限りの、履歴とデータを削除 ※詳細は 1のwiki サイト参照 2:Googleアカウントの全削除 ※念のため、中のデータをすべて削除してからアカウントを削除 3:Google系のソフト(Google Chrome、日本語入力など)を全アンインストール ※通常の手順では全削除できません。詳細ついては 3参照 4:ウェブブラウザの設定を見直す ※各ウェブブラウザの設定については 4-5参照のこと 5:ウェブブラウザにプライバシーを保護するアドオンをインストールする ※詳細については 6参照のこと 6:Hotmailなどの代替Webサービスに移行する ※無料である以上、どのサービスでも広告最適化のため、ある程度は情報を抜かれます ※情報の紐付けによる個人特定を避けるため、「1会社1サービス」を心がけましょう ※例えば、検索は「DuckDuckGo」、メールは「gooメール」、地図は「Bing Map」など ※代替サービスの詳細については 1のwiki「代替サービス一覧」を参照 7:今後、Google系サイトにアクセスしないように対策 ※詳細については 7参照。複雑な手順が必要なためWikiもチェック 8:Android端末からWindows PhoneやiPhoneに乗り換える ※最も危険なのがAndroid端末です。端末とGoogleサービスの利用履歴を紐付けされ、 簡単に「***というキーワードで検索をしたのは***さん」と特定されてしまいます ※また、Android Marketでは、アプリを購入した利用者の氏名、メールアドレス、住所、 電話番号などの個人情報を、アプリを販売した業者に開示しています ※速やかな乗り換えが難しい場合は、新たなGoogleアカウントを取得し、まっさらな状態から 注意深く利用することを推奨します ■Google系のソフト(Google Chrome、日本語入力など)のアンインストール方法 ChromeなどのGoogle系のソフトは、通常の手順でアンインストールしても GoogleUpdateが残り、OSを起動するたびに背後で密かに活動して、 Googleにアクセスを行い続けます。また、レジストリにゴミを大量に残します。 GoogleUpdateを完全に削除する手順 ※詳しくは 1のwiki「アンインストール」を参照 1.タスクマネージャーを起動して「GoogleUpdate.exe」のプロセスを終了する。 2.以下の実行フォルダとタスクファイルを削除する。隠しフォルダになってるので注意。 ◆XPなら ・%UserProfile%\Application Data\Google\Update\ ・%Program Files%\Google\Update ◆Vista/7なら ・%UserProfile%\AppData\Local\Google\Update\ ・%Program Files%\Google\Update ◆OSXなら ・~/Library/Google/GoogleSoftwareUpdate/ ・ ~/Library/Google/Google/Updater/ ◆Winならこれも→C \WINDOWS\Tasks\GoogleUpdateTaskUser.job (アイドル時に自動起動するファイル) 3.サービスにもゴミが残ってたんでコマンドプロンプトを起動し下記を入力し実行する。 sc.exe delete gupdate sc.exe delete gupdatem ※UAC管理者権限が必要になる場合がある 4.レジストリエディタを起動して以下のキーを削除する。 HKEY_CURRENT_USER\Software\Google\Update (ユーザデータ格納キー) HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Google Update (スタートアップキー) ※他にもレジストリに多数のゴミを残すので、「Google」で検索して必要なさそうなキーは 自己責任で削除しましょう。レジストリの操作は思わぬトラブルを引き起こすことがあるので、 心配ならバックアップを。分からない場合は操作しないように! ■ウェブブラウザの設定を見直す ●位置情報通知機能を切る 位置情報通知機能に対応したWebサイトにアクセスした際、あなたの位置情報をサービスプロバイダへ 送信し、推測されたあなたの現在地を取得する機能です。 Firefox、Opera、SafariはGoogle Location Serviceを利用していますので、オフにした方が無難です。 ・IE9の場合 インターネットオプション→プライバシー→ [Webサイトによる物理的な位置の要求を許可しない]にチェック ・Firefoxの場合 ロケーションバーに「about config」と入力します 「細心の注意を払って使用する」をクリックしてください フィルタに「geo.enabled」と入力します 「geo.enabled」という設定の上でダブルクリックし値を「true」から「false」にします ・Thunderbirdの場合 ツール→オプション→詳細→一般タブ→設定エディタ とたどる 後はFirefoxの場合と同様の手順でOKです ・Operaの場合 設定→詳細設定のタブ→左メニューのネットワークをクリック [Geolocation 機能を有効にする]のチェックを外す + アドレスバーに「opera config」と入力し設定ファイルエディタを呼び出します Geolocation項目の「Enable geolocation」と「Send location request only on change」の チェックを外し「保存」ボタンを押します ・Safariの場合 一般設定メニュー→設定→プライバシー→ 「Webサイトによる位置情報サービスへのアクセスを制限」の「確認せずに拒否」にチェック ●Do Not Track機能を有効にする Cookieなどによるトラッキング(追跡)を拒否する機能が「Do Not Track」です。 ChromeやOperaはDo Not Track機能に対応していませんので、これらの利用は避けましょう。 ・IE9の場合 ツールボタン→セーフティ→追跡防止→追跡防止リストをオンラインで取得→ 「追加」をクリックしてリストをインストール ・Firefoxの場合 Firefoxボタン→オプション→オプション→プライバシー→ 「トラッキングの拒否をWebサイトに通知する」にチェックを入れる ・Safariの場合 一般設定メニュー→設定→詳細→「メニューバーに開発メニューを表示」をチェックしてから・・・ メニューバー→開発→「Do Not Track HTTPヘッダを送信」にチェックを入れる ●偽装/攻撃サイトブロック機能を切る FirefoxおよびSafariは、Googleが提供する偽装/攻撃サイトのブラックリストを ダウンロードして利用しています。 プライバシーに関わる通信はしていませんが、Googleに少しでも関わりたくない人は切りましょう。 また、IE8/9の場合は訪れたサイトのURLをMicrosoft社に逐一送信しています。 プライバシーの侵害に関わる可能性がありますので、切った方が無難かも知れません。 ただし、偽装/攻撃サイトをブロックできなくなるリスクを覚悟しましょう。 なお、Operaは、Netcraft / PhishTank 作成のリストをOpera社から読み込む仕様になっている様です。 ・IE8/9の場合 ツールボタン→セーフティ→SmartScreenフィルター機能を無効にする→ 「SmartScreenフィルター機能を無効にする」にチェック ・Firefoxの場合 Firefoxボタン→オプション→オプション→セキュリティ→ 「攻撃サイトとして~」および「偽装サイトとして~」のチェックを外す ・Operaの場合 Operaボタン→設定→設定→詳細設定タブ→セキュリティ→ 「フィッシング・マルウェア防止機能を有効にする」のチェックを外す ・Safariの場合 一般設定メニュー→設定→セキュリティ→ 「詐欺Webサイトを訪問したときに警告」のチェックを外す ●その他 ・Operaのコンテンツのブロック機能 http //ja.opera-wiki.com/%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%84%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF ・サーバー上で同じファイルパスを有するすべてのファイル、または特定のファイル、 あるいはその両方をブロックして非表示にすることができます。 ・ブロックしたいコンテンツを登録するには、コンテンツブロック専用モードにします。 専用モードに切り替えるには、ページ内の任意の場所で右クリックし、 『コンテンツのブロック』を選択して下さい。 ・次に登録したい画像やオブジェクトをクリックするか、あるいはページ最上部の中から 「詳細設定」ボタンをクリック。 表示されるダイアログに、ブロックしたい画像やオブジェクトの URL を登録して下さい。 ・最後にページ最上部の「完了」ボタンを押す事で登録されます。 画像やオブジェクトが、 JavaScript によって読み込まれている場合はクリックでは ブロック出来ない場合があります。この場合は該当する JavaScript ファイルの URL を 指定する必要があります。 ■ウェブブラウザにプライバシーを保護するアドオンをインストールする cookie削除後も行動追跡を続ける「supercookie」に研究者が警鐘 http //www.itmedia.co.jp/news/articles/1108/21/news004.html アドネットワークは、常にあなたを監視している http //japan.internet.com/wmnews/20111025/5.html GoogleがSafariの設定を迂回してユーザーを追跡していたことが判明 http //www.itmedia.co.jp/news/articles/1202/18/news015.html Google、IEでもプライバシー設定迂回――Microsoftが明らかに http //www.itmedia.co.jp/news/articles/1202/21/news034.html Googleを始めとするWebサービスプロバイダや広告業者は、ブラウザのセキュリティ設定を掻い潜る あらゆるテクニックを使って追跡してきます。拡張機能や専用ソフトで対処しましょう。 ・単独ソフト Proxomitron ブラウザとネットの間にプロキシを通してカスタマイズされた情報を送受信できるようにする http //proxomitron.sakura.ne.jp/ PeerBlock 指定したIPを弾いてくれるソフト 一時的に許可することもできる http //www.peerblock.com/ PeerBlock 日本語化パッチ http //kuni92.net/article/165643851.html ・ブラウザのアドオン トラッキング防止アドオン Ghostery [Google Analyticsもカット](Firefox,chrome[不完全?],opera,IE) https //www.ghostery.com/ Google Privacy 検索結果でGoogleやBingのトラッキングを外したリンクを表示する https //addons.mozilla.org/ja/firefox/addon/google-privacy/?src=search YesScript ブラックリストに入れたJavaScriptを止める 逆にホワイトリスト以外を遮断するNoScriptもある https //addons.mozilla.org/ja/firefox/addon/yesscript/ Google Disconnect 元Google社員が作ったGoogleへの情報送信をブロックしてくれるアドオン FacebookやTwitter用のアドオンもある https //addons.mozilla.org/ja/firefox/addon/gdc/ UAControl HTTP ヘッダで送られるユーザーエージェント文字列をドメインごとに変更する 全く送信しないことも可能 https //addons.mozilla.org/ja/firefox/search/?q=UAControl anonymoX 海外のプロキシサーバーを経由してIPを偽装する https //addons.mozilla.org/ja/firefox/addon/anonymox/?src=userprofile Biscuit 必要なCookieを保護し、不要なCookieだけを削除 https //addons.mozilla.jp/firefox/details/220876 広告抹消アドオン Adblock Plus (Firefox,chrome[不完全]) https //adblockplus.org/ (ABP用の追加機能。要素の非表示でテキスト広告も抹消)Element Hiding Helper https //adblockplus.org/en/elemhidehelper ※プラグインは自分のよく行くサイトや目的などに合わせて取捨選択を! ■今後、Google系サイトにアクセスしないように対策 ●Acrylic DNS Proxyによる方法 設定方法は 1のwiki「Acrylic DNS Proxy」を参照 ※例えば「127.0.0.1 *.google.*」を指定しておくと、該当するURLに接続することを防ぐ。 ※Google関連のホスト名を根こそぎ追加。 ※代わりに、Windows のシステムファイルのhostsファイルを書きかえる方法もある (ただし、ワイルドカード(*)は使えない)。 6参照。 ●PeerBlock での設定(IPアドレスによるフィルタ) 設定方法は 1のwiki「PeerBlock」を参照 ※Acrylic DNS Proxy ではブロックできない http //74.125.235.120 などのIP直接指定を ブロックするためのもの。 ※Google関連のIPアドレスを根こそぎ追加。 ●Hostsによる遮断方法 1のwiki「hosts」も読んでね ※前述のAcrylic DNS Proxyでの対策を済ませた方は不要! 編集ツールHostsXpertをダウンロードします。※これがなくても直接メモ帳で開いても編集できます http //web.archive.org/web/20121105125828/http //www.funkytoad.com/index.php?option=com_content view=article id=13 Itemid=31 http //tora.nomaki.jp/hx.html まず、素のHostsファイルのバックアップを採っておきます、場所は C \Windows\System32\drivers\etcのHOSTSです。メモ帳で開きコピーしてドキュメントあたりに保存して下さい。 つぎに新しくメモ帳を開き以下をコピペして保存します。 127.0.0.1 toolbar.google.com 127.0.0.1 dl.google.com 127.0.0.1 ssl.google-analytics.com 127.0.0.1 www.google-analytics.com 127.0.0.1 pagead2.googlesyndication.com 127.0.0.1 cr-tools.clients.google.com 127.0.0.1 clients.l.google.com 127.0.0.1 static.cache.l.google.com HostsXpertを起動します。 Make Writeble?になっていたら、クリックして下さい。 下にあるImport Options...からReplace Hosts Fileを選び保存しておいた素のHostsファイルを読み込みます。 次いでAppend Hosts Fileから上記のGoogle Hosts Listを読み込みます。 Make ReadOnly?をクリックして作業終了←ウイルスによる改ざんを防ぐ為重要です。 Google Hosts抜けがあるので、追加してください。 (このリストは広告関連です)ttp //sysctl.org/cameleon/hosts.win 不要なサイトをhostsファイルに加えるスレ 0.0.0.2 http //toro.2ch.net/test/read.cgi/win/1312441319/ ※windowsユーザは、hostsでの設定よりも、前述のAcrylic DNS Proxyというソフトをお勧めします。 ■よくある質問とその答え Q.プライバシーポリシー統合って何? A.Googleは各サービスごとに分かれていたプライバシーポリシーを一つに統合しました。 つまり、Googleの全てのサービスを使用する際に同じポリシーが適用されるということです。 Q.何が問題なの? A.Googleのサービスを利用する際、下記のような情報が利用者への事前の通知、許可無しに Googleによって収集・統合され、「個人情報」として利用されます。 【氏名、メールアドレス、電話番号、クレジットカード番号、Googleで検索した単語や訪れたサイト、 電話のログ情報(自分、相手の電話番号、通話日時、通話時間など)、個人を特定できるPCのアドレス、 Cookie、現在地情報、etc...】 また、無線LANアクセスポイントのMACアドレスを収集し、Google Map上に表示する計画もあります。 Q.Googleのサービスって? A.Google検索、Gmail、Googleニュース、Googleマップ、Googleカレンダー等、Googleと頭に付くもののほか、 YoutubeもGoogleが親会社となっています。また、Googleの広告サービス(後述)等多岐に渡ります。 ソフトでは、Android OS、Chrome OS、Googleツールバー、Google Chrome、Picasa、Google日本語入力など。 詳しくはこちら→http //ja.wikipedia.org/wiki/Google%E3%81%AE%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9 Q.Googleのサービスを利用しなければ問題は無い? A.いいえ。なぜなら、新ポリシーには、Googleの検索ボックスや広告が表示されているサイトを訪れるだけで 情報を収集すると明記されているからです。 「Google は、ご利用のサービスやそのご利用方法に関する情報を収集することがあります。 たとえば、Google の広告サービスを使用しているウェブサイトにアクセスされた場合や、 Google の広告やコンテンツを表示または操作された場合です。(Googleプライバシーポリシーより)」 また、Google Analyticsが埋め込まれているサイトに訪れた場合も情報を収集されます。 Q.Google Analyticsって? A.Googleが提供するアクセス解析サービスです。Webサイトに埋め込む事によって、訪問者の 【滞在時間、訪問回数、訪問頻度、サイト内移動経路、検索キーワード、訪問者の来訪前経由サイト、 アクセスしてきた国・地域、etc...】を収集し、データベースに記録していきます。 つまり、あなたのブラウズ情報がGoogleに筒抜けになるわけです。 このサービスは無料で提供されているため、多くのWebサイトに埋め込まれています。 詳しくはこちら→http //ja.wikipedia.org/wiki/Google_Analytics Q.Googleのアカウント持ってないけど対策する必要ある? A.アカウントを持っていなくても、Cookieが有効ならGoogleは個人を識別することが可能です。 必ずCookie、JavaScript、外部プラグインを無効にし、RefererやUser-Agentも偽装するようにしましょう。 Q.他の検索エンジンだって情報集めてるでしょ? A.無料のWebサービスは、広告収入を得るため、ある程度の個人情報を収集しています。 個人情報の横断的な紐付けによる個人の特定(=プライバシーの侵害)を避けるため、 「1つの会社が提供するサービスの利用は1つまで」を心がけるようにしましょう。 例えば、MicrosoftのサービスはBing Mapのみ、Yahoo!のサービスはYahoo!メールのみ、などです。 Q._nomapは付けた方がいいの? A.SSIDの末尾に「_nomap」文字列を付加することにより、 Googleが収集した無線LANアクセスポイントをGoogle MAP上で公開させないOptOutとなります。 従いまして、基本的に付けた方がよいでしょう。 ただし、この場合でも無線LANアクセスポイントのMACアドレスは収集されてしまいます。 MACアドレスの収集を防ぐには、現状、無線LAN機能をオフにする以外に方法はない模様です。 Q.今さら対処しても遅いんじゃね? A.確かに収集された情報は返って来ませんが、これ以上被害が拡大することは防げます。 Q.どうしてもYouTubeだけ見たい A.Cookie, Referer, User-Agentを無効または偽装した状態で、JavaScriptとFlashのみ有効にした 状態であれば、ほぼ安全にYouTubeを閲覧できます。 Q.それでもGoogleのサービスを利用したい A.最終的には個人の判断と責任です。ただし、収集されるのはあなた個人の情報だけではありません。 Gmailによるメール、Androidによるメール・通話・アドレス帳などの情報は、自分だけでなく相手の情報も 収集されてしまいます。 自分の情報は自分の責任ですが、他人に迷惑はかけないようにしましょう。 ■Googleの悪行の数々 Google は、ご利用のサービスやそのご利用方法に関する情報を収集することがあります。 たとえば、Google の広告サービスを使用しているウェブサイトにアクセスされた場合や、 Google の広告やコンテンツを表示または操作された場合です。 2012/3月からGoogleが統合しサービスに利用するユーザーの個人情報 ttp //www.google.co.jp/intl/ja/policies/privacy/preview/ ・氏名、メール アドレス、電話番号、クレジットカード番号など ・端末固有の情報(たとえば、ハードウェア モデル、オペレーティング システムのバージョン、 端末固有の ID、電話番号などのモバイル ネットワーク情報) ・お客様によるGoogleサービスの使用状況の詳細(検索単語やアクセスしたサイトなど) ・電話のログ情報 (お客様の電話番号、通話の相手方の電話番号、転送先の電話番号、通話の日時、通話時間、 SMS ルーティング情報、通話の種類など) ・インターネット プロトコル アドレス ・端末のイベント情報(クラッシュ、システム アクティビティ、ハードウェアの設定、ブラウザの種類、 ブラウザの言語、お客様によるリクエストの日時、参照 URL など) ・お客様のブラウザまたはお客様の Google アカウントを特定できる Cookie ・現在地情報 ・固有のアプリケーション番号 ・ローカル ストレージ ・Cookie と匿名 ID これらを紐付けて統合し「個人情報」として利用していく Google、そっけない謝罪、個人情報流出の問題を「安全のヒント」として掲載 ttp //news.goo.ne.jp/article/niftybusiness/business/niftybusiness-dt-10581.html Android端末向けのアプリケーション配信サービス「Android Market」で、アプリを購入した人の個人情報が 流出していた問題で、サービスを運営するGoogleは謝罪した。しかしヘルプ記事の一部に短い文章を載せるという、 そっけない対応に批判も出ている。 以上のように、Googleは多くの重要な個人情報を収集しているにもかかわらず、 流出した際の対応は非常に簡素でドライなものです。 このような社風のGoogleに個人情報を預けるのは、非常に危険であると言わざるを得ないというのが現状です。 ■Androidの問題点 ・AndroidのベースになったLinuxからセキュリティ関連の機能の多くを「意図的に」削ってある。(ファイアーウォール・常駐ソフト/サービス管理・権限関係制御) ・自分の端末であろうと、ハッキングしないと管理者権限がないので上記の対策が出来ない。つまり勝手に通信するソフトを止めたりする事が困難。 ・起動すると動作が緩慢になるまで常駐アプリを立ち上げ続け、多くが通信している(多い時は20個以上)。 しかも、所有者が常駐管理出来ない。一時的に停止しても何度も何度も立ち上げてくる。(ゾンビアプリ) ・切っても切ってもWebブラウザとGoogle Mapが勝手に立ち上がってくるので、何も設定変更していない人は四六時中位置を捕捉される。 ・金銭を伴う可能性のあるアプリケーション「Androidマーケット」も勝手に立ち上がる。 ・SDカードは殆どのアプリケーションから覗けるので外部から丸見え状態と言っても過言ではない。 ・ウィルス対策ソフトが一般ユーザー権限なので、悪意のあるアプリケーションがその動作を切ろうと思えば簡単に出来る。 ・多くのサードパーティー製ソフトが不必要な権限を持っていて色々な事を悪意を持って行う事が可能。殆どのソフトが通信機能あり。 ・余所の人間が作るとキーロガーとしてウィルス認定される様な入力記録・送信ソフトを「ソーシャルIME」として配布している。 ・今回の規約改訂で端末内覗き放題・ノープライバシー(ユーザー以外の情報が含まれていれば、その人の情報も筒抜け) ・デバイスでサードパーティ製アプリを利用した場合、そのアプリにより収集されるすべての情報が製造元に送信され、Googleのプライバシーポリシーは適用されない。 ・Androidマーケットは無審査であるためマルウェアを購入するリスクがある。 ・Android端末を持って歩いているだけで、他のユーザーのSSIDやMACアドレスの情報を収集してしまう 世間的には大々的に売り出されているにも拘わらず、場合によってはPCよりも更にたちの悪い事になっています。 問題の大きさに比べ、日本の報道ではほとんど問題点が指摘されていない上に、Google社製OS等と紹介され「Android」の言葉すら出てきません。 ■関連ニュース一覧 (脱google@wikiニュース一覧: 1のwiki「記事」) 2008/7/29 グーグルが収集しているユーザーデータの秘密/グーグルのダークサイド?(前編) ttp //web-tan.forum.impressrd.jp/e/2008/07/29/3663 2008/7/30 グーグルが収集している280項目以上のユーザーデータ一覧/グーグルのダークサイド?(後編) ttp //web-tan.forum.impressrd.jp/e/2008/07/30/3664 Googleは「邪悪」になっていく? ユーザーの全データをサービス横断で利用 ttp //www.gizmodo.jp/2012/01/google_53.html Google、プライバシーポリシーと利用規約を更新へ データの横断収集でターゲティングを強化 ttp //www.itmedia.co.jp/news/articles/1201/25/news047.html 米Googleが来月施行する新プライバシーポリシーにEUが「待った」 ttp //news.mynavi.jp/news/2012/02/08/038/index.html MS が Google の新ポリシーを批判、手紙を盗み見る Gmail Man も登場 ttp //www.excite.co.jp/News/it_g/20120203/Engadget_ms-google-gmail-man.html プライバシー擁護団体EPIC、Googleのポリシー更新めぐりFTCを提訴 ttp //www.itmedia.co.jp/enterprise/articles/1202/09/news040.html Googleは「邪悪」になったのか ttp //www.newsweekjapan.jp/stories/business/2011/12/post-2371.php 総務省がGoogleに指導 無線LAN通信を傍受、「通信の秘密侵害」の恐れ ttp //www.itmedia.co.jp/news/articles/1111/11/news089.html FB化するGoogle新サービスに要注意! ttp //www.newsweekjapan.jp/stories/business/2012/02/post-2439.php?page=1 トリップ倉庫 ◆nrJiaquma6 myEwqxVs ◆iQt8J1rC5Q RbHEPzK0 ◆P8ydMooWnedf オバケ愛用者 ◆oiRCWlysW6 過去ログリンク倉庫 【軍事も家電も】脱Google総合★26【買収するよ】 http //toro.2ch.net/test/read.cgi/google/1392288202/ 【メール本文も】脱Google総合★25【広告利用】 http //toro.2ch.net/test/read.cgi/google/1383643594/ 【収集も紐つけも】脱Google総合★24【脱税も】 http //toro.2ch.net/test/read.cgi/google/1372165095/ 【Googleカード】脱Google総合★23【履歴丸見え】 http //toro.2ch.net/test/read.cgi/google/1350699738/ 【故人のメール】脱Google総合★22【家族に開示】 http //toro.2ch.net/test/read.cgi/google/1343461421/ 【検閲】脱Google総合★21【サービス】 http //toro.2ch.net/test/read.cgi/google/1340506666/ 【金積めば】脱Google総合★20【犯罪者擁護】 http //toro.2ch.net/test/read.cgi/google/1337269396/ 【日本の法律には】脱Google総合★19【従わない】 http //toro.2ch.net/test/read.cgi/google/1335434116/ 【タダより高い】脱Google総合★18【物はない】 http //toro.2ch.net/test/read.cgi/google/1333723960/ 【プライバシーなど】脱Google総合★17【存在しない】 http //toro.2ch.net/test/read.cgi/google/1332393884/ 脱Google総合★16 http //toro.2ch.net/test/read.cgi/google/1331528941/ 【工作員のテンプレ偽装】脱Google総合★15【注意!】 http //toro.2ch.net/test/read.cgi/google/1331113547/ 脱Google総合 ★14 (テンプレ偽装アリ「nogoog1e」への誘導レスに注意!) http //toro.2ch.net/test/read.cgi/google/1331007906/ 【プライバシーなど】脱Google総合★13【存在しない】 http //toro.2ch.net/test/read.cgi/google/1330784236/ 【ストーキング】脱Google総合★12【大好き】 http //toro.2ch.net/test/read.cgi/google/1330662486/ 【ググるな】脱Google総合★11【危険!】 http //toro.2ch.net/test/read.cgi/google/1330589795/ 【情報家畜箱】脱Google総合★10【脱走しようぜ】 http //toro.2ch.net/test/read.cgi/google/1330528744/ 【情報家畜に】脱Google総合★9【なりたいの?】 http //toro.2ch.net/test/read.cgi/google/1330516122/ 【ググるって】脱Google総合★7【死語だよね】 ※実質★8 http //toro.2ch.net/test/read.cgi/google/1330468029/ 【いよいよ3月】脱Google総合★7【早急に対策せよ】 http //toro.2ch.net/test/read.cgi/google/1330356779/ 【アナタノ事ハ】脱Google総合★6【アナタヨリ知ってる】 http //toro.2ch.net/test/read.cgi/google/1330175495/ 【個人情報】脱Google総合★5【丸裸】 http //toro.2ch.net/test/read.cgi/google/1329924156/ 脱google総合★4 http //toro.2ch.net/test/read.cgi/google/1329738355/ 【マルウェア化】脱google総合★2 ※実質★3 http //toro.2ch.net/test/read.cgi/google/1328943692/ 脱google総合★2 http //toro.2ch.net/test/read.cgi/google/1328885287/ 【マルウェア化】脱google総合★1 http //toro.2ch.net/test/read.cgi/google/1328257836/
https://w.atwiki.jp/api_programming/pages/37.html
下位ページ Content 認証リクエスト OAuth2.0 の概要 WebサーバアプリケーションのOauth 2.0認証 Using OAuth 2.0 for Web Server Applications 概要 認証プロトコルについて OAuth 2.0 による認証 いろんな言語のライブラリ web application credentialsを作る web application credentials を得るステップ Preparing to start the OAuth 2.0 flowGoogle's OAuth 2.0 サーバにリダイレクト OAuth 2.0 serverのレスポンスを扱う Google APIsを呼び出す サンプル完全版Incremental authorization Offline accessトークンのリクエストjava? リダイレクトのURLから、codeを処理する authorization code と access token の交換 認証リクエスト Google APIにリクエストを送るには、アプリケーションの「identify」が必要で、その方法は2つある。 OAuth 2.0 token (which also authorizes the request) API key どちらをつかうのか、は以下で決まる。 プライベートデータを使うときは、OAuth 2.0 token でなければならない。アプリケーションには API key も配布されるが必須でない。 パブリックデータを使うときは the API key でも OAuth 2.0 token 使いやすい方で良い, or both—whatever option is most convenient for you. OAuth2.0 の概要 https //developers.google.com/identity/protocols/OAuth2?csw=1 WebサーバアプリケーションのOauth 2.0認証 Using OAuth 2.0 for Web Server Applications Google API の認証 Google Identity Platform https //developers.google.com/identity/protocols/OAuth2WebServer Using OAuth 2.0 for Web Server Applications Google APIsを使うために、Google API Client Libraries or Google OAuth 2.0 endpoints が使える。 OAuth 2.0 で、ユーザは、ユーザ名やパスワードをプログラムに渡すことなく、Google アプリケーションのデータが使える。 概要 まず、APIコンソールでプロジェクトの「web application credentials」をつくる。アプリケーションがユーザーデータにアクセスする必要がある場合は、ユーザーはGoogle s OAuth 2.0 serverにリダイレクトされる。OAuth 2.0 server はユーザ承認をして、アプリケーションからのデータアクセスに必要な「consent」を得る。 OAuth 2.0 serverはユーザーをアプリケーションにリダイレクトする(戻す)。このとき、承認コードを返す。アプリケーションで承認コードをアクセストークンに交換する。 アプリケーションは承認コードを使って、Google API にアクセスする。 When you use a Google API Client Library to handle your application s OAuth 2.0 flow, the client library keeps track of when a stored access token can be used and when the application must re-acquire consent, generates correct redirect URLs, and helps to implement redirect handlers that exchange authorization codes for access tokens. An application that carries out the OAuth 2.0 flow without using a client library must correctly complete the same steps. Client libraries The language-specific examples on this page make use of the Google API Client Libraries, which make API authorization with OAuth 2.0 simpler. To run the example code, you must first install the client library for your language. 認証プロトコルについて OAuth 2.0しかないが、Google Sign-In が使えるアプリケーションなら、違う「扱い方」をすることが可能 OAuth 2.0 による認証 Requests to the Google Sheets API for non-public user data must be authorized by an authenticated user. The details of the authorization process, or "flow," for OAuth 2.0 vary somewhat depending on what kind of application you re writing. The following general process applies to all application types アプリケーションを作成したら、Google API Console に使用登録をする。これに関する細かな情報は後述。 (Sheets API を使うのであれば)Google Sheets API を Google API Console でアクティベートする。(使用する API がリストになければ、このステップは飛ばす) アプリケーションがユーザーデータを必要とするのであれば、Google に アクセススコープを要求する。 Google はユーザーに確認画面を表示し、アプリケーションを認証するか尋ねる。 ユーザが認証したら、Google がアプリケーションにアクセストークンを発行する。 アプリケーションがユーザーデータ(プライベートデータ)を要求する場合は、アクセストークンをつけて要求する。 Google はリクエストとトークンが有効と判断したら、要求されたデータを返す 以上が基本の流れで、ところどころ追加ステップが必要になる。例えば、トークンの有効期限が切れた場合のリフレッシュ作業など。 いろんな言語のライブラリ 省略 web application credentialsを作る All web applications that use OAuth 2.0 must have credentials that identify the application to the OAuth 2.0 server. Applications that have these credentials can access the APIs that you enabled for your project. web application credentials を得るステップ APIコンソールの認証情報ページへ。 (まだ作っていなければ)「認証情報を作成」をクリックして、OAuth クライアント ID を選択する。 次に、クライアントIDとクライアントSecretを探す。 リダイレクトURIも編集。リダイレクトURIはエンドポイントで、レスポンスに乗ってくる情報を処理する。ローカルマシンで試す場合は、http //localhost 8080みたいなのも可。 client_secrets.jsonファイルをダウンロードしてセキュリティ性を保って保管する(ほうがいい) Important Do not store the client_secrets.json file in a publicly-accessible location, and if you share the source code to your application—for example, on GitHub—store the client_secrets.json file outside of your source tree to avoid inadvertently sharing your client credentials. Preparing to start the OAuth 2.0 flow If you are using a Google API client library to handle the OAuth 2.0 flow, configure the client object, which you will use to make OAuth 2.0 requests. If you are handling the flow by directly accessing the OAuth 2.0 endpoints, just take note of the client ID that you created in the previous step and the scopes you need to request. To configure the client object HTTP/REST Take note of the following values Your app s client ID and client secret, which you created in Creating web application credentials. The scopes that your app needs to request. See the documentation for the APIs your app uses for the required scopes. Google s OAuth 2.0 サーバにリダイレクト HTTP/REST https //accounts.google.com/o/oauth2/v2/auth HTTP はだめ。HTTPSで。 https //accounts.google.com/o/oauth2/v2/auth? scope=email%20profile state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome redirect_uri=https%3A%2F%2Foauth2.example.com%2Fcode , response_type=code client_id=812741506391.apps.googleusercontent.com The set of query string parameters supported by the Google Authorization Server for web server applications are Parameter Values Description response_type code Determines whether the Google OAuth 2.0 endpoint returns an authorization code. Web server applications should use code. client_id クライアントID リクエストを出したクライアントの特定 required redirect_uri コンソールで登録したリダイレクトURIの一つ 登録されたURIとピッタリ合わないとだめ。(http / https も scope アプリケーションにリクエストするパーミッション(スペース区切り) 使うスコープは承認画面でユーザーに公開される。要求されたパーミッション数と、ユーザーの同意を得る可能性との間には逆の可能性があります。使えるスコープの種類は、APIs Explorerで確認のこと。It is generally a best practice to request scopes incrementally, at the time access is required, rather than up front. 例えば、For example, an app that wants to support purchases should not request Google Wallet access until the user presses the “buy” button; see Incremental authorization. state Any string Provides any state that might be useful to your application upon receipt of the response. The Google Authorization Server roundtrips this parameter, so your application receives the same value it sent. To mitigate against cross-site request forgery (CSRF), it is strongly recommended to include an anti-forgery token in the state, and confirm it in the response. See OpenID Connect for an example of how to do this. access_type online / offline Indicates whether your application needs to access a Google API when the user is not present at the browser. This parameter defaults to online. If your application needs to refresh access tokens when the user is not present at the browser, then use offline. This will result in your application obtaining a refresh token the first time your application exchanges an authorization code for a user. prompt Space-delimited, case-sensitive list of prompts to present the user. If you don t specify this parameter, the user will be prompted only the first time your app requests access. 可能なあたいとして、"none" 画面を出さないMust not be specified with other values. consentPrompt the user for consent select_accountPrompt the user to select an account login_hint email address or sub identifier When your application knows which user it is trying to authenticate, it can provide this parameter as a hint to the Authentication Server. Passing this hint will either pre-fill the email box on the sign-in form or select the proper multi-login session, thereby simplifying the login flow. include_granted_scopes true / false If this is provided with the value true, and the authorization request is granted, the authorization will include any previous authorizations granted to this user/application combination for other scopes; see Incremental Authorization. After you create the request URL, redirect the user to it. Google s OAuth 2.0 server will authenticate the user and obtain consent from the user for your application to access the requested scopes. The response will be sent back to your application using the redirect URL you specified. OAuth 2.0 serverのレスポンスを扱う ユーザがアクセス要求を承認すると、認証コードが送られてくる。 承認しなければ、レスポンスにはエラーメッセージが含まれてくる。 All responses are returned to the web server on the query string, as shown below エラー https //oauth2.example.com/auth?error=access_denied 承認 https //oauth2.example.com/auth?code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7 Important If your response endpoint renders an HTML page, any resources on that page will be able to see the authorization code in the URL. Scripts can read the URL directly, and all resources may be sent the URL in the Referer HTTP header. Carefully consider if you want to send authorization credentials to all resources on that page (especially third-party scripts such as social plugins and analytics). To avoid this issue, we recommend that the server first handle the request, then redirect to another URL that doesn t include the response parameters. 認証コードを受け取ったら、アクセストークンと交換 ここにアクセス https //www.googleapis.com/oauth2/v4/token 使用するパラメータ Field Description code The authorization code returned from the initial request. client_id The client ID obtained from the API Console. client_secret The client secret obtained from the API Console. redirect_uri One of the redirect URIs listed for this project in the API Console. grant_type As defined in the OAuth 2.0 specification, this field must contain a value of authorization_code. リクエスト例 POST /oauth2/v4/token HTTP/1.1 Host www.googleapis.com Content-Type application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7 client_id=8819981768.apps.googleusercontent.com client_secret={client_secret} redirect_uri=https //oauth2.example.com/code grant_type=authorization_code リクエストが通ると以下のレスポンスが戻る Field Description access_token Google APIにアクセスするためのトークン refresh_token 新しいアクセストークンを得るためのトークン。ユーザが承認を取り消すまで有効。このフィールドは access_type=offline が認証コードリクエストに含まれていれば、only present expires_in The remaining lifetime of the access token. token_type Identifies the type of token returned. At this time, this field will always have the value Bearer. レスポンスはJSONで帰ってくる { "access_token" "1/fFAGRNJru1FTz70BzhT3Zg", "expires_in" 3920, "token_type" "Bearer" } Note Other fields may be included in the response, and your application should not treat this as an error. The set shown above is the minimum set. Google APIsを呼び出す HTTP/REST access tokenを使って、APIを呼び出す。access token は (サーバログに残ってしまうので良くないが)"access_token" としてパラメータに含めるか、 (推奨は)HTTPヘッダの Authorization Bearer に含める。 You can try out all the Google APIs and view their scopes at the OAuth 2.0 Playground. 例 A call to the drive.files endpoint (the Drive API) using the access_token query string parameter might look like the following, though you ll need to specify your own access token GET https //www.googleapis.com/drive/v2/files?access_token=1/fFBGRNJru1FQd44AzqT3Zg Authorization Bearer HTTP header を使って同じことをすると GET /drive/v2/files HTTP/1.1 Authorization Bearer 1/fFBGRNJru1FQd44AzqT3Zg Host googleapis.com You can try out with the curl command-line application. Here s an example using the HTTP header option (preferred) curl -H "Authorization Bearer 1/fFBGRNJru1FQd44AzqT3Zg" https //www.googleapis.com/drive/v2/files Or, alternatively, the query string parameter option curl https //www.googleapis.com/drive/v2/files?access_token=1/fFBGRNJru1FQd44AzqT3Zg Google/Sheets API サンプル完全版 The following example prints a JSON-formatted list of files in a user s Google Drive after the user authenticates and gives consent for the application to access the user s Drive files. HTTP/REST This example in Python uses the Flask framework and the Requests library to demonstrate the OAuth 2.0 web flow. Note that using the Python client library is easier and is the recommended way to implement this flow. import json import flask import requests app = flask.Flask(__name__) CLIENT_ID = 123456789.apps.googleusercontent.com CLIENT_SECRET = abc123 # Read from a file or environmental variable in a real app SCOPE = https //www.googleapis.com/auth/drive.metadata.readonly REDIRECT_URI = http //example.com/oauth2callback @app.route( / ) def index() if credentials not in flask.session return flask.redirect(flask.url_for( oauth2callback )) credentials = json.loads(flask.session[ credentials ]) if credentials[ expires_in ] = 0 return flask.redirect(flask.url_for( oauth2callback )) else headers = { Authorization Bearer {} .format(credentials[ access_token ])} req_uri = https //www.googleapis.com/drive/v2/files r = requests.get(req_uri, headers=headers) return r.text @app.route( /oauth2callback ) def oauth2callback() if code not in flask.request.args auth_uri = ( https //accounts.google.com/o/oauth2/v2/auth?response_type=code client_id={} redirect_uri={} scope={} ).format(CLIENT_ID, REDIRECT_URI, SCOPE) return flask.redirect(auth_uri) else auth_code = flask.request.args.get( code ) data = { code auth_code, client_id CLIENT_ID, client_secret CLIENT_SECRET, redirect_uri REDIRECT_URI, grant_type authorization_code } r = requests.post( https //www.googleapis.com/oauth2/v4/token , data=data) flask.session[ credentials ] = r.text return flask.redirect(flask.url_for( index )) if __name__ == __main__ import uuid app.secret_key = str(uuid.uuid4()) app.debug = False app.run() Incremental authorization In the OAuth 2.0 protocol, your app requests authorization to access resources which are identified by scopes, and assuming the user is authenticated and approves, your app receives short-lived access tokens which let it access those resources, and (optionally) refresh tokens to allow long-term access. It is considered a best user-experience practice to request authorization for resources at the time you need them. For example, an app that lets people sample music tracks and create mixes might need very few resources at sign-in time, perhaps nothing more than the name of the person signing in. However, saving a completed mix would require access to their Google Drive. Most people would find it natural if they only were asked for access to their Google Drive at the time the app actually needed it. In this case, at sign-in time the app might request the profile scope to perform basic sign-in, and then later request the https //www.googleapis.com/auth/drive.file scope at the time of the first request to save a mix. Using the procedures described in Using OpenID Connect and Using OAuth 2.0 to Access Google APIs would normally result in your app having to manage two different access tokens. To avoid this complexity, you can include previously granted scopes in your authorization requests. For example HTTP/REST GET https //accounts.google.com/o/oauth2/v2/auth? scope=https //www.googleapis.com/auth/drive.file state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome redirect_uri=https%3A%2F%2Fmyapp.example.com%2Fcallback response_type=code client_id=8127352506391.apps.googleusercontent.com prompt=consent include_granted_scopes=true Let s call the resulting authorization the "combined authorization"; the following apply You can use the access tokens you get to access the resources corresponding to any of the scopes that are rolled into the combined authorization. When you use the refresh token for a combined authorization, the new access tokens represent the combined authorization and can be used for any of its scopes. The combined authorization includes any previously granted authorizations even if they were requested from different clients. For example, if you requested the profile scope from a desktop app, and then issued the request in the example URI above for the same user from a mobile app, and it was granted, the combined authorization would include both scopes. When you revoke a token which represents a combined authorization, all of the authorizations are revoked simultaneously; this means that if you retain a token for one of the previous authorizations, it will stop working. When you make an authorization request with granted scopes included, the Google authorization server rolls the authorization request together with all the previous authorizations granted to the requesting user from the requesting app. Offline access ユーザが使っていない場合でもAPIにアクセスする必要がある場合があるかも。たとえば、バックアップの場合や「月曜8時にBlobをポスト」のような場合。 このタイプのアクセスを「offline」と呼び、ウェブサーバアプリはオフラインリクエストができる。 これに対し、通常のアクセスはonlineである。 HTTP/REST If your application needs offline access to a Google API, then the request for an authorization code should include the access_type parameter, where the value of that parameter is offline. For example https //accounts.google.com/o/oauth2/v2/auth? scope=email%20profile state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome redirect_uri=https%3A%2F%2Foauth2.example.com%2Fcode response_type=code client_id=812741506391.apps.googleusercontent.com access_type=offline The first time a given user s browser is sent to this URL, they see a consent page. If they grant access, then the response includes an authorization code which may be redeemed for an access token and a refresh token. An example of an authorization code exchange is shown below POST /oauth2/v4/token HTTP/1.1 Host www.googleapis.com Content-Type application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7 client_id=8819981768.apps.googleusercontent.com client_secret={client_secret} redirect_uri=https //oauth2.example.com/code grant_type=authorization_code If this is the first time the application has exchanged an authorization code for a user, then the response includes an access token and a refresh token, as shown below { "access_token" "1/fFAGRNJru1FTz70BzhT3Zg", "expires_in" 3920, "token_type" "Bearer", "refresh_token" "1/xEoDL4iW3cxlI7yDbSRFYNG01kVKM2C-259HOF2aQbI" } Important When your application receives a refresh token, it is important to store that refresh token for future use. If your application loses the refresh token, it will have to re-prompt the user for consent before obtaining another refresh token. If you need to re-prompt the user for consent, include the prompt parameter in the authorization code request, and set the value to consent. After your application receives the refresh token, it can obtain new access tokens at any time. See the section on refresh tokens for more information. The next time your application requests an authorization code for that user, the user will not be asked to grant consent (assuming they previously granted access, and you are asking for the same scopes). As expected, the response includes an authorization code which may be redeemed. However, unlike the first time an authorization code is exchanged for a given user, a refresh token will not be returned from the authorization code exchange. The following is an example of such a response { "access_token" "1/fFAGRNJru1FQd77BzhT3Zg", "expires_in" 3920, "token_type" "Bearer", } Using a refresh token As indicated in the previous section, a refresh token is obtained in offline scenarios during the first authorization code exchange. In these cases, your application may obtain a new access token by sending a refresh token to the Google OAuth 2.0 Authorization server. To obtain a new access token this way, your application sends an HTTPS POST request to https //www.googleapis.com/oauth2/v4/token. The request must include the following parameters FieldDescription refresh_tokenThe refresh token returned from the authorization code exchange. client_idThe client ID obtained from the API Console. client_secretThe client secret obtained from the API Console. grant_typeAs defined in the OAuth 2.0 specification, this field must contain a value of refresh_token. Such a request will look similar to the following POST /oauth2/v4/token HTTP/1.1 Host www.googleapis.com Content-Type application/x-www-form-urlencoded client_id=8819981768.apps.googleusercontent.com client_secret={client_secret} refresh_token=1/6BMfW9j53gdGImsiyUH5kU5RsR4zwI9lUVX-tqf8JXQ grant_type=refresh_token As long as the user has not revoked the access granted to your application, the response includes a new access token. A response from such a request is shown below { "access_token" "1/fFBGRNJru1FQd44AzqT3Zg", "expires_in" 3920, "token_type" "Bearer", } Note that there are limits on the number of refresh tokens that will be issued; one limit per client/user combination, and another per user across all clients. You should save refresh tokens in long-term storage and continue to use them as long as they remain valid. If your application requests too many refresh tokens, it may run into these limits, in which case older refresh tokens will stop working. Revoking a token In some cases a user may wish to revoke access given to an application. A user can revoke access by visiting Account Settings. It is also possible for an application to programmatically revoke the access given to it. Programmatic revocation is important in instances where a user unsubscribes or removes an application. In other words, part of the removal process can include an API request to ensure the permissions granted to the application are removed. PHPPYTHONRUBYHTTP/REST To programmatically revoke a token, your application makes a request to https //accounts.google.com/o/oauth2/revoke and includes the token as a parameter curl https //accounts.google.com/o/oauth2/revoke?token={token} The token can be an access token or a refresh token. If the token is an access token and it has a corresponding refresh token, the refresh token will also be revoked. If the revocation is successfully processed, then the status code of the response is 200. For error conditions, a status code 400 is returned along with an error code. Note Following a successful revocation response, it might take some time before the revocation has full effect. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Using OAuth 2.0 with the Google API Client Library for Java {{ Authorization Code Flow https //code.google.com/p/google-api-java-client/wiki/OAuth2#Authorization_Code_Flow 実装にはGoogleAuthorizationCodeFlowを用いる。 まず、API使用が登録済みであること。client id, client secret等々をもらっておく Authorization codeをもらう持っていなければ、認証URLへ。 ユーザIDをもとに、AuthorizationCodeFlow.loadCredential(String userID)を呼び出す既に証明書を持っているかを確認。持っていれば、終了。 認証されると、"code"と一緒にリダイレクトされる。 "code"を使って access token を要求する AuthorizationCodeFlow.newTokenRequest(String)でアクセストークン(access token)を要求。AuthorizationCodeFlow.createAndStoreCredential(TokenResponse, String) http //javadoc.google-oauth-java-client.googlecode.com/hg/1.18.0-rc/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.html#createAndStoreCredential(com.google.api.client.auth.oauth2.TokenResponse,%20java.lang.String)]] で、証明書を取得し保管。 レスポンスからaccess tokenを取得 ※Lower-Levelの実装方法もある https //code.google.com/p/google-api-java-client/wiki/OAuth2#Authorization_Code_Flow }} トークンのリクエスト リクエスト先 https //accounts.google.com/o/oauth2/authSSLを使用すること。httpはダメ リクエストに加えるのは Parameter Values 必須 Description response_type "code" ◯ Webサーバアプリケーションでは code で決め打ち client_id client_id ◯ API使用の登録で貰ったID.忘れていたらconsoleで確認 redirect_uri One of the redirect_uri ◯? リダイレクト先は複数登録されているので、どこにリダイレクトするのかここで書いておく。 scope Space-delimited set of permissions that the application requests. ◯ APIでどこまでユーザーのデータにアクセスするか(できるか)。複数ある場合はスペース区切り。どのような値を入れるかは、各APIのリファレンスページ(the APIs Explorer)参照。極力「最小」にしておく。必要なら後で追加認証をする感じで。 state Any string レスポンスを受け取る際に使える「状態」。cross-site request forgery (CSRF)の対策?なので、強く推奨。レスポンスを受け取って、これを確認すれば、変なとこで使われていないか、確認できる。 access_type offline or online ユーザがブラウザを使ってない時でもアプリケーションがアクセスするかどうか。自動的にトークンのリフレッシュが必要ならoffline。 approval_prompt force or auto optional デフォルトでauto 接続の度にプロンプトを出して訊くかどうか? login_hint email address or sub identifier optional どのユーザが認証を行おうとしているかアプリケーション側でわかっている場合、(例えばそのユーザのemailアドレスを)パラメータとして渡すことができる。 include_granted_scopes true or false optional If this is provided with the value true, and the authorization request is granted, the authorization will include any previous authorizations granted to this user/application combination for other scopes; see Incremental Authorization. リクエストのスペース等々はエスケープする。 java.net.URLEncoder とか サンプル(改行は見やすくするため) https //accounts.google.com/o/oauth2/auth? scope=email%20profile state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome redirect_uri=https%3A%2F%2Foauth2-login-demo.appspot.com%2Fcode , response_type=code client_id=812741506391.apps.googleusercontent.com approval_prompt=force リクエストが正しく通れば、以下が返ってくる access tokens refresh tokens authorization codes. java? AuthorizationCodeFlow.newAuthorizationUrl()が使える? リダイレクトのURLから、codeを処理する Handling the response The response will be sent to the redirect_uri as specified in the request URL. If the user approves the access request, then the response contains an authorization code and the state parameter (if included in the request). If the user does not approve the request, the response contains an error message. All responses are returned to the web server on the query string, as shown below 認証失敗 https //oauth2-login-demo.appspot.com/code? bold(){error=access_denied} state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome 認証成功 https //oauth2-login-demo.appspot.com/code?state=security_token%3D138r5719ru3e1%26url%3Dhttps //oa2cb.example.com/myHome bold(){code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7} リダイレクト先が通常のHTMLページの場合は、そのままURLが見える、つまりcodeが見えてしまう。 Scripts can read the URL directly, and all resources may be sent the URL in the Referer HTTP header. Carefully consider if you want to send authorization credentials to all resources on that page (especially third-party scripts such as social plugins and analytics). この問題を避けるために、サーバでリクエストを扱って、それからパラメータを含まない形で別のURLにリダイレクトするべき。 authorization code と access token の交換 After the web server receives the authorization code, it may exchange the authorization code for an access token and a refresh token. This request is an HTTPS POST to the URL https //www.googleapis.com/oauth2/v3/token, and includes the following parameters Field Description code authorization code client_id The client ID client_secret The client secret obtained from the Developers Console redirect_uri One of the redirect URIs grant_type ここでは "authorization_code" の決め打ち レスポンス例(成功時) { "access_token" "ya29.vAHSwBFxEzkYKAeqk461biUJ9dqSD8KglnarHgBaR7q7Ih_4TlT71KEh07QBR6_tfLVv", "token_type" "Bearer", "expires_in" 3600}
https://w.atwiki.jp/keiplus/pages/211.html
Google Map gas google googleApi 本項は書きたての記事です。正確な情報は公式サイト、公式ドキュメント、記載の参照サイトでご確認ください。 目次 + 読む Google Map目次 content 参考 content できればGAS、GoogleAPIを使って作りたいところです。しかしGoogleMapAPIは$2/1000req、Workspaceは680/月から。 本当に業務(商売)としてやっているならともかく個人ユースでは無料枠内で使いたいもの。 そこでHYPERLINKを使って、検索クエリーを渡してマップを表示する、であればやっていることはほぼ同じで料金もかかりません。 コール数の制限もかかりません。 目的 関数またはGAS リンクから指定地図を表示 HYPERLINK("https //www.google.co.jp/maps/place/" 「建物名など」,"map") 現在地から目的地への車ルートを表示 HYPERLINK("https //www.google.com/maps/dir/?api=1 origin=現在地 destination=" 「目的地名など」 " travelmode=driving","車ルート") ルート検索で、origin=現在地 としておくと今いる地点を起点としてくれます。 車の移動途中で経路を見たい場合に便利です。 あとはSpreadSheetで、出発地、経由地、目的地、移動手段のパラメーターを入れるセル(列)を設定して、HYPERLINK関数で整えば、リンク完成です。 旅行やツーリングなどの計画するときに便利だと思います。 ルート検索(travelmode)には、 車: driving 自転車: bicycling 電車: transit 徒歩: walking があります。 また各地点は以下のパラメータで設定できます。 出発点: origin 経由地: waypoints 目的地: destination 走行距離や時間など出力して表にまとめたい、といった高度なことを行いたい場合はGoogleApiを使わざるを得ないと思いますが距離も時間もマップ上に表示されているので普段に使う場合はこれで十分でしょう。 参考 [ GoogleMapへのリンクURL作成方法を調べた - Qiita ] ( https //qiita.com/hiron2225/items/8d5cd1b6728b4d63434b )
https://w.atwiki.jp/ooblkeland/pages/282.html
用來複製 Excel Sheet 的 function function copy_sheet(source_excel_id,target_excel_id){ //Source set 參考 //https //developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app var ss = SpreadsheetApp.openById(source_excel_id); Logger.log(ss.getName()); //set target sheet by .getSheet 參考 https //developers.google.com/apps-script/reference/spreadsheet/sheet#copyTo(Spreadsheet) var sheet = ss.getSheets()[0]; var destination = SpreadsheetApp.openById(target_excel_id); //目標 Excel 檔案 sheet.copyTo(destination); //將來源檔案中指定的 Sheet 複製到目標 Excel 檔案裡面(會出現在最前面) } function go(){ copy_sheet("來源 Excel ID","目標 Excel ID"); }; //最後直接執行 go(); 看結果有沒有複製第一個 Sheet 到目標 Excel 檔案。有就成功。 目前完成的應用 自動複製特定 Sheet 並格式化更改 Sheet 名稱