当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata_YouTube_VideoEntry::getVideoViewCount方法代码示例

本文整理汇总了PHP中Zend_Gdata_YouTube_VideoEntry::getVideoViewCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_YouTube_VideoEntry::getVideoViewCount方法的具体用法?PHP Zend_Gdata_YouTube_VideoEntry::getVideoViewCount怎么用?PHP Zend_Gdata_YouTube_VideoEntry::getVideoViewCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata_YouTube_VideoEntry的用法示例。


在下文中一共展示了Zend_Gdata_YouTube_VideoEntry::getVideoViewCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: echoVideoMetadata

/**
 * Echo video metadata
 *
 * @param Zend_Gdata_YouTube_VideoEntry $entry The video entry
 * @return void
 */
function echoVideoMetadata($entry)
{
    $title = htmlspecialchars($entry->getVideoTitle());
    $description = htmlspecialchars($entry->getVideoDescription());
    $authorUsername = htmlspecialchars($entry->author[0]->name);
    $authorUrl = 'http://www.youtube.com/profile?user=' . $authorUsername;
    $tags = htmlspecialchars(implode(', ', $entry->getVideoTags()));
    $duration = htmlspecialchars($entry->getVideoDuration());
    $watchPage = htmlspecialchars($entry->getVideoWatchPageUrl());
    $viewCount = htmlspecialchars($entry->getVideoViewCount());
    $rating = 0;
    if (isset($entry->rating->average)) {
        $rating = $entry->rating->average;
    }
    $numRaters = 0;
    if (isset($entry->rating->numRaters)) {
        $numRaters = $entry->rating->numRaters;
    }
    $flashUrl = htmlspecialchars(findFlashUrl($entry));
    print <<<END
        <b>Title:</b> {$title}<br />
        <b>Description:</b> {$description}<br />
        <b>Author:</b> <a href="{$authorUrl}">{$authorUsername}</a><br />
        <b>Tags:</b> {$tags}<br />
        <b>Duration:</b> {$duration} seconds<br />
        <b>View count:</b> {$viewCount}<br />
        <b>Rating:</b> {$rating} ({$numRaters} ratings)<br />
        <b>Flash:</b> <a href="{$flashUrl}">{$flashUrl}</a><br />
        <b>Watch page:</b> <a href="{$watchPage}">{$watchPage}</a> <br />
END;
}
开发者ID:holdensmagicalunicorn,项目名称:copperFramework,代码行数:37,代码来源:operations.php

示例2: testGetVideoViewCount

 public function testGetVideoViewCount()
 {
     $this->entry->transferFromXML($this->entryText);
     $videoEntry = $this->entry;
     $this->assertEquals(113321, $videoEntry->getVideoViewCount());
     $newEntry = new Zend_Gdata_YouTube_VideoEntry();
     $this->assertEquals(null, $newEntry->getVideoViewCount());
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:8,代码来源:VideoEntryTest.php


注:本文中的Zend_Gdata_YouTube_VideoEntry::getVideoViewCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。