<?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, 12 Jul 2011 11:53:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<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>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[programming]]></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>
]]></content:encoded>
			<wfw:commentRss>http://phpcollection.com/twitter-bot/feed/</wfw:commentRss>
		<slash:comments>15</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>19</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>
	</channel>
</rss>

