From 9436ad808f2bc520463e082a9d6bddf6fa430057 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:46:47 +0300 Subject: [PATCH] Delete sites/kan.org.il --- sites/kan.org.il/__data__/content.json | 1 - sites/kan.org.il/kan.org.il.channels.xml | 6 --- sites/kan.org.il/kan.org.il.config.js | 52 ------------------------ sites/kan.org.il/kan.org.il.test.js | 47 --------------------- sites/kan.org.il/readme.md | 15 ------- 5 files changed, 121 deletions(-) delete mode 100644 sites/kan.org.il/__data__/content.json delete mode 100644 sites/kan.org.il/kan.org.il.channels.xml delete mode 100644 sites/kan.org.il/kan.org.il.config.js delete mode 100644 sites/kan.org.il/kan.org.il.test.js delete mode 100644 sites/kan.org.il/readme.md diff --git a/sites/kan.org.il/__data__/content.json b/sites/kan.org.il/__data__/content.json deleted file mode 100644 index 0037cfd42..000000000 --- a/sites/kan.org.il/__data__/content.json +++ /dev/null @@ -1 +0,0 @@ -[{"title":"ארץ מולדת - בין תורכיה לבריטניה","start_time":"2022-03-06T00:05:37","end_time":"2022-03-06T00:27:12","id":"2598","age_category_desc":"0","epg_name":"ארץ מולדת","title1":"ארץ מולדת - בין תורכיה לבריטניה","chapter_number":"9","live_desc":"קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.","Station_Radio":"0","Station_Id":"20","stationUrlScheme":"kan11://plugin/?type=player&plugin_identifier=kan_player&ds=general-provider%3A%2F%2FfetchData%3Ftype%3DFEED_JSON%26url%3DaHR0cHM6Ly93d3cua2FuLm9yZy5pbC9hcHBLYW4vbGl2ZVN0YXRpb25zLmFzaHg%3D&id=4","program_code":"3671","picture_code":"https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg","program_image":"","station_image":"Logo_Image_Logo20_img__8.jpg","program_id":"","timezone":"2"}] \ No newline at end of file diff --git a/sites/kan.org.il/kan.org.il.channels.xml b/sites/kan.org.il/kan.org.il.channels.xml deleted file mode 100644 index b566698d6..000000000 --- a/sites/kan.org.il/kan.org.il.channels.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - כאן 11 - مكان - חינוכית - diff --git a/sites/kan.org.il/kan.org.il.config.js b/sites/kan.org.il/kan.org.il.config.js deleted file mode 100644 index 01aaec094..000000000 --- a/sites/kan.org.il/kan.org.il.config.js +++ /dev/null @@ -1,52 +0,0 @@ -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const timezone = require('dayjs/plugin/timezone') -const customParseFormat = require('dayjs/plugin/customParseFormat') - -dayjs.extend(utc) -dayjs.extend(timezone) -dayjs.extend(customParseFormat) - -module.exports = { - site: 'kan.org.il', - days: 2, - url: function ({ channel, date }) { - return `https://www.kan.org.il/tv-guide/tv_guidePrograms.ashx?stationID=${ - channel.site_id - }&day=${date.format('DD/MM/YYYY')}` - }, - parser: function ({ content }) { - let programs = [] - const items = parseItems(content) - items.forEach(item => { - programs.push({ - title: item.title, - description: item.live_desc, - image: item.picture_code, - start: parseStart(item), - stop: parseStop(item) - }) - }) - - return programs - } -} - -function parseStart(item) { - if (!item.start_time) return null - - return dayjs.tz(item.start_time, 'YYYY-MM-DDTHH:mm:ss', 'Asia/Jerusalem') -} - -function parseStop(item) { - if (!item.end_time) return null - - return dayjs.tz(item.end_time, 'YYYY-MM-DDTHH:mm:ss', 'Asia/Jerusalem') -} - -function parseItems(content) { - const data = JSON.parse(content) - if (!Array.isArray(data)) return [] - - return data -} diff --git a/sites/kan.org.il/kan.org.il.test.js b/sites/kan.org.il/kan.org.il.test.js deleted file mode 100644 index f20c02093..000000000 --- a/sites/kan.org.il/kan.org.il.test.js +++ /dev/null @@ -1,47 +0,0 @@ -const { parser, url } = require('./kan.org.il.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-03-06', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '19', - xmltv_id: 'KANEducational.il' -} - -it('can generate valid url', () => { - expect(url({ channel, date })).toBe( - 'https://www.kan.org.il/tv-guide/tv_guidePrograms.ashx?stationID=19&day=06/03/2022' - ) -}) - -it('can parse response', () => { - const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json')) - const result = parser({ content }).map(p => { - p.start = p.start.toJSON() - p.stop = p.stop.toJSON() - return p - }) - - expect(result).toMatchObject([ - { - start: '2022-03-05T22:05:37.000Z', - stop: '2022-03-05T22:27:12.000Z', - title: 'ארץ מולדת - בין תורכיה לבריטניה', - description: - "קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.", - image: 'https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg' - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ - content: '[]' - }) - expect(result).toMatchObject([]) -}) diff --git a/sites/kan.org.il/readme.md b/sites/kan.org.il/readme.md deleted file mode 100644 index 4c97afb02..000000000 --- a/sites/kan.org.il/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# kan.org.il - -https://kan.org.il/ _[Geo-blocked]_ - -### Download the guide - -```sh -npm run grab --- --sites=kan.org.il -``` - -### Test - -```sh -npm test --- kan.org.il -```