From d394c40e93652d3d02b1b58bdc578fbbdd5d42e0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 27 Aug 2021 16:05:09 +0300 Subject: [PATCH 1/3] Create tvguide.com.config.js --- sites/tvguide.com.config.js | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sites/tvguide.com.config.js diff --git a/sites/tvguide.com.config.js b/sites/tvguide.com.config.js new file mode 100644 index 00000000..f6c13ac1 --- /dev/null +++ b/sites/tvguide.com.config.js @@ -0,0 +1,47 @@ +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const timezone = require('dayjs/plugin/timezone') + +dayjs.extend(utc) +dayjs.extend(timezone) + +module.exports = { + lang: 'en', + site: 'tvguide.com', + channels: 'tvguide.com.channels.xml', + output: '.gh-pages/guides/tvguide.com.guide.xml', + url: function ({ date, channel }) { + const localTime = date.tz('America/New_York') + const parts = channel.site_id.split('#') + const start = localTime.startOf('d') + const duration = localTime.endOf('d').diff(start, 'm') + const url = `https://cmg-prod.apigee.net/v1/xapi/tvschedules/tvguide/${ + parts[0] + }/web?start=${start.unix()}&duration=${duration}&channelSourceIds=${parts[1]}` + + return url + }, + parser: function ({ content }) { + const programs = [] + const items = parseItems(content) + items.forEach(item => { + programs.push({ + title: item.title, + start: parseTime(item.startTime), + stop: parseTime(item.endTime) + }) + }) + + return programs + } +} + +function parseTime(timestamp) { + return dayjs.unix(timestamp) +} + +function parseItems(content) { + const json = JSON.parse(content) + + return json.data.items[0].programSchedules +} From 1b13eb3397b5c4dc1c7ae0e5a67e9dbdc3dcbfec Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 27 Aug 2021 16:05:20 +0300 Subject: [PATCH 2/3] Create tvguide.com.channels.xml --- sites/tvguide.com.channels.xml | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 sites/tvguide.com.channels.xml diff --git a/sites/tvguide.com.channels.xml b/sites/tvguide.com.channels.xml new file mode 100755 index 00000000..5ad87d8e --- /dev/null +++ b/sites/tvguide.com.channels.xml @@ -0,0 +1,93 @@ + + + + A&E East + ABC East + AMC East + Animal Planet East + BBC America East + BET East + Bravo East + Cartoon Network East + CBS East + Cinemax East + CMT East + CNBC US + CNN USA + Comedy Central East + Discovery Channel East + Discovery Life Channel + Disney Channel East + Disney XD East + DIY Network USA + E! East + ESPN + ESPN 2 US + ESPN Classic USA + ESPNU + Flix East + Food Network East + Fox East + Fox News Channel + Fox Sports 1 + Freeform East + Fuse East + FX East + FX Movie Channel + FXX East + FYI East + Game Show Network East + Golf Channel US + Hallmark Channel East + HBO 2 East + HBO East + HBO Signature East + HGTV East + History East + IFC East + Investigation Discovery East + ION TV East + Lifetime East + Lifetime Movies East + Lifetime Real Women + MoreMax East + MSNBC + MTV East + MyNetworkTV + National Geographic East + NBC East + NBCSN + NewsNation East + Nickelodeon East + Oprah Winfrey Network East + Oxygen East + Paramount Network East + PBS East + Pop East + QVC US + Reelz + Science + Showtime 2 East + Showtime East + Smithsonian Channel East + Starz East + Starz Encore East + Sundance TV East + Syfy East + TBS East + TCM US + Telemundo Este + The CW East + The Movie Channel East + TLC East + TNT East + Travel Channel East + truTV East + TV Land East + TVG + Univisión East + USA Network East + VH1 East + We TV East + + \ No newline at end of file From f5cfe0d1045b443541c61a254a65efc1e6afbb96 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 27 Aug 2021 16:05:23 +0300 Subject: [PATCH 3/3] Update auto-update.yml --- .github/workflows/auto-update.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 99411305..b2d22d22 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -35,7 +35,8 @@ jobs: tvtv.ca, tvtv.us, tv.lv, - vidio.com + vidio.com, + tvguide.com ] steps: - name: Checkout