<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Google API on 小惡魔 - AppleBOY</title><link>https://blog.wu-boy.com/tags/google-api/</link><description>Recent content in Google API on 小惡魔 - AppleBOY</description><generator>Hugo</generator><language>en-us</language><managingEditor>appleboy.tw@gmail.com (Appleboy)</managingEditor><webMaster>appleboy.tw@gmail.com (Appleboy)</webMaster><lastBuildDate>Thu, 17 Feb 2011 05:38:24 +0000</lastBuildDate><atom:link href="https://blog.wu-boy.com/tags/google-api/feed.xml" rel="self" type="application/rss+xml"/><item><title>PHP CodeIgniter Google URL Shortener API Library</title><link>https://blog.wu-boy.com/2011/02/php-codeigniter-google-url-shortener-api-library/</link><pubDate>Thu, 17 Feb 2011 05:38:24 +0000</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2011/02/php-codeigniter-google-url-shortener-api-library/</guid><description>&lt;div style="margin: 0 auto; text-align: center;"&gt;
 &lt;img src="https://i1.wp.com/farm5.static.flickr.com/4139/4928689646_4309e16e13_o.png?w=840&amp;#038;ssl=1" alt="CodeIgniter" data-recalc-dims="1" /&gt;
&lt;/div&gt;
&lt;h3 id="原由-由於-bbs-的盛行從最早的"&gt;&lt;strong&gt;原由&lt;/strong&gt; 由於 bbs 的盛行，從最早的&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://0rz.tw/"&gt;0rz.tw&lt;/a&gt; 短網址出現，陸陸續續出來很多更好用的網址: &lt;a href="http://tinyurl.com/"&gt;tinyurl.com&lt;/a&gt;, &lt;a href="http://bit.ly/"&gt;bit.ly&lt;/a&gt;，後來 Google 也推出 &lt;a href="http://goo.gl/"&gt;goo.gl&lt;/a&gt; 服務，讓大家可以使用，提供了 &lt;a href="http://code.google.com/intl/zh-TW/apis/urlshortener/"&gt;Google URL Shortener API&lt;/a&gt; 讓程式開發者可以順利使用此 API，當然在使用 API 之前一定要跟 Google 申請一組 API Key，先到 &lt;a href="https://code.google.com/apis/console/"&gt;Google API Console&lt;/a&gt; 申請，Shortener API 的規定每天可以存取 1,000,000 次(100萬)，我想這樣也足夠個人或者是公司使用了，除非真的比這個大量，可以跟 Google 再提出額外申請。&lt;/p&gt;
&lt;h3 id="系統需求"&gt;&lt;strong&gt;系統需求&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bitbucket.org/ellislab/codeigniter-reactor"&gt;CodeIgniter Reactor 版本&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;PHP 5.2 版本支援 Curl&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="下載檔案-我已經將檔案都放在"&gt;&lt;strong&gt;下載檔案&lt;/strong&gt; 我已經將檔案都放在&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/appleboy/"&gt;github&lt;/a&gt; 上面，為了保持程式最新版本，請大家到底下連結進行下載&lt;/p&gt;
&lt;h2 id="codeigniter-google-url-shortener-api"&gt;&lt;a href="https://github.com/appleboy/CodeIgniter-Google-URL-Shortener-API"&gt;CodeIgniter-Google-URL-Shortener-API&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="系統文件"&gt;&lt;strong&gt;系統文件&lt;/strong&gt;&lt;/h3&gt;
&lt;h5 id="安裝-此安裝檔案共有三個"&gt;安裝 此安裝檔案共有三個:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;application/config/google_url_api.php&lt;/li&gt;
&lt;li&gt;application/controllers/google_url.php&lt;/li&gt;
&lt;li&gt;application/libraries/Google_url_api.php 請將檔案放入到相對應的 application 目錄即可&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id="設定-打開"&gt;設定 打開&lt;/h5&gt;
&lt;p&gt;&lt;span style="color:green"&gt;application/config/google_url_api.php&lt;/span&gt; 檔案，將申請好的 API Key 填入即可&lt;/p&gt;
&lt;h5 id="第一次執行-請在網址列打入"&gt;第一次執行 請在網址列打入&lt;/h5&gt;
&lt;p&gt;&lt;span style="color:green"&gt;http://your_host/index.php/google_url/&lt;/span&gt; 即可，如果有任何問題，可以在 Controller 部份將 debug mode 打開&lt;/p&gt;
&lt;pre class="brush: php; title: ; notranslate" title=""&gt;$this-&gt;google_url_api-&gt;enable_debug(TRUE);&lt;/pre&gt;</description></item></channel></rss>