Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: XML
OBS – Get Active Publish Streaming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <!--使用html格式輸出--> <xsl:template match="stream"> <!--抓取stream template的內容--> <table> <tr id="cowtr"> <td id="cowtd"> <!--這邊只是為了給後續php parse表格內容時的tag--> <xsl:choose> <xsl:when test="active"> <!--當狀態是active的時候,即為publish狀態--> <xsl:value-of select="name"/> <!--只抓取名稱--> </xsl:when> </xsl:choose> </td> </tr> </table> </xsl:template> </xsl:stylesheet> |
然後再使用php進行parse去除不必要的資訊
1 2 3 4 5 6 7 8 9 10 |
<?php include_once('simple_html_dom.php'); #這邊的simple_html_dom.php是到http://sourceforge.net/projects/simplehtmldom/files/ 進行下載 $cowdata=file_get_html("http://10.9.50.53/streamlist"); #將html抓回成html dom物件 foreach($cowdata->find('td') as $element){ #尋找介於td內的資料 echo "<client>".$element->plaintext . "</client>n"; } ?> |
Posted in OBS, PHP, XML
Leave a comment