123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- <!DOCTYPE HTML>
- <html lang="" >
- <head>
- <title>虎牙视频 · GitBook</title>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
- <meta name="description" content="">
- <meta name="generator" content="GitBook 3.2.0">
-
-
-
-
- <link rel="stylesheet" href="../gitbook/style.css">
-
-
-
- <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
-
-
-
- <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
-
-
-
- <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
-
-
-
-
-
-
- <link rel="stylesheet" href="../styles/website.css">
-
-
-
-
-
- <meta name="HandheldFriendly" content="true"/>
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
- <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
-
- <link rel="next" href="special.html" />
-
-
- <link rel="prev" href="dwvideo.html" />
-
- </head>
- <body>
-
- <div class="book">
- <div class="book-summary">
-
-
- <div id="book-search-input" role="search">
- <input type="text" placeholder="Type to search" />
- </div>
-
- <nav role="navigation">
-
- <ul class="summary">
-
-
-
-
-
-
-
- <li class="chapter " data-level="1.1" data-path="../">
-
- <a href="../">
-
-
- Introduction
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.2" data-path="../new/new.html">
-
- <a href="../new/new.html">
-
-
- 新人入职后需要做的工作
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.3" data-path="../host/host.html">
-
- <a href="../host/host.html">
-
-
- 常用HOST
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.4" data-path="../workflow/workflow.html">
-
- <a href="../workflow/workflow.html">
-
-
- 前端工作流配置
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.5" >
-
- <span>
-
-
- 多玩SVN和常用页面
-
- </span>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.5.1" data-path="../svn/address.html">
-
- <a href="../svn/address.html">
-
-
- svn及常用地址
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.5.2" data-path="../svn/">
-
- <a href="../svn/">
-
-
- svn目录介绍
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.6" data-path="./">
-
- <a href="./">
-
-
- 发布器简介
-
- </a>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.6.1" data-path="all.html">
-
- <a href="all.html">
-
-
- 发布器调用大全
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.2" >
-
- <span>
-
-
- 实用技巧
-
- </span>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.6.2.1" data-path="locate.html">
-
- <a href="locate.html">
-
-
- 定位相关
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.2.2" data-path="quote.html">
-
- <a href="quote.html">
-
-
- 引用模板
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.2.3" data-path="addredss.html">
-
- <a href="addredss.html">
-
-
- 预览地址和正式地址
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.2.4" data-path="flesh.html">
-
- <a href="flesh.html">
-
-
- 刷新模板
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.6.3" >
-
- <span>
-
-
- 常用语法
-
- </span>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.6.3.1" data-path="alert.html">
-
- <a href="alert.html">
-
-
- 语法核心
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.3.2" data-path="piclist.html">
-
- <a href="piclist.html">
-
-
- 图片列表
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.3.3" data-path="rank.html">
-
- <a href="rank.html">
-
-
- 排行榜
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.3.4" data-path="dwvideo.html">
-
- <a href="dwvideo.html">
-
-
- 多玩视频
-
- </a>
-
-
- </li>
-
- <li class="chapter active" data-level="1.6.3.5" data-path="huyavideo.html">
-
- <a href="huyavideo.html">
-
-
- 虎牙视频
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.6.4" data-path="special.html">
-
- <a href="special.html">
-
-
- 专区嵌套
-
- </a>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.6.4.1" data-path="./">
-
- <a href="./">
-
-
- 首页
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.4.2" data-path="tag.html">
-
- <a href="tag.html">
-
-
- 标签和标签图
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.6.4.3" data-path="art.html">
-
- <a href="art.html">
-
-
- 文章页
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.7" data-path="../duowan/">
-
- <a href="../duowan/">
-
-
- 多玩网
-
- </a>
-
-
- </li>
-
- <li class="chapter " data-level="1.8" data-path="../box/">
-
- <a href="../box/">
-
-
- 盒子
-
- </a>
-
-
- <ul class="articles">
-
-
- <li class="chapter " data-level="1.8.1" data-path="../box/lolbox.html">
-
- <a href="../box/lolbox.html">
-
-
- LOL盒子
-
- </a>
-
-
- </li>
-
- </ul>
-
- </li>
-
- <li class="chapter " data-level="1.9" data-path="../book/README.html">
-
- <span>
-
-
- 文档制作简介
-
- </a>
-
-
- </li>
-
-
- <li class="divider"></li>
- <li>
- <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
- Published with GitBook
- </a>
- </li>
- </ul>
- </nav>
-
-
- </div>
- <div class="book-body">
-
- <div class="body-inner">
-
-
- <div class="book-header" role="navigation">
-
- <!-- Title -->
- <h1>
- <i class="fa fa-circle-o-notch fa-spin"></i>
- <a href=".." >虎牙视频</a>
- </h1>
- </div>
- <div class="page-wrapper" tabindex="-1" role="main">
- <div class="page-inner">
-
- <div id="book-search-results">
- <div class="search-noresults">
-
- <section class="normal markdown-section">
-
- <h1 id="虎牙视频">虎牙视频</h1><h2 id="调用语法参数说明">调用语法参数说明</h2><p>调用语法列表和多玩视频列表是一样的,唯一的区别是增加了读取虎牙视频数据的结构</p><p>可用语法:</p><pre><code> $data.getJsonList("video.rank", "标签(多个逗号分隔)")
- $data.getJsonList("video.rank", "专区ID", "标签(多个逗号分隔)")
- $data.getJsonList("video.rank", "专区ID", "标签(多个逗号分隔)", "排序方式(day#month#year)")
- $data.getJsonList("video.rank", "专区ID", "标签(多个逗号分隔)", "排序方式(day#month#year)", "取多少条")</code></pre>
- <p>获取数据:</p><table>
- <thead>
- <tr><th>获取信息</th>
- <th>语法</th>
- </tr></thead><tbody>
- <tr><td>视频所属专区</td>
- <td>$json.get("video_channel")</td>
- </tr><tr><td>视频播放量</td>
- <td>$json.get("video_play_num")</td>
- </tr><tr><td>视频评论数</td>
- <td>$json.get("video_comment_num")</td>
- </tr><tr><td>视频封面</td>
- <td>$json.get("video_cover")</td>
- </tr><tr><td>用户昵称</td>
- <td>$json.get("user_nickname")</td>
- </tr><tr><td>视频标题</td>
- <td>$json.get("video_title")</td>
- </tr><tr><td>视频副标题</td>
- <td>$json.get("video_subtitle")</td>
- </tr><tr><td>用户主页</td>
- <td>$json.get("user_homepage")</td>
- </tr><tr><td>视频标签</td>
- <td>$json.get("video_tags")</td>
- </tr><tr><td>视频介绍</td>
- <td>$json.get("video_intro")</td>
- </tr><tr><td>视频播放地址</td>
- <td>$json.get("video_url")</td>
- </tr><tr><td>用户ID</td>
- <td>$json.get("user_id")</td>
- </tr><tr><td>视频上传时间</td>
- <td>$json.get("video_upload_time")</td>
- </tr><tr><td>视频时常</td>
- <td>$json.get("video_duration")</td>
- </tr><tr><td>用户头像</td>
- <td>$json.get("user_avatar")</td>
- </tr><tr><td>视频ID</td>
- <td>$json.get("vid")</td>
- </tr></tbody></table>
- <h2 id="代码示例">代码示例</h2><h3 id="普通列表">普通列表</h3><pre><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>ul</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-channel-list clearfix<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
- #set ($list=$data.getPicList("妹纸",0,255,0,4))
- #set ($length=$data.getLength($list))
- #foreach($one in $list)
- #set ($json = $data.getJsonData("video.article",$one.getString('articleid')))
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>li</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>$json.get('video_url')?from<span class="token punctuation">=</span>dnfapp<span class="token punctuation">"</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>$one.title<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-channel-img<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>img</span> <span class="token attr-name">data-echo</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>$json.get('video_cover')<span class="token punctuation">"</span></span> <span class="token attr-name">alt</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>$one.title<span class="token punctuation">"</span></span><span class="token punctuation">/></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span><span class="token punctuation">></span></span>$json.get('video_duration')<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>p</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-channel-title<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>$json.get('video_title')<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>p</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-meta<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-user<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>$json.get('user_homepage')<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>i</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>i</span><span class="token punctuation">></span></span>$json.get('user_nickname')<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>video-num<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>i</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>i</span><span class="token punctuation">></span></span>$json.get('video_play_num')<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>li</span><span class="token punctuation">></span></span>
- #end
- <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>ul</span><span class="token punctuation">></span></span></code></pre>
- <p>可以看到和普通视频的区别就在于</p><pre><code>#set ($json = $data.getJsonData("video.article",$one.getString('articleid')))</code></pre>
- <h2 id="虎牙视频热门视频">虎牙视频热门视频</h2><pre><code>$data.getJsonList("video.hot", "取多少条")
- $data.getJsonList("video.hot", "专区ID", "取多少条")</code></pre>
- <p>其他语法和读取视频列表相同</p>
-
- </section>
-
- </div>
- <div class="search-results">
- <div class="has-results">
-
- <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
- <ul class="search-results-list"></ul>
-
- </div>
- <div class="no-results">
-
- <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
-
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
-
-
- <a href="dwvideo.html" class="navigation navigation-prev " aria-label="Previous page: 多玩视频">
- <i class="fa fa-angle-left"></i>
- </a>
-
-
- <a href="special.html" class="navigation navigation-next " aria-label="Next page: 专区嵌套">
- <i class="fa fa-angle-right"></i>
- </a>
-
-
-
- </div>
- <script>
- var gitbook = gitbook || [];
- gitbook.push(function() {
- gitbook.page.hasChanged({"page":{"title":"虎牙视频","level":"1.6.3.5","depth":3,"next":{"title":"专区嵌套","level":"1.6.4","depth":2,"path":"cms/special.md","ref":"cms/special.md","articles":[{"title":"首页","level":"1.6.4.1","depth":3,"path":"cms/index.md","ref":"cms/index.md","articles":[]},{"title":"标签和标签图","level":"1.6.4.2","depth":3,"path":"cms/tag.md","ref":"cms/tag.md","articles":[]},{"title":"文章页","level":"1.6.4.3","depth":3,"path":"cms/art.md","ref":"cms/art.md","articles":[]}]},"previous":{"title":"多玩视频","level":"1.6.3.4","depth":3,"path":"cms/dwvideo.md","ref":"cms/dwvideo.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"prism":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":[]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"level_number":true,"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"all":false,"google":false,"facebook":false,"twitter":false,"weibo":false}},"gitbook":"3.2.0"},"file":{"path":"cms/huyavideo.md","mtime":"2016-11-24T06:09:45.000Z","type":"markdown"},"gitbook":{"version":"3.2.0","time":"2018-03-19T02:13:33.701Z"},"basePath":"..","book":{"language":""}});
- });
- </script>
- </div>
-
- <script src="../gitbook/gitbook.js"></script>
- <script src="../gitbook/theme.js"></script>
-
-
- <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
-
-
-
- <script src="../gitbook/gitbook-plugin-search/search.js"></script>
-
-
-
- <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
-
-
-
- <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
-
-
-
- <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
-
-
-
- <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
-
-
- </body>
- </html>
|