diff --git a/sites/mysky.com.ph/__data__/content.json b/sites/mysky.com.ph/__data__/content.json deleted file mode 100644 index 0cc6dd0f1..000000000 --- a/sites/mysky.com.ph/__data__/content.json +++ /dev/null @@ -1 +0,0 @@ -{"events":[{"name":"TV PATROL","location":"8","start":"2022/10/04 19:00","end":"2022/10/04 20:00","userData":{"description":"Description example"}},{"name":"DARNA","location":"8","start":"2022/10/05 20:00","end":"2022/10/05 20:45","userData":{"description":""}},{"name":"Zoe Bakes S1","location":"22","start":"2022/10/04 20:30","end":"2022/10/04 21:00","userData":{"description":"Zo Franois Dad is a beekeeper. So for his birthday, she bakes him a special beehiveshaped cake."}}]} \ No newline at end of file diff --git a/sites/mysky.com.ph/mysky.com.ph.channels.xml b/sites/mysky.com.ph/mysky.com.ph.channels.xml deleted file mode 100644 index 071f0538c..000000000 --- a/sites/mysky.com.ph/mysky.com.ph.channels.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - KNOWLEDGE CHANNEL - CINEMO! - KAPAMILYA CHANNEL - JEEPNEY TV - TV5 - ASIAN FOOD NETWORK - MYX - ANC - CNN - BLOOMBERG - SPOTV - SPOTV 2 - WARNER TV - CINEMAX - DISCOVERY CHANNEL - ANIMAL PLANET - CARTOON NETWORK - NICKELODEON - ANIMAX - DREAMWORKS - AXN - ROCK ENTERTAINMENT - HBO - TAP MOVIES - CINEMA ONE - PBO - TLC - KIX - LIFETIME - HISTORY - FOOD NETWORK - KBS WORLD - TapAction Flix - TMC (TAGALIZED MOVIE CHANNEL) - TRAVEL CHANNEL - HGTV - CELESTIAL CLASSIC MOVIES - CRIME & INVESTIGATION - HBO HITS - HBO SIGNATURE - HBO FAMILY - NICK JR. - ROCK ACTION - THRILL - FASHION TV - CHANNEL NEWS ASIA - HLN - FOX NEWS - GEM TV SD - CARTOONITO - NHK PREMIUM - DEUTSCHEWELLE - TV 5 MONDE - PREMIER SPORTS - TVBS ASIA - STAR BHARAT - DISCOVERY ASIA - HISTORY HD - KAPAMILYA CHANNEL HD - HBO HD - HBO HITS HD - TAP MOVIES HD - PREMIER SPORTS HD - CARTOON NETWORK HD - TapAction Flix HD - CNN HD - ANC HD - CINEMA WORLD HD - HBO SIGNATURE HD - HBO FAMILY HD - MTV LIVE HD - ROCK ENTERTAINMENT HD - WARNER TV HD - CINEMAX HD - LIFETIME HD - TRAVEL CHANNEL HD - CRIME & INVESTIGATION HD - BEIN SPORTS 1 HD - BEIN SPORTS 2 HD - BEIN SPORTS 3 HD - FASHION TV HD - ROCK ACTION HD - EUROSPORT - OUTDOOR CHANNEL - EURONEWS - NHK WORLD JAPAN - KIX HD - FOOD NETWORK HD - HGTV HD - AXN HD - ASIAN FOOD NETWORK HD - EUROSPORT HD - DREAMWORKS HD - MEZZO LIVE HD - SPOTV HD - SPOTV 2 HD - METRO CHANNEL SD - METRO CHANNEL HD - TLC HD - DISCOVERY CHANNEL HD - ANIMAL PLANET HD - ZOO MOO - DA VINCI - TECH STORM - TVBS NEWS - ONE SPORTS - TAP SPORTS HD - MTV 90s - PREMIER FOOTBALL HD - A2Z - TAP TV - TAP EDGE - PREMIER SPORTS 2 HD - GLOBAL TREKKER HD - LOVE NATURE HD - diff --git a/sites/mysky.com.ph/mysky.com.ph.config.js b/sites/mysky.com.ph/mysky.com.ph.config.js deleted file mode 100644 index c04df7bd6..000000000 --- a/sites/mysky.com.ph/mysky.com.ph.config.js +++ /dev/null @@ -1,63 +0,0 @@ -const axios = require('axios') -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: 'mysky.com.ph', - days: 2, - url: 'https://skyepg.mysky.com.ph/Main/getEventsbyType', - request: { - cache: { - ttl: 60 * 60 * 1000 // 1 hour - } - }, - parser: function ({ content, channel, date }) { - let programs = [] - const items = parseItems(content, channel, date) - items.forEach(item => { - programs.push({ - title: item.name, - description: item.userData.description, - start: parseStart(item), - stop: parseStop(item) - }) - }) - - return programs - }, - async channels() { - const items = await axios - .get('https://skyepg.mysky.com.ph/Main/getEventsbyType') - .then(r => r.data.location) - .catch(console.log) - - return items.map(item => ({ - lang: 'en', - site_id: item.id, - name: item.name - })) - } -} - -function parseStart(item) { - return dayjs.tz(item.start, 'YYYY/MM/DD HH:mm', 'Asia/Manila') -} - -function parseStop(item) { - return dayjs.tz(item.end, 'YYYY/MM/DD HH:mm', 'Asia/Manila') -} - -function parseItems(content, channel, date) { - if (!content) return [] - const data = JSON.parse(content) - if (!data || !Array.isArray(data.events)) return [] - const d = date.format('YYYY/MM/DD') - - return data.events.filter(i => i.location == channel.site_id && i.start.includes(d)) -} diff --git a/sites/mysky.com.ph/mysky.com.ph.test.js b/sites/mysky.com.ph/mysky.com.ph.test.js deleted file mode 100644 index fba104724..000000000 --- a/sites/mysky.com.ph/mysky.com.ph.test.js +++ /dev/null @@ -1,45 +0,0 @@ -const { parser, url } = require('./mysky.com.ph.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-10-04', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '8', - xmltv_id: 'KapamilyaChannel.ph' -} - -it('can generate valid url', () => { - expect(url).toBe('https://skyepg.mysky.com.ph/Main/getEventsbyType') -}) - -it('can parse response', () => { - const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json')) - const result = parser({ content, channel, date }).map(p => { - p.start = p.start.toJSON() - p.stop = p.stop.toJSON() - return p - }) - - expect(result).toMatchObject([ - { - start: '2022-10-04T11:00:00.000Z', - stop: '2022-10-04T12:00:00.000Z', - title: 'TV PATROL', - description: 'Description example' - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ - content: '', - channel, - date - }) - expect(result).toMatchObject([]) -}) diff --git a/sites/mysky.com.ph/readme.md b/sites/mysky.com.ph/readme.md deleted file mode 100644 index c8eddcde0..000000000 --- a/sites/mysky.com.ph/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# mysky.com.ph - -https://www.mysky.com.ph/metromanila/tv-schedules - -### Download the guide - -```sh -npm run grab --- --sites=mysky.com.ph -``` - -### Update channel list - -```sh -npm run channels:parse --- --config=./sites/mysky.com.ph/mysky.com.ph.config.js --output=./sites/mysky.com.ph/mysky.com.ph.channels.xml -``` - -### Test - -```sh -npm test --- mysky.com.ph -```