<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>google shorten - WP2X</title> <atom:link href="https://wp2x.com/tag/google-shorten/feed/" rel="self" type="application/rss+xml" /><link>https://wp2x.com</link> <description>We can help your Wordpress faster</description> <lastBuildDate>Mon, 01 Dec 2014 22:14:54 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod> hourly </sy:updatePeriod> <sy:updateFrequency> 1 </sy:updateFrequency> <generator>https://wordpress.org/?v=5.6.16</generator> <item><title>How to Sign Up Goo.gl API Key</title><link>https://wp2x.com/sign-goo-gl-api-key/</link> <comments>https://wp2x.com/sign-goo-gl-api-key/#comments</comments> <dc:creator><![CDATA[david]]></dc:creator> <pubDate>Fri, 02 May 2014 00:56:09 +0000</pubDate> <category><![CDATA[Wordpress Tips]]></category> <category><![CDATA[goo.gl api]]></category> <category><![CDATA[goo.gl key]]></category> <category><![CDATA[google shorten]]></category> <category><![CDATA[shorten api key]]></category> <guid
isPermaLink="false">http://wp2x.com/?p=190</guid><description><![CDATA[<p>Google Shorten App is very useful for any WordPress site to make short URL. If you want to send to anyone a URL, it &#8216;s too bad to see the URL is too long. You know, the long URL is only take their time look entire of URL and it have no meaning with them.  ...</p><p>The post <a
rel="nofollow" href="https://wp2x.com/sign-goo-gl-api-key/">How to Sign Up Goo.gl API Key</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Google Shorten App is very useful for any WordPress site to make short URL. If you want to send to anyone a URL, it &#8216;s too bad to see the URL is too long. You know, the long URL is only take their time look entire of URL and it have no meaning with them. <span
id="more-190"></span></p><p>I am sorry if I go too far from the main problem, our problem is we are using an plugin/extension/theme what need you provide a Google Shorten API Key or Goo.gl API Key, now I show you how to get it easy.</p><p>First of all, let &#8216;s login to your Google Account, if you don&#8217;t have one, please sign up the new one (I think it &#8216;s more than easy so that I will not tell you how to create Google account here).</p><p>Visit <a
href="http://code.google.com/apis/console/" target="_blank">http://code.google.com/apis/console/</a> and browse to the left menu <strong>APIs &amp; Auth =&gt; APIS</strong></p><p>Now search and turn on <strong>URL Shortener API</strong></p><p>&nbsp;</p><p><a
href="http://code.google.com/apis/console/" target="_blank"><img
loading="lazy" class="aligncenter size-full wp-image-191" src="http://wp2x.com/wp-content/uploads/2014/05/turn-on-shorten-URL.png?4b2a2c&amp;4b2a2c" alt="Turn on shorten URL" width="676" height="164" srcset="https://wp2x.com/wp-content/uploads/2014/05/turn-on-shorten-URL.png 676w, https://wp2x.com/wp-content/uploads/2014/05/turn-on-shorten-URL-300x72.png 300w" sizes="(max-width: 676px) 100vw, 676px" /></a></p><p>&nbsp;</p><p>Now browse to menu <strong>APIs &amp; Auth =&gt; Credentials </strong>and click <strong>CREATE NEW KEY</strong> under <strong>Public API Access. </strong>In lightbox confirm choose <strong>Server key</strong> and you will see the box to enter your server IP as below:</p><p><a
href="http://wp2x.com/wp-content/uploads/2014/05/Generate-Shorten-API-Key.png?4b2a2c&amp;4b2a2c"><img
loading="lazy" class="aligncenter size-full wp-image-192" src="http://wp2x.com/wp-content/uploads/2014/05/Generate-Shorten-API-Key.png?4b2a2c&amp;4b2a2c" alt="Generate Shorten API Key" width="700" height="386" srcset="https://wp2x.com/wp-content/uploads/2014/05/Generate-Shorten-API-Key.png 700w, https://wp2x.com/wp-content/uploads/2014/05/Generate-Shorten-API-Key-300x165.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></a></p><p>After click <strong>Create</strong> then you will see the API Key you need. It will look like this</p><p><a
href="http://wp2x.com/wp-content/uploads/2014/05/Shorten-API-Key.png?4b2a2c&amp;4b2a2c"><img
loading="lazy" class="aligncenter size-full wp-image-193" src="http://wp2x.com/wp-content/uploads/2014/05/Shorten-API-Key.png?4b2a2c&amp;4b2a2c" alt="Shorten API Key" width="560" height="220" srcset="https://wp2x.com/wp-content/uploads/2014/05/Shorten-API-Key.png 560w, https://wp2x.com/wp-content/uploads/2014/05/Shorten-API-Key-300x117.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></a></p><p>&nbsp;</p><h2>Try to call Goo.gl API in PHP</h2><p>Here is simple function in PHP to convert a long URL to shorten URL</p><pre class="lang:php decode:true ">function getgoogl($longUrl){

//This is the URL you want to shorten
$apiKey = 'AIzaSyDMgK9gpIIokl7ClMqMXHZQ7wv_xzRwMHs';
//Get API key from : http://code.google.com/apis/console/

$postData = array('longUrl' =&gt; $longUrl, 'key' =&gt; $apiKey);
$jsonData = json_encode($postData);

$curlObj = curl_init();

curl_setopt($curlObj, CURLOPT_URL, 'https://www.googleapis.com/urlshortener/v1/url?key='.$apiKey);
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curlObj, CURLOPT_HEADER, 0);
curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json'));
curl_setopt($curlObj, CURLOPT_POST, 1);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $jsonData);

$response = curl_exec($curlObj);

//change the response json string to object
$json = json_decode($response);

curl_close($curlObj);

return $json-&gt;id;

}</pre><p>btw, I am very happy to receive reviews from many users about goo.gl api and welcome any comments.</p><div
class="ratings">43 Review(s)<br
/> <span
class="product__rating-numbers"><br
/> 4.8 / 5<br
/> </span></div><p>The post <a
rel="nofollow" href="https://wp2x.com/sign-goo-gl-api-key/">How to Sign Up Goo.gl API Key</a> appeared first on <a
rel="nofollow" href="https://wp2x.com">WP2X</a>.</p> ]]></content:encoded> <wfw:commentRss>https://wp2x.com/sign-goo-gl-api-key/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>