<?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 &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Check YouTube Video Existence with Zend_Gdata_YouTube</title>
		<link>/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/</link>
		<comments>/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/#respond</comments>
		<pubDate>Fri, 21 May 2010 07:43:57 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[e->]]></category>
		<category><![CDATA[Entertainment/Culture]]></category>
		<category><![CDATA[GData]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Hypertext Transfer Protocol]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web application frameworks]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[YouTube]]></category>
		<category><![CDATA[YouTube Inc]]></category>

		<guid isPermaLink="false">/?p=1531</guid>
		<description><![CDATA[The Video Has Been Removed?! Have you ever seen the famous message on YouTube: &#8220;This video has been removed by the user.&#8221;, but what if you&#8217;re trying to grab that video via the Zend_Gdata_YouTube? That can happen when you&#8217;re reading the feed for a channel or a user&#8217;s list of videos. In the feed everything&#8217;s &#8230; <a href="/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/" class="more-link">Continue reading <span class="screen-reader-text">Check YouTube Video Existence with Zend_Gdata_YouTube</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/16/retrieving-youtube-channels-videos-with-zend_gdata_youtube/" rel="bookmark" title="Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube">Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/" rel="bookmark" title="Iterate over YouTube Channel with Zend_Gdata_YouTube">Iterate over YouTube Channel with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/01/23/youtube-and-vimeo-goes-html5-with-video-tag-usage-catch-them-up/" rel="bookmark" title="YouTube and Vimeo goes HTML5 with video tag usage! Catch them up!">YouTube and Vimeo goes HTML5 with video tag usage! Catch them up! </a></li>
<li><a href="/2011/04/07/use-fopen-to-check-file-availability/" rel="bookmark" title="Use fopen() to Check File Availability?">Use fopen() to Check File Availability? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>The Video Has Been Removed?!</h2>
<p>Have you ever seen the famous message on <a href="http://youtube.com/">YouTube</a>: &#8220;This video has been removed by the user.&#8221;, but what if you&#8217;re trying to grab that video via the <a href="http://framework.zend.com/manual/en/zend.gdata.youtube.html" target="_blank">Zend_Gdata_YouTube</a>?</p>
<p>That can happen when you&#8217;re reading the feed for a channel or a user&#8217;s list of videos. In the feed everything&#8217;s OK &#8211; once the video is uploaded it appears into the feed. After that the user removes the video and visiting the link from the feed you&#8217;ll get the message above.</p>
<p>Actually what happens when you try to read this &#8220;video entry&#8221; within a Zend Framework&#8217;s application. There must be some way to catch this message?</p>
<h2>Trying to Catch</h2>
<p>The answer is pretty simple! Zend_Gdata_YouTube&#8217;s throwing an exception and it can be easily cached. Here&#8217;s some source code:</p>
<pre lang="php">
$apiKey = 'your_api_key';
$client = new Zend_Http_Client();
$gdata = new Zend_Gdata_YouTube($client, 'my-app', null, $apiKey);
try {
       $gdata->getVideoEntry($video_id);
} catch(Zend_Gdata_App_Exception $e) {
       echo $e->getMessage();
}
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/16/retrieving-youtube-channels-videos-with-zend_gdata_youtube/" rel="bookmark" title="Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube">Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/" rel="bookmark" title="Iterate over YouTube Channel with Zend_Gdata_YouTube">Iterate over YouTube Channel with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/01/23/youtube-and-vimeo-goes-html5-with-video-tag-usage-catch-them-up/" rel="bookmark" title="YouTube and Vimeo goes HTML5 with video tag usage! Catch them up!">YouTube and Vimeo goes HTML5 with video tag usage! Catch them up! </a></li>
<li><a href="/2011/04/07/use-fopen-to-check-file-availability/" rel="bookmark" title="Use fopen() to Check File Availability?">Use fopen() to Check File Availability? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iterate over YouTube Channel with Zend_Gdata_YouTube</title>
		<link>/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/</link>
		<comments>/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 14:07:56 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Atom]]></category>
		<category><![CDATA[Atom publishing protocol]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[GData]]></category>
		<category><![CDATA[Gdata services]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web application frameworks]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[YouTube Inc]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">/?p=1465</guid>
		<description><![CDATA[Read YouTube&#8217;s Feed in Zend App The task is to read the entire Gdata from a YouTube&#8217;s channel. It may sound easy, but as you may know Gdata is based on the Atom publishing protocol, and it naturally gives you only the latest few items. Of course Zend Framework has a large set of classes &#8230; <a href="/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/" class="more-link">Continue reading <span class="screen-reader-text">Iterate over YouTube Channel with Zend_Gdata_YouTube</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/03/16/retrieving-youtube-channels-videos-with-zend_gdata_youtube/" rel="bookmark" title="Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube">Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/" rel="bookmark" title="Check YouTube Video Existence with Zend_Gdata_YouTube">Check YouTube Video Existence with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/03/15/force-zend-casting-and-help-the-ide-autocompletion/" rel="bookmark" title="Force Zend Casting and Help the IDE Autocompletion">Force Zend Casting and Help the IDE Autocompletion </a></li>
<li><a href="/2010/04/26/mysql-expressions-in-zend-framework/" rel="bookmark" title="MySQL Expressions in Zend Framework">MySQL Expressions in Zend Framework </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Read YouTube&#8217;s Feed in Zend App</h2>
<p>The task is to read the entire <a title="Gdata" href="http://code.google.com/apis/gdata/" target="_blank">Gdata</a> from a YouTube&#8217;s channel. It may sound easy, but as you may know Gdata is based on the Atom publishing protocol, and it naturally gives you only the latest few items.</p>
<p>Of course <a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a> has a large set of classes dealing with Google&#8217;s Gdata services, one of them is the <a href="http://framework.zend.com/manual/en/zend.gdata.youtube.html" target="_blank">Zend_Gdata_YouTube</a>.</p>
<p>It gives you the power to iterate/paginate over the entire set of YouTube user&#8217;s/channel&#8217;s videos. In that example let&#8217;s assume you have a protected function doing the reading of a single portion:</p>
<pre lang="php" escaped="true">
protected function _process(Zend_Gdata_YouTube_VideoFeed $videoFeed)
{

    /* @var $entry Zend_Gdata_YouTube_VideoEntry */
    foreach ($videoFeed as $entry) {
        /* @var $published Zend_Gdata_App_Extension_Published */
        $published = $entry-&gt;getPublished();
        $thumbnails = $entry-&gt;getVideoThumbnails();

        // set date format
        $date = new Zend_Date($published-&gt;getText());

        // array
        $tags = $entry-&gt;getVideoTags();

        $data['title'] = $entry-&gt;getVideoTitle();
        $data['description'] = $entry-&gt;getVideoDescription();
        $data['date'] = $date-&gt;get('Y-MM-d hh:mm:ss');
        $data['thumb'] = @$thumbnails[3]['url'];
        $data['id'] = $entry-&gt;getVideoId();
        $data['flash_player'] = $entry-&gt;getFlashPlayerUrl();
        $data['tags'] = implode(',', $tags) . ', ' . $entry-&gt;getVideoCategory();
        // do whatever you want with the data
    }

}
</pre>
<p>The only thing left is to iterate over the &#8220;pages&#8221; of the feed. This can be done with getNextFeed() method.</p>
<pre lang="php" escaped="true">
public function readRssAction()
{
    $userId = 'some_user';
    $client = new Zend_Http_Client();
    $gdata = new Zend_Gdata_YouTube($client, 'my-app', null, $this-&gt;_apiKey);
    $videoFeed = $gdata-&gt;getUserUploads($userId);

    // save the last items
    $this-&gt;_process($videoFeed);

    try {
        while ($videoFeed = $videoFeed-&gt;getNextFeed()) {
            $this-&gt;_process($videoFeed);
        }
    } catch (Zend_Gdata_App_Exception $e) {
        echo $e-&gt;getMessage();
    }
}
</pre>
<p>You&#8217;ll get an exception when there is no more feeds to process!</p>
<p>To combine all this into a single controller and to complete the code here&#8217;s the entire source:</p>
<pre lang="php" escaped="true">
class YoutubeController extends Zend_Controller_Action
{
    protected $_apiKey = 'your_api_key_goes_here';

    protected function _process(Zend_Gdata_YouTube_VideoFeed $videoFeed)
    {

        /* @var $entry Zend_Gdata_YouTube_VideoEntry */
        foreach ($videoFeed as $entry) {
            /* @var $published Zend_Gdata_App_Extension_Published */
            $published = $entry-&gt;getPublished();
            $thumbnails = $entry-&gt;getVideoThumbnails();

            // set date format
            $date = new Zend_Date($published-&gt;getText());

            // array
            $tags = $entry-&gt;getVideoTags();

            $data['title'] = $entry-&gt;getVideoTitle();
            $data['description'] = $entry-&gt;getVideoDescription();
            $data['date'] = $date-&gt;get('Y-MM-d hh:mm:ss');
            $data['thumb'] = @$thumbnails[3]['url'];
            $data['id'] = $entry-&gt;getVideoId();
            $data['flash_player'] = $entry-&gt;getFlashPlayerUrl();
            $data['tags'] = implode(',', $tags) . ', ' . $entry-&gt;getVideoCategory();
            // do whatever you want with the data
        }
    }

    public function readRssAction()
    {
        $userId = 'some_user';
        $client = new Zend_Http_Client();
        $gdata = new Zend_Gdata_YouTube($client, 'my-app', null, $this-&gt;_apiKey);
        $videoFeed = $gdata-&gt;getUserUploads($userId);

        // save the last items
        $this-&gt;_process($videoFeed);

        try {
            while ($videoFeed = $videoFeed-&gt;getNextFeed()) {
                $this-&gt;_process($videoFeed);
            }
        } catch (Zend_Gdata_App_Exception $e) {
            echo $e-&gt;getMessage();
        }
    }
}
</pre>
<p><em><strong>Note:</strong> here you&#8217;ve to substitute the API key with the one you&#8217;ve for your development. </em></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/03/16/retrieving-youtube-channels-videos-with-zend_gdata_youtube/" rel="bookmark" title="Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube">Retrieving YouTube Channel&#8217;s Videos with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/05/21/check-youtube-video-existence-with-zend_gdata_youtube/" rel="bookmark" title="Check YouTube Video Existence with Zend_Gdata_YouTube">Check YouTube Video Existence with Zend_Gdata_YouTube </a></li>
<li><a href="/2010/03/15/force-zend-casting-and-help-the-ide-autocompletion/" rel="bookmark" title="Force Zend Casting and Help the IDE Autocompletion">Force Zend Casting and Help the IDE Autocompletion </a></li>
<li><a href="/2010/04/26/mysql-expressions-in-zend-framework/" rel="bookmark" title="MySQL Expressions in Zend Framework">MySQL Expressions in Zend Framework </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/04/22/iterate-over-youtube-channel-with-zend_gdata_youtube/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend_Openid and Google Accounts. Patch needed.</title>
		<link>/2009/12/04/zend_openid-and-google-accounts-patch-needed/</link>
		<comments>/2009/12/04/zend_openid-and-google-accounts-patch-needed/#respond</comments>
		<pubDate>Fri, 04 Dec 2009 07:39:12 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[zend framework]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google accounts]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[zend_openid]]></category>

		<guid isPermaLink="false">/?p=826</guid>
		<description><![CDATA[Zend_Openid This extension as expected gives the Zend Framework the possibility to implement OpenId protocol. The problem is that the current version 1.9.6 does not work correctly with Google accounts. The solution can be found on one of the best resource sites &#8211; stackoverflow. You can simply follow the two comments to this post with &#8230; <a href="/2009/12/04/zend_openid-and-google-accounts-patch-needed/" class="more-link">Continue reading <span class="screen-reader-text">Zend_Openid and Google Accounts. Patch needed.</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-blocks-the-page-load/" rel="bookmark" title="Google Adsense blocks the page load">Google Adsense blocks the page load </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Zend_Openid</h2>
<p>This extension as expected gives the <a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a> the possibility to implement <a title="OpenId" href="http://openid.net/" target="_blank">OpenId</a> protocol. The problem is that the current version 1.9.6 does not work correctly with Google accounts.</p>
<h2>The solution</h2>
<p>can be found on one of the best resource sites &#8211; <a title="Zend OpenId and Google on stackoverflow" href="http://stackoverflow.com/questions/741345/how-do-i-implement-direct-identity-based-openid-authentication-with-zend-openid" target="_blank">stackoverflow</a>. You can simply follow the two comments to this post with no fear that this will work. It&#8217;s tested already.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-blocks-the-page-load/" rel="bookmark" title="Google Adsense blocks the page load">Google Adsense blocks the page load </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/12/04/zend_openid-and-google-accounts-patch-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Adsense blocks the page load</title>
		<link>/2009/06/10/google-adsense-blocks-the-page-load/</link>
		<comments>/2009/06/10/google-adsense-blocks-the-page-load/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 05:24:42 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">/?p=593</guid>
		<description><![CDATA[The Google Adsense code block Everyone dealing with Google Adsense knows how it looks like as JavaScript code. When you register, apply and receive the code chunk, you receive actually an inline chunk of js describing the width and height of the code and the key, uniquely identifying the page ad and an included javascript &#8230; <a href="/2009/06/10/google-adsense-blocks-the-page-load/" class="more-link">Continue reading <span class="screen-reader-text">Google Adsense blocks the page load</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-iframes-and-ie/" rel="bookmark" title="Google Adsense, iframes and IE">Google Adsense, iframes and IE </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
<li><a href="/2009/04/14/load-flash-swf-in-hidden-div/" rel="bookmark" title="load flash .swf in hidden div">load flash .swf in hidden div </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>The Google Adsense code block</h2>
<p>Everyone dealing with Google Adsense knows how it looks like as JavaScript code. When you register, apply and receive the code chunk, you receive actually an inline chunk of js describing the width and height of the code and the key, uniquely identifying the page ad and an included javascript file.</p>
<blockquote>
<pre id="line1">&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;&lt;!--
google_ad_client = "pub-9858850710257888";
/* 250x250, google ad 09-5-19 */
google_ad_slot = "0062396170";
google_ad_width = 250;
google_ad_height = 250;
//--&gt;
&lt;/<span class="end-tag">script</span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"
</span><span class="attribute-name">src</span>=<span class="attribute-value">"http://pagead2.googlesyndication.co/..."</span>&gt;
&lt;/<span class="end-tag">script</span>&gt;</pre>
</blockquote>
<h2>Inline scripts and their behavior</h2>
<p>The problem with the page load is that inline scripts included somewhere in the page, the case with adsense is just like that, blocks every page load until the script is executed. Of course when you&#8217;ve two or three ads somewhere in your page that causes huge delay of page load. Sometimes that may delay the page twice as much as if there were no ads from Google.</p>
<h2>The workaround</h2>
<p>The simple workaround is to place your ads &lt;script&gt; inline, included or both in a separate .html file and to include it as &lt;iframe&gt;. Such a solution gives the page the ability of render before the iframe is executed and the page load event is fired in an early stage.</p>
<blockquote><p>&lt;iframe src=&#8221;/path_to_the_banner.html&#8221;&gt;&lt;/iframe&gt;</p></blockquote>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/06/10/google-adsense-iframes-and-ie/" rel="bookmark" title="Google Adsense, iframes and IE">Google Adsense, iframes and IE </a></li>
<li><a href="/2009/07/24/javascript-detect-browser-speed-and-load-the-slow-connection-site/" rel="bookmark" title="javascript: detect browser speed and load the &#8220;slow connection&#8221; site version">javascript: detect browser speed and load the &#8220;slow connection&#8221; site version </a></li>
<li><a href="/2010/06/24/zend-framework-inject-javascript-code-in-a-actionview/" rel="bookmark" title="Zend Framework: Inject JavaScript Code in a Action/View">Zend Framework: Inject JavaScript Code in a Action/View </a></li>
<li><a href="/2009/04/14/load-flash-swf-in-hidden-div/" rel="bookmark" title="load flash .swf in hidden div">load flash .swf in hidden div </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2009/06/10/google-adsense-blocks-the-page-load/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
