mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #1041 from iptv-org/add-sjonvarp.is
Add guide from sjonvarp.is
This commit is contained in:
commit
914c839a85
6 changed files with 614 additions and 0 deletions
17
.github/workflows/sjonvarp.is.yml
vendored
Normal file
17
.github/workflows/sjonvarp.is.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: sjonvarp.is
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * *'
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
workflows: [_trigger]
|
||||
types:
|
||||
- completed
|
||||
jobs:
|
||||
load:
|
||||
uses: ./.github/workflows/_load.yml
|
||||
with:
|
||||
site: ${{github.workflow}}
|
||||
secrets:
|
||||
APP_ID: ${{ secrets.APP_ID }}
|
||||
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
|
231
sites/sjonvarp.is/__data__/content.html
Normal file
231
sites/sjonvarp.is/__data__/content.html
Normal file
File diff suppressed because one or more lines are too long
231
sites/sjonvarp.is/__data__/no_content.html
Normal file
231
sites/sjonvarp.is/__data__/no_content.html
Normal file
|
@ -0,0 +1,231 @@
|
|||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<html lang="is">
|
||||
<head>
|
||||
<link rel="icon" href="http://beta.sjonvarp.is/favicon.ico?v=2" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<!-- <meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" /> -->
|
||||
<title>sjonvarp.is - Sjónvarpsdagskráin</title>
|
||||
<script type='text/javascript' src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/jquery-1.11.3.js"></script>
|
||||
<script type="text/javascript" src="bootstrap/dist/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="js/detailshow.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#nav').affix({
|
||||
offset: {
|
||||
top: $('header').height()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadContent() {
|
||||
var viewportWidth = $(window).width();
|
||||
if (viewportWidth > 1400) {
|
||||
$('#wrapper').load('content.php');
|
||||
} else {
|
||||
$('#wrapper').load('content.php?size=M');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css" media="screen">@import "./css/screen.css";</style>
|
||||
<style type="text/css" media="screen">@import "./css/konnun.css";</style>
|
||||
<style type="text/css" media="screen">@import "./css/modalbox.css";</style>
|
||||
<link href="bootstrap/dist/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="css/nano-bootstrap.css" rel="stylesheet">
|
||||
<link href="css/people.css" rel="stylesheet">
|
||||
<link rel="apple-touch-icon" href="/bootstrap/img/apple-touch-icon.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/bootstrap/img/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/bootstrap/img/apple-touch-icon-114x114.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- header start-->
|
||||
<header class="masthead min-width nano-header">
|
||||
<div class="container">
|
||||
<div class="headerrow">
|
||||
<a href="index.php">
|
||||
<img src="images/Sjonvarp-app-icon.png"></img>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- navbar start -->
|
||||
<div id="nav" class="min-width">
|
||||
<!-- Fixed navbar -->
|
||||
<div class="navbar navbar-default navbar-static"> <!-- fixed-top"> -->
|
||||
<div class="container">
|
||||
<!-- <div class="navbar-header"> -->
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="index.php">Sjónvarp.is</a>
|
||||
<!-- </div> -->
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Klukkan 23:00 <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="dropdown-header">Flýtileið</li><li><a href="index.php?Tm=19:2022-08-28" >Kvöldið</a></li><li><a href="index.php?Tm=23:2022-08-28" >Núna</a></li><li class="dropdown-header">Klukkan</li><li><a href="index.php?Tm=09:2022-08-28" >09:00 </a></li>
|
||||
<li><a href="index.php?Tm=10:2022-08-28" >10:00 </a></li>
|
||||
<li><a href="index.php?Tm=11:2022-08-28" >11:00 </a></li>
|
||||
<li><a href="index.php?Tm=12:2022-08-28" >12:00 </a></li>
|
||||
<li><a href="index.php?Tm=13:2022-08-28" >13:00 </a></li>
|
||||
<li><a href="index.php?Tm=14:2022-08-28" >14:00 </a></li>
|
||||
<li><a href="index.php?Tm=15:2022-08-28" >15:00 </a></li>
|
||||
<li><a href="index.php?Tm=16:2022-08-28" >16:00 </a></li>
|
||||
<li><a href="index.php?Tm=17:2022-08-28" >17:00 </a></li>
|
||||
<li><a href="index.php?Tm=18:2022-08-28" >18:00 </a></li>
|
||||
<li><a href="index.php?Tm=19:2022-08-28" >19:00 </a></li>
|
||||
<li><a href="index.php?Tm=20:2022-08-28" >20:00 </a></li>
|
||||
<li><a href="index.php?Tm=21:2022-08-28" >21:00 </a></li>
|
||||
<li><a href="index.php?Tm=22:2022-08-28" >22:00 </a></li>
|
||||
<li><a href="index.php?Tm=23:2022-08-28" ><b>23:00 </b></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Sunnudagur 28. ágúst <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="index.php?Tm=23:2022-08-27" title='Sjá dagskránna á laugardegi'>Laugardagur 27. ágúst</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-08-28" title='Sjá dagskránna á sunnudegi'><b>Sunnudagur 28. ágúst</b></a></li>
|
||||
<li><a href="index.php?Tm=23:2022-08-29" title='Sjá dagskránna á mánudegi'>Mánudagur 29. ágúst</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-08-30" title='Sjá dagskránna á þriðjudegi'>Þriðjudagur 30. ágúst</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-08-31" title='Sjá dagskránna á miðvikudegi'>Miðvikudagur 31. ágúst</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-09-01" title='Sjá dagskránna á fimmtudegi'>Fimmtudagur 1. september</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-09-02" title='Sjá dagskránna á föstudegi'>Föstudagur 2. september</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-09-03" title='Sjá dagskránna á laugardegi'>Laugardagur 3. september</a></li>
|
||||
<li><a href="index.php?Tm=23:2022-09-04" title='Sjá dagskránna á sunnudegi'>Sunnudagur 4. september</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Stöðvar <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="index.php">Allar stöðvar</a></li>
|
||||
<li><a href="index.php?type=SP">Íþróttir</a></li>
|
||||
<li><a href="index.php?type=MV">Kvikmyndir</a></li>
|
||||
<li><a href="index.php?type=CH">Barnastöðvar</a></li>
|
||||
<li><a href="index.php?type=NW">Fréttir</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="index.php?grp=SCA">Norrænar</a></li>
|
||||
<li><a href="index.php?grp=EUR">Evrópa</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- <li><a href="index.php?Tm=?&p=livesports">Beinar útsendingar</a></li>
|
||||
<li><a href="index.php?Tm=?&p=people">Afmæli í dag</a></li> -->
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Heitt í dag <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<li><a href="index.php?Tm=?&p=livesports">Beinar útsendingar</a></li>
|
||||
<li><a href="index.php?Tm=?&p=trending">Vinsælt í dag</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="index.php?Tm=?&p=people">Afmælisbörn dagsins</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="navbar-right">
|
||||
<form class="navbar-form" role="search" style="float: left; overflow: hidden;">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Leita" name='s'>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- navbar end -->
|
||||
</header>
|
||||
<!-- header end-->
|
||||
|
||||
<!-- ad small banner -->
|
||||
<!-- <img src="images/ads/audur.png"/> -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="container nano-container">
|
||||
<!-- <img src="images/ads/audur.png" style="margin-left: 27px;margin-top: 20px;"> -->
|
||||
<div class="listing">
|
||||
<ul class="grid">
|
||||
<li class='timeline-row'>
|
||||
<a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=-1" style='width: 38px'>
|
||||
<!-- <a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=-1" onMouseOver="changeImage('on', 'img10','Aftur um eina klukkustund', '10', 2); return true;" onMouseOut="changeImage('off', 'img10', '', '10', 2); return true;" style='width: 38px'> -->
|
||||
<img name='img10' src='images/toptimas/toptimas_r4_c02.gif' vertical-align='middle' width='20' height='18' border='0' />
|
||||
</a>
|
||||
<!-- <a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=+1" onMouseOver="changeImage('on', 'img11','Áfram um eina klukkustund', '11', 2); return true;" onMouseOut="changeImage('off', 'img11', '', '11', 2); return true;" style='width: 38px'> -->
|
||||
<a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=+1" style='width: 38px'>
|
||||
<img name='img11' src='images/toptimas/toptimas_r4_c03.gif' align='middle' width='20' height='18' border='0'/>
|
||||
</a>
|
||||
<span class='day-listing-control' style='width: 75%'>Mánudagur 28. ágúst 2023</span>
|
||||
</li>
|
||||
|
||||
<div class='day-channels'><li class = 'day-channels-channel-active listing-row' id='RUV'><a class="channel" href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28" title="Skoða dagskránna á RÚV í dag" style='width: 15%'><img src='images/logos/RUV.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S1'><a class="channel" href="index.php?Tm=?&p=idag&c=S1&y=2023&m=08&d=28" title="Skoða dagskránna á Sjónvarp Símans í dag" style='width: 15%'><img src='images/logos/gray/SIMINN.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='ST2'><a class="channel" href="index.php?Tm=?&p=idag&c=ST2&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 í dag" style='width: 15%'><img src='images/logos/gray/st2.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='STOD3'><a class="channel" href="index.php?Tm=?&p=idag&c=STOD3&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Fjölskylda í dag" style='width: 15%'><img src='images/logos/gray/stod2_fjolskylda_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='BIO'><a class="channel" href="index.php?Tm=?&p=idag&c=BIO&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Bíó í dag" style='width: 15%'><img src='images/logos/gray/stod2_bio_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='RUVI'><a class="channel" href="index.php?Tm=?&p=idag&c=RUVI&y=2023&m=08&d=28" title="Skoða dagskránna á RÚV Íþróttir í dag" style='width: 15%'><img src='images/logos/gray/RUVI.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S1SPORT'><a class="channel" href="index.php?Tm=?&p=idag&c=S1SPORT&y=2023&m=08&d=28" title="Skoða dagskránna á Síminn Sport í dag" style='width: 15%'><img src='images/logos/gray/SIMINNSPORT.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S1SPORT2'><a class="channel" href="index.php?Tm=?&p=idag&c=S1SPORT2&y=2023&m=08&d=28" title="Skoða dagskránna á Síminn Sport 2 í dag" style='width: 15%'><img src='images/logos/gray/SIMINNSPORT2.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='SYN'><a class="channel" href="index.php?Tm=?&p=idag&c=SYN&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Sport í dag" style='width: 15%'><img src='images/logos/gray/stod2_sport_2020.jpg' /></a></li><li class='timeline-row'>
|
||||
<a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=-1" style='width: 38px'>
|
||||
<!-- <a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=-1" onMouseOver="changeImage('on', 'img10','Aftur um eina klukkustund', '10', 2); return true;" onMouseOut="changeImage('off', 'img10', '', '10', 2); return true;" style='width: 38px'> -->
|
||||
<img name='img10' src='images/toptimas/toptimas_r4_c02.gif' vertical-align='middle' width='20' height='18' border='0' />
|
||||
</a>
|
||||
<!-- <a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=+1" onMouseOver="changeImage('on', 'img11','Áfram um eina klukkustund', '11', 2); return true;" onMouseOut="changeImage('off', 'img11', '', '11', 2); return true;" style='width: 38px'> -->
|
||||
<a class='timeline-arrow' href="index.php?Tm=?&p=idag&c=RUV&y=2023&m=08&d=28&a=+1" style='width: 38px'>
|
||||
<img name='img11' src='images/toptimas/toptimas_r4_c03.gif' align='middle' width='20' height='18' border='0'/>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class = 'day-channels-channel listing-row' id='SKJARSPORT'><a class="channel" href="index.php?Tm=?&p=idag&c=SKJARSPORT&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Sport 2 í dag" style='width: 15%'><img src='images/logos/gray/stod2_sport2_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S2SPORT3'><a class="channel" href="index.php?Tm=?&p=idag&c=S2SPORT3&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Sport 3 í dag" style='width: 15%'><img src='images/logos/gray/stod2_sport3_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S2SPORT4'><a class="channel" href="index.php?Tm=?&p=idag&c=S2SPORT4&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Sport 4 í dag" style='width: 15%'><img src='images/logos/gray/stod2_sport4_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='S2ESPORT'><a class="channel" href="index.php?Tm=?&p=idag&c=S2ESPORT&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 E Sport í dag" style='width: 15%'><img src='images/logos/gray/stod2_esport_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='GOLF'><a class="channel" href="index.php?Tm=?&p=idag&c=GOLF&y=2023&m=08&d=28" title="Skoða dagskránna á Stöð 2 Golf í dag" style='width: 15%'><img src='images/logos/gray/stod2_golf_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='HRING'><a class="channel" href="index.php?Tm=?&p=idag&c=HRING&y=2023&m=08&d=28" title="Skoða dagskránna á Hringbraut í dag" style='width: 15%'><img src='images/logos/gray/hringbraut.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='N4'><a class="channel" href="index.php?Tm=?&p=idag&c=N4&y=2023&m=08&d=28" title="Skoða dagskránna á N4 í dag" style='width: 15%'><img src='images/logos/gray/n4_2020.jpg' /></a></li><li class = 'day-channels-channel listing-row' id='OMEG'><a class="channel" href="index.php?Tm=?&p=idag&c=OMEG&y=2023&m=08&d=28" title="Skoða dagskránna á Omega í dag" style='width: 15%'><img src='images/logos/gray/omega.png' /></a></li></div><div class='day-listing'><div class='day-listing-channel'><img src='images/logos/RUV.jpg'><span class='day-listing-channel-name'>RÚV</span></div></div
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<div id="footer" class="min-width">
|
||||
<p>
|
||||
<a href="?p=um" title="Nánari upplýsingar um sjonvarp.is">Upplýsingar um sjonvarp.is</a>
|
||||
</p>
|
||||
</div>
|
||||
<!-- footer end -->
|
||||
|
||||
<!-- </div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- counter start -->
|
||||
<script type="text/javascript" src="js/script.js"></script>
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-1465830-1";
|
||||
urchinTracker();
|
||||
</script> <!-- counter end -->
|
||||
|
||||
<!-- facebook start -->
|
||||
<div id="fb-root"></div>
|
||||
<script>
|
||||
(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.5";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
</script>
|
||||
<!-- facebook end -->
|
||||
<script src='js/responsive-img.js' defer></script>
|
||||
</body>
|
||||
|
||||
</html>
|
63
sites/sjonvarp.is/sjonvarp.is.config.js
Normal file
63
sites/sjonvarp.is/sjonvarp.is.config.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
const dayjs = require('dayjs')
|
||||
const cheerio = require('cheerio')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
module.exports = {
|
||||
site: 'sjonvarp.is',
|
||||
url: function ({ channel, date }) {
|
||||
return `http://www.sjonvarp.is/index.php?Tm=%3F&p=idag&c=${channel.site_id}&y=${date.format(
|
||||
'YYYY'
|
||||
)}&m=${date.format('MM')}&d=${date.format('DD')}`
|
||||
},
|
||||
parser: function ({ content, date }) {
|
||||
let programs = []
|
||||
const items = parseItems(content)
|
||||
items.forEach(item => {
|
||||
const prev = programs[programs.length - 1]
|
||||
const $item = cheerio.load(item)
|
||||
let start = parseStart($item, date)
|
||||
if (prev) {
|
||||
if (start.isBefore(prev.start)) {
|
||||
start = start.add(1, 'd')
|
||||
date = date.add(1, 'd')
|
||||
}
|
||||
prev.stop = start
|
||||
}
|
||||
const stop = start.add(30, 'm')
|
||||
programs.push({
|
||||
title: parseTitle($item),
|
||||
description: parseDescription($item),
|
||||
start,
|
||||
stop
|
||||
})
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
function parseTitle($item) {
|
||||
return $item('.day-listing-title').text()
|
||||
}
|
||||
|
||||
function parseDescription($item) {
|
||||
return $item('.day-listing-description').text()
|
||||
}
|
||||
|
||||
function parseStart($item, date) {
|
||||
const time = $item('.day-listing-time')
|
||||
|
||||
return dayjs.utc(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm')
|
||||
}
|
||||
|
||||
function parseItems(content) {
|
||||
const $ = cheerio.load(content)
|
||||
|
||||
return $(
|
||||
'body > div.container.nano-container > div > ul > div.day-listing > div:not(.day-listing-channel)'
|
||||
).toArray()
|
||||
}
|
50
sites/sjonvarp.is/sjonvarp.is.test.js
Normal file
50
sites/sjonvarp.is/sjonvarp.is.test.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
// npx epg-grabber --config=sites/sjonvarp.is/sjonvarp.is.config.js --channels=sites/sjonvarp.is/sjonvarp.is_is.channels.xml --output=guide.xml --days=2
|
||||
|
||||
const { parser, url } = require('./sjonvarp.is.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2022-08-28', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: 'RUV',
|
||||
xmltv_id: 'RUV.is'
|
||||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'http://www.sjonvarp.is/index.php?Tm=%3F&p=idag&c=RUV&y=2022&m=08&d=28'
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'))
|
||||
const results = parser({ content, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2022-08-28T07:15:00.000Z',
|
||||
stop: '2022-08-28T07:16:00.000Z',
|
||||
title: 'KrakkaRÚV'
|
||||
})
|
||||
|
||||
expect(results[1]).toMatchObject({
|
||||
start: '2022-08-28T07:16:00.000Z',
|
||||
stop: '2022-08-28T07:21:00.000Z',
|
||||
title: 'Tölukubbar',
|
||||
description: 'Lærið um tölustafina með Tölukubbunum! e.'
|
||||
})
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'))
|
||||
const result = parser({ content, date })
|
||||
expect(result).toMatchObject([])
|
||||
})
|
22
sites/sjonvarp.is/sjonvarp.is_is.channels.xml
Normal file
22
sites/sjonvarp.is/sjonvarp.is_is.channels.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="sjonvarp.is">
|
||||
<channels>
|
||||
<channel lang="is" xmltv_id="Hringbraut.is" site_id="HRING">Hringbraut</channel>
|
||||
<channel lang="is" xmltv_id="N4.is" site_id="N4">N4</channel>
|
||||
<channel lang="is" xmltv_id="Omega.is" site_id="OMEG">Omega</channel>
|
||||
<channel lang="is" xmltv_id="RUV.is" site_id="RUV">RÚV</channel>
|
||||
<channel lang="is" xmltv_id="RUV2.is" site_id="RUVI">RÚV 2</channel>
|
||||
<channel lang="is" xmltv_id="SiminnSport.is" site_id="S1SPORT">Síminn Sport</channel>
|
||||
<channel lang="is" xmltv_id="SiminnSport2.is" site_id="S1SPORT2">Síminn Sport 2</channel>
|
||||
<channel lang="is" xmltv_id="SjonvarpSimans.is" site_id="S1">Sjónvarp Símans</channel>
|
||||
<channel lang="is" xmltv_id="Stod2.is" site_id="ST2">Stöð 2</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Bio.is" site_id="BIO">Stöð 2 Bíó</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Esport.is" site_id="S2ESPORT">Stöð 2 Esport</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Fjolskylda.is" site_id="STOD3">Stöð 2 Fjölskylda</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Golf.is" site_id="GOLF">Stöð 2 Golf</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Sport.is" site_id="SYN">Stöð 2 Sport</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Sport2.is" site_id="SKJARSPORT">Stöð 2 Sport 2</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Sport3.is" site_id="S2SPORT3">Stöð 2 Sport 3</channel>
|
||||
<channel lang="is" xmltv_id="Stod2Sport4.is" site_id="S2SPORT4">Stöð 2 Sport 4</channel>
|
||||
</channels>
|
||||
</site>
|
Loading…
Add table
Add a link
Reference in a new issue