<?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>PHP Tutorials &#187; API</title>
	<atom:link href="http://phpcollection.com/category/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpcollection.com</link>
	<description>PHP Tutorials collection</description>
	<lastBuildDate>Tue, 01 May 2012 12:39:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Codeigniter Linkedin library</title>
		<link>http://phpcollection.com/php-linkedin-library/</link>
		<comments>http://phpcollection.com/php-linkedin-library/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 17:18:59 +0000</pubDate>
		<dc:creator>Learn PHP</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Codeigniter]]></category>

		<guid isPermaLink="false">http://phpcollection.com/?p=809</guid>
		<description><![CDATA[Linkedin is a much ignored API with a lot of potential. I was always looking for a good implementation of Codeigniter Linkedin library but never found one, with the help of Linkedin PHP library (Please someone point out to correct source). I have created a basic implementation of Linkedin library on Linkedin, documentation and more [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Linkedin is a much ignored API with a lot of potential. I was always looking for a good implementation of Codeigniter Linkedin library but never found one, with the help of Linkedin PHP library (Please someone point out to correct source). I have created a basic implementation of Linkedin library on Linkedin, documentation and more functions are in roadmap. Do check out at <a href="https://github.com/gauravtechie/Codeigniter-linkedin">https://github.com/gauravtechie/Codeigniter-linkedin</a> .   </p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/php-linkedin-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pinterest API</title>
		<link>http://phpcollection.com/pinterest-api-php/</link>
		<comments>http://phpcollection.com/pinterest-api-php/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 09:22:24 +0000</pubDate>
		<dc:creator>Learn PHP</dc:creator>
				<category><![CDATA[API]]></category>

		<guid isPermaLink="false">http://phpcollection.com/?p=836</guid>
		<description><![CDATA[Everyone&#8217;s waiting to see a launch of Pinterest API. Pinterest had a working API which they took down for some unclaimed reasons. Some users have managed to take a cached version of Pinterest API docs online and can be found at http://tijn.bo.lt/pinterest-api . You are not able to use the oAuth calls from these API [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Everyone&#8217;s waiting to see a launch of Pinterest API. Pinterest had a working API which they took down for some unclaimed reasons. Some users have managed to take a cached version of Pinterest API docs online and can be found at <a href="http://tijn.bo.lt/pinterest-api">http://tijn.bo.lt/pinterest-api</a> . </p>
<p>You are not able to use the oAuth calls from these API docs, but you can successfully read data via these API docs, even for that you need to send correct headers to emulate calls such that they are coming from Pinterest iPhone app.</p>
<p>Correct headers are:-</p>
<p><code><br />
Host: api.pinterest.com<br />
User-Agent: Pinterest For iPhone / 1.4.3<br />
Accept-Encoding: gzip<br />
Connection: keep-alive<br />
Proxy-Connection:...<br />
</code></p>
<p>There are news going around that Pinterest is scared of having a problem like twitter, where spammers used API very intelligently to bombard twitter with a lot of crap data. Twitter still having a hard time to tackle these spam accounts big time <a href="http://articles.businessinsider.com/2012-03-26/tech/31238519_1_mobile-apps-twitterrific-hootsuite">http://articles.businessinsider.com/2012-03-26/tech/31238519_1_mobile-apps-twitterrific-hootsuite</a> . We hope that these fears don&#8217;t put Pinterest people off track of developing a full fledged API.</p>
<p>Want more of updated development. Join Pinterest unofficial API developer Group here on facebook <a href="https://www.facebook.com/groups/pinterestapi/">https://www.facebook.com/groups/pinterestapi/</a></p>
<p>Update:<br />
One implementation of Pinterest API at Github. Still to test it though by me. <a href="https://github.com/kellan/pinterest.api.php">https://github.com/kellan/pinterest.api.php</a> </p>
<p>&#038;nbsp</p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/pinterest-api-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Plus Circles</title>
		<link>http://phpcollection.com/google-circle/</link>
		<comments>http://phpcollection.com/google-circle/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 16:10:22 +0000</pubDate>
		<dc:creator>Learn PHP</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google Circles]]></category>
		<category><![CDATA[Google Circles API]]></category>

		<guid isPermaLink="false">http://phpcollection.com/?p=781</guid>
		<description><![CDATA[Update:- Google launched the google circle social network as Google plus. API is still awaited. Updates will be coming as the API gets launched. Google is launching there new social networking service &#8220;Google Circles&#8221;, this is rumored to offer photo sharing, video sharing and updates. Which can be tightly linked to other social networks and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Update:- Google launched the google circle social network as Google plus. API is still awaited. Updates will be coming as the API gets launched.</p>
<p>Google is launching there new social networking service &#8220;Google Circles&#8221;, this is rumored to offer photo sharing, video sharing and updates. Which can be tightly linked to other social networks and circles. This news was broken by Read Write web today from #sxsw.</p>
<p>We wonder where buzz will fit into this and since this will be google product we are very excited to see what API details it will offer. We promise our readers to update with every bit of details, when there API announcement comes out.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/google-circle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Youtube PHP class</title>
		<link>http://phpcollection.com/youtube-php/</link>
		<comments>http://phpcollection.com/youtube-php/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 13:22:06 +0000</pubDate>
		<dc:creator>Learn PHP</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://phpcollection.com/?p=778</guid>
		<description><![CDATA[Youtube is a great API for finding relevant videos. Vimeo may had great community, but no one can challenge huge amount of videos and buzz youtube community generates. For fetching youtube video,i have put down a very basic PHp class. It would help users to fetch videos via query or categories. Complete code can be [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Youtube is a great API for finding relevant videos. Vimeo may had great community, but no one can challenge huge amount of videos and buzz youtube community generates.</p>
<p>For fetching youtube video,i have put down a very basic PHp class. It would help users to fetch videos via query or categories.</p>
<p>Complete code can be found at <a href="https://github.com/gauravtechie/youtube-api-php">https://github.com/gauravtechie/youtube-api-php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/youtube-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter bot tutorial</title>
		<link>http://phpcollection.com/twitter-bot/</link>
		<comments>http://phpcollection.com/twitter-bot/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:37:16 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Bot]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=550</guid>
		<description><![CDATA[Twitter is heavily becoming a source of traffic and with there extremely powerful api , it&#8217;s very easy to automate stuff via Twitter bots. Today i am going to show you a tutorial for very simple but yet very powerful bot which if used effectively can drive great traffic on sites. These bots simply search [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Twitter is heavily becoming a source of traffic and with there extremely powerful api , it&#8217;s very easy to automate stuff via Twitter bots.</p>
<p>Today i am going to show you a tutorial for very simple but yet very powerful bot which if used effectively can drive great traffic on sites. These bots simply search twitter stream for predefined keywords and tweet target messages to the tweeters. These bots can be set via cron to read stream every few minutes and make responses in real time.</p>
<p>For newbies and starters all Twitter API documentation can be found <a href="http://apiwiki.twitter.com/Twitter-API-Documentation">here</a> , From here we are going to use Search API methods and Status Update REST api method for sending predefined tweets to the users.<br />
<span id="more-550"></span><br />
Search API can give output both in JSON and ATOM(XML) format , And can take several parameters for searching twitter stream. We are going to use just the query(q) parameter to provide keyword to the search ,A complete parameter list can be found <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search">here </a> .</p>
<p>So , Let&#8217;s take the parameter query as PHP problem and send them our link of phpcollection.com in the tweet. For this we will first search the twitter stream for the keyword PHP problem</p>
<pre class="php">
< ?php
$url = "http://search.twitter.com/search.atom?q=urlencode(PHP+problem)";
</pre>
<p>The response of this query is in a XML format so we will use simplexml PHP extension for converting this XML data in native PHP object. simplexml_load_file function loads and converts xml data directly from the url. It can be easily then traversed via a Php object.</p>
</pre>
<pre class="php">
$data = simplexml_load_file($url);
</pre>
<p>Now the data can be traversed via a foreach loop , $data->entry contains a array of all tweet entries. We will take them one by one in $value. Tweet username can be accessed via $value->author->uri to whom we will be tweeting the predefined message.</p>
<pre class="php">
foreach ($data->entry as $value)
{
	$from_name = $value->author->uri;
	$from_name = str_replace ("http://twitter.com/", "", $from_name);
    	$message = "@$from_name Hey Buddy you can find solution to your problems at http://www.phpcollection.com #php";
</pre>
<p>Now we have the users who are looking for help in PHP language (via PHP problem keyword), Now using Twitter PHP wrapper we will tweet this message to the users. This can be easily achieved via CURL, However for the sake of the tutorial we will use <a href="http://www.phpcollection.com/classes/mytwitter.php.zip">mytwitter php class</a> for tweeting back to users.</p>
<pre class="php">
		require_once( 'mytwitter.php' );
		$twitter =  new MyTwitter('phpcollection', '**********');
 		$result = $twitter->updateStatus($message);
}
?>
</pre>
<p>Complete code can be <a href="http://www.phpcollection.com/classes/twitter_bot.php.zip">downloaded here</a></p>
<p><b>Update</b>: We are also now on github, you can download files directly from <a href="https://github.com/gauravtechie/twitter-php-bot">https://github.com/gauravtechie/twitter-php-bot</a></p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/twitter-bot/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Open Dada PHP Class &#8211; Ringtone Affiliate API</title>
		<link>http://phpcollection.com/open-dada-php-class-ringtone-affiliate-api/</link>
		<comments>http://phpcollection.com/open-dada-php-class-ringtone-affiliate-api/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 05:31:50 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=726</guid>
		<description><![CDATA[Recently i needed to make a ringtone download website for a friend and we researched on web for a good affiliate with a decent API to make things easier for content download and integration on website. We ended choosing OpenDada.com which is a affiliate website for dada.net , Dada.net is a premier provider for providing [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Recently i needed to make a ringtone download website for a friend and we researched on web for a good affiliate with a decent API to make things easier for content download and integration on website.</p>
<p>We ended choosing OpenDada.com which is a affiliate website for dada.net , Dada.net is a premier provider for providing ringtones and other mobile content.</p>
<p>The API documentation for OpenDada can be found at <a href="http://www.opendada.com/docs/Search_API">API docs page</a> .</p>
<p>There are four methods that are defined in the class, Namely they are:-</p>
<p><span style="color: #0000bb;">search_ringtone</span><span style="color: #004000;">(&#8220;ARTIST NAME&#8221;</span><span style="color: #004000;">);</span></p>
<p><span style="color: #0000bb;">top10</span><span style="color: #004000;">();</span></p>
<p><span style="color: #0000bb;">display_single_ringtone</span><span style="color: #004000;">(</span><span style="color: #c00000;">&#8220;ARTIST NAME&#8221;</span><span style="color: #004000;">, </span><span style="color: #c00000;">&#8220;SONG TITLE&#8221;</span><span style="color: #004000;">);</span></p>
<p><span style="color: #0000bb;">get_genre</span><span style="color: #004000;">(</span><span style="color: #c00000;">&#8220;GENRE&#8221;</span><span style="color: #004000;">); </span></p>
<p>All methods are explained in the example.php file and can be found  <a href="http://www.phpclasses.org/browse/package/5636.html">here</a>.</p>
<p>Todo List:-</p>
<p>1) Add functionality to get more than 10 ringtones.<br />
2)<span style="text-decoration: line-through;"> Put the class in phpclasses.org </span><br />
3) Add option of inserting partner id</p>
<p>Will update the class with more functionality sooner.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/open-dada-php-class-ringtone-affiliate-api/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a cache file in php for API requests</title>
		<link>http://phpcollection.com/creating-a-cache-file-in-php-for-api-requests/</link>
		<comments>http://phpcollection.com/creating-a-cache-file-in-php-for-api-requests/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 08:02:11 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php Performance]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[REST api]]></category>
		<category><![CDATA[Twitter API]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=702</guid>
		<description><![CDATA[Web 2.0 was all about mashups and data api’s !, Some of the popular ones are google search api , twitter api etc. All API’s have some rate-limiting , For example Twitter API has a rate limit of 150 requests per hour ! , Yahoo API and Google API’s have a daily limit on their [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Web 2.0 was all about mashups and data api’s !, Some of the popular ones are google search api , twitter api etc.</p>
<p>All API’s have some rate-limiting , For example Twitter API has a rate limit of 150 requests per hour ! , Yahoo API and Google API’s have a daily limit on their requests.</p>
<p>The ultimate method of getting over this API request limit is to make a cache method which stores all data that is coming from API , Which you can refresh hourly, weekly or daily !<br />
<span id="more-702"></span><br />
That&#8217;s why i created a small function to store the API data in a xml cache file , Which can be later on retrieved to get data.Find that function below, Most of the functionality is explained in the comments , If anything is not clear contact me via <a href="http://www.phpcollection.com/about">contact page</a>.</p>
<pre class="php">< ?php

function get_yahoo_data_cached($query, $zip) {
    // Rewrite by Julius Beckmann

    // Remove dangerous chars
    $query_safe = str_replace(array('.','/'), '_', $query);
    $zip_safe = str_replace(array('.','/'), '_', $zip);

    $cache_filename = "cache/$query_safe-$zip_safe.xml";
    $time_expire = time() + 24*60*60; // Expire Time (1 Day)

    // Check file change time
    if(filectime($filename) <= $time_expire) {
        // File is too old, refresh cache
        $xml = get_yahoo_data($query, $zip);
        // Remove cache file on error to avoid writing wrong xml
        if($xml)
            file_put_contents($cache_filename, $xml);
        else
            unlink($cache_filename);
    }else{
        // Fetch cache
        $xml = file_get_contents($cache_filename);
    }

    return $xml;
}

?>
</pre>
<p>Safe rewrite of the function by <a href="http://juliusbeckmann.de">Julius Beckmann</a>  <br />
This function creates a cache file for yahoo api requests , here we are using get_yahoo_data() function to fetch data from yahoo api which is a custom function for extracting data from yahoo api and throwing that in xml output format.</p>
<p>If we do a small synopsis of the above function we can see that it uses 2 variables to store cache , $filename stores the cache file and $file_log_name stores the last update time for that cache !</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:68b0a9b9-ef17-40a4-97de-308d796ee056" class="wlWriterEditableSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Cache">Cache</a>,<a rel="tag" href="http://technorati.com/tags/Twitter+API">Twitter API</a>,<a rel="tag" href="http://technorati.com/tags/REST+api">REST api</a></div>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/creating-a-cache-file-in-php-for-api-requests/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>5 upcoming Apis of Google that will change the way mashups are made</title>
		<link>http://phpcollection.com/5-apis-google-important-for-web2-mashup/</link>
		<comments>http://phpcollection.com/5-apis-google-important-for-web2-mashup/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 10:43:57 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=671</guid>
		<description><![CDATA[In my opinion one of the top most API&#8217;s used globaly on web portals is Google Search API, Google is famous for building world class API&#8217;s to harness the unique data Google collected with it&#8217;s excellent set of technology. Google Labs is the ultimate playground of Google which he use for developing and testing there [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>In my opinion one of the top most API&#8217;s used globaly on web portals is Google Search API, Google is famous for building world class API&#8217;s to harness the unique data Google collected with it&#8217;s excellent set of technology.</p>
<p><strong><a href="http://code.google.com/labs/">Google Labs</a></strong> is the ultimate playground of Google which he use for developing and testing there upcoming API&#8217;s , They have some exciting set of API&#8217;s currently in building. Which promise better web and can provide better value than Google Maps and Google Search API&#8217;s</p>
<p><span id="more-671"></span></p>
<p><strong><a href="http://code.google.com/apis/o3d/">Google O3D API</a></strong>:-</p>
<p>Virtual reality is the most discussed and researched technology few years back and it has proved it&#8217;s mark with the success of Second Life. O3D is natural extension to it and looks like it&#8217;s a extension to much hyped but failed technology VRML (Quotation needed)</p>
<p>Here&#8217;s a small example demo that is made using o3d Technology, Notice the amount of detail which goes in the demo video.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/uofWfXOzX-g&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/uofWfXOzX-g&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>It&#8217;s Technical documentation can be found <a href="http://code.google.com/apis/o3d/docs/devguideintro.html">here</a> , Also you can be a part of early developers league by joining this group <a href="http://http://code.google.com/apis/o3d/docs/groups.html">o3D developers group </a></p>
<p><a href="http://code.google.com/apis/wave"><strong>Google Wave API</strong></a>:-<br />
Google Wave is another big collabration tool that Google is coming with, Aspired to be the next logical invention of Email . Google Wave innovates the collabration market with their wonderful approach of centric objects.  <a href="http://wave.google.com/"><strong>Google Wave</strong></a> can be accessed via <a href="http://code.google.com/apis/wave/"><strong>Google wave APi</strong></a> which can be integrated with applications for collabrtation<strong></strong> . Google presented a keynote which presented some cool features of Google Wave</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/v_UyVmITiYQ&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Developers can check out some cool wave applications at <a href="http://wave-samples-gallery.appspot.com/"><strong>Wave Sample gallery</strong></a> and check out the technical documentation <a href="http://code.google.com/apis/wave/guide.html">here</a> , Unfortunately Google wave currently have only Client libraries for Python and Java , We look forward to the Php library from Google soon.</p>
<p><strong><a href="http://code.google.com/apis/gears/">Google Gears API</a></strong>:-</p>
<p>Google Gears and Adobe Air are two upcoming technologies that promise leveraging the power of desktop onto web , Google Gears API is a powerful tool for building web applications that can interact with the users desktops , Features like local caching, Storing user data locally and asynchronous threads are some powerful feature that can now be used on web apps.</p>
<p>Google Gears sample applications can be found <a href="http://code.google.com/apis/gears/sample.html">here</a> and Technical documentation can be found at <a href="http://code.google.com/apis/gears/design.html">this page</a></p>
<p><a href="http://code.google.com/apis/analytics/docs/gdata/gdataDeveloperGuide.html"><strong>Google Analytics API</strong></a>:- The most common tool that webmasters use is the analytics tool for their website and Google analytics is the ultimate data churning tool for any website, If used properly Analytics can dig down to the deepest point of the content and traffic coming on web app or portal.</p>
<p>Several mertrics system like Mint , Quantcast etc exist today and provides extensive data, But the google analytics api can prove to be a milestone in extracting and tracking the traffic details that can effect your ROI.</p>
<p>Google analytics documentation can be located <a href="http://code.google.com/apis/analytics/docs/gdata/gdataDeveloperGuide.html"><strong>here</strong></a></p>
<p><a href=" http://code.google.com/apis/coupons/"><strong>Google Coupons:-</strong></a> Two words that bring maximum ROI in any form of business are <strong>FREE and SALE </strong>.</p>
<p>Coupons are one of the most searched terms on the web, Providing ecommerce users good discount on items, What could be better than the coupons data from the leader in data collection itself !, The coupons API !</p>
<p>Coupons API provide easy import to coupons data which can be used by business users, This is pretty same as the legendy google base tool which allow webmasters and business people to upload information about their product listing.</p>
<p>Coupons uploaded through coupon API will be indexed on google and will be presented to all users on searching for that product or relevant keywords.</p>
<p>It&#8217;s documentation can be found at <a href="http://code.google.com/apis/coupons/">this site</a></p>
<p>Hope you guys liked this list of API&#8217;s , Will love to listen your comments and any another set of API&#8217;s i missed.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/5-apis-google-important-for-web2-mashup/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>City , Country and zipcode lookup via Ip address in PHP</title>
		<link>http://phpcollection.com/city-country-and-zipcode-lookup-via-ip-address-in-php/</link>
		<comments>http://phpcollection.com/city-country-and-zipcode-lookup-via-ip-address-in-php/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 10:41:33 +0000</pubDate>
		<dc:creator>Php Ninza</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phpcollection.com/?p=605</guid>
		<description><![CDATA[A lot of times i have seen newbies and even PHP pros struggling to find any method of implementing zipcode and country lookup ! This can be easily achieved with the help of Maxmind Geo API, They provide a exhaustive DB lookup functionality of IP adress . Which can be further translated into City, Country [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>A lot of times i have seen newbies and even PHP pros struggling to find any method of implementing zipcode and country lookup !</p>
<p>This can be easily achieved with the help of <a href="http://www.maxmind.com/app/ip-location">Maxmind Geo API</a>, They provide a exhaustive DB lookup functionality of IP adress . Which can be further translated into City, Country and Zipcode information ! . This API prove to be very useful in the web apps which require providing user specific content to the users.<br />
<span id="more-605"></span><br />
For the usage you simply need to download the<a href="http://www.maxmind.com/app/geolitecity"> GeoLiteCity database </a>(Updated monthly) from this link.Also <a href="http://geolite.maxmind.com/download/geoip/api/php/">download </a>three more files namely geoipcity.inc and geoipregionvars.php and put all three files in a folder name inc.  Change PATH TO YOUR ROOT PUBLIC_HTML FOLDER to your server public_html path.</p>
<p>Once all files are in place , Simply use the code given below to fetch the city, country , zipcode , langitude and longitude information from the GeoLiteCity database.</p>
<pre class="brush: php; title: ; notranslate">

include(&quot;inc/geoipcity.inc&quot;);
include(&quot;inc/geoipregionvars.php&quot;);
$IP = $_SERVER['REMOTE_ADDR'];
$gi = geoip_open(&quot;PATH TO YOUR ROOT PUBLIC_HTML FOLDER/inc/GeoLiteCity.dat&quot;,GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$IP);
$city =  $record-&gt;city;
$country = $record-&gt;country_name;
$latitude = $record-&gt;latitude;
$longitude = $record-&gt;longitude;
geoip_close($gi);
</pre>
<p>The function geoip_open() opens the database for reading and geoip_record_by_addr() uses the database and the ip to generate the record .</p>
<p>All information is embed into the variable $record in above given example. Which can be fetched namely via</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
print_r ($record);
?&gt;
</pre>
<p>All variable name are self-explanatory to include the desired data !</p>
<p>Let us know if you encounter any issues in deploying this tutorial</p>
<p>Alternatively if you are making a google mashup, Try out this excellent book that i used for my mashups</p>
<p><iframe src="http://rcm.amazon.com/e/cm?t=phpcoll-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=1430216204&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/city-country-and-zipcode-lookup-via-ip-address-in-php/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

