diff --git a/.github/workflows/superguidatv.it.yml b/.github/workflows/superguidatv.it.yml new file mode 100644 index 00000000..a0942d08 --- /dev/null +++ b/.github/workflows/superguidatv.it.yml @@ -0,0 +1,17 @@ +name: superguidatv.it +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 }} diff --git a/sites/superguidatv.it/__data__/content.html b/sites/superguidatv.it/__data__/content.html new file mode 100644 index 00000000..d01fa1ea --- /dev/null +++ b/sites/superguidatv.it/__data__/content.html @@ -0,0 +1,1750 @@ + + + + + +Guida programmi tv Virgin Radio - Il Palinsesto di oggi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Home programmazione virgin radio nazionali oggi
+
+
+
programmazione virgin radio
+
+

Guida ai programmi tv di oggi in onda su Virgin Radio, mercoledì 11 gennaio 2023

+
+
+
+
Virgin Radio
Canale numero 257 di Nazionali
+
+
11:00
IN ONDA
+
+
Personal Giulia
Musica (180')
+
Programmi TV Pomeriggio Programmi TV Pomeriggio
+
+
14:00
+
+
Revolver
Musica (120')
+
+
16:00
+
+
Free Rock
Musica (120')
+
+
18:00
+
+
Virgin Radio Generation
Musica (120')
+
Programmi TV Sera Programmi TV Sera
+
+
20:00
+
+
Best Rock 500
Musica (60')
+
+
21:00
+
+
Free Rock
Musica (60')
+
+
22:00
+
+
Virgin Radio Motel
Musica (120')
+
Programmi TV Notte Programmi TV Notte
+
+
00:00
+
+
Virgin Radio Motel
Musica (120')
+
+
02:00
+
+
All Nite Rock
Musica (240')
+
+
06:00
+
+
Free Rock
Musica (30')
+
+
La guida ai programmi TV di Virgin Radio in onda oggi, mercoledì 11 gennaio 2023, con tutti i dettagli. Scopri la programmazione televisiva di Virgin Radio con tutte le informazioni relative ai programmi in onda durante la giornata di oggi: film, serie tv, reality show, documentari, sport e tanto altro ancora. Il meglio del palinsesto della prima e della seconda serata! .

Seguici sui social

191,236FansMi piace
69,549FollowerSegui
5,107FollowerSegui

Guida Tv

+

Pubblicità

+

Film Stasera

+

Gli ultimi articoli

+
+
Teo Mammucari a Le Ienevideo
+
Teo Mammucari, il toccante monologo a Le Iene: “quando ti separi devi pensare ai...
+
Teo Mammucari a cuore aperto a Le Iene in un monologo in cui ha raccontato la sua vicenda personale di padre separato. Il conduttore ha...
+
Coppa Italia 2022 2023
+
Ascolti tv di martedì 10 gennaio 2023: Il nostro generale (17.5%), Inter-Parma (19.3%), Boomerissima...
+
Ascolti tv di martedì 10 gennaio 2023: nuova sfida tra Rai1 e Canale 5. “Il nostro generale” contro “Inter-Parma“. Chi ha vinto la sfida relativa agli ascolti...
+
Programmi tv pomeriggio
+
Programmi TV del pomeriggio di oggi | mercoledì 11 gennaio 2023
+
Programmi TV pomeriggio di oggi, mercoledì 11 gennaio 2023 su tutti i canali in chiaro del digitale terrestreI programmi tv del pomeriggio di oggi....
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sites/superguidatv.it/__data__/no_content.html b/sites/superguidatv.it/__data__/no_content.html new file mode 100644 index 00000000..ea4764bf --- /dev/null +++ b/sites/superguidatv.it/__data__/no_content.html @@ -0,0 +1,2010 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + + +
+ + +
+
+ +
+ +
+ + + + + + + +
+ +
+
+ +
+
+ + + +
+
+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ Ooops... Errore 404
+ +
+ Ci dispiace, ma la pagina che stai cercando non esiste.
+ +
+ Puoi andare al HOMEPAGE + +
+ + +

I NOSTRI ULTIMI POST

+ + + + + +
+
+
+
+ + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sites/superguidatv.it/superguidatv.it.channels.xml b/sites/superguidatv.it/superguidatv.it.channels.xml new file mode 100644 index 00000000..fc58eba3 --- /dev/null +++ b/sites/superguidatv.it/superguidatv.it.channels.xml @@ -0,0 +1,183 @@ + + + + Fox News + France 24 English + I24news + France 24 + 20 + Twenty Seven + Italia 7 Gold + ACI Sport Tv + Alma TV + Baby TV + Blaze + Bloomberg + Boing + Boing Plus + Boomerang + Boomerang + 1 + CNBC + CNN Intl + Caccia e Pesca + Canale 5 + Cartoon Network + CN +1 + Cartoonito + Cielo + Cine34 + Class-Cnbc + Classica HD + Comedy Central + Crime+ Inv. + DMAX + DeA Junior + DeAKids + DeAKids+1 + Deejay TV + Discovery Channel HD + Discovery Ch +1 + Discovery Science HD + DonnaTv + Euronews + Eurosport HD + Eurosport 2HD + Focus + FoodNetwork + Fox Business + Fox HD + Fox +1 + Frisbee + GM24 + Gambero Rosso HD + Giallo + HGTV - Home&Garden + History HD + History 1 + Horse TV HD + Inter TV HD + Iris + Italia 1 + Italia 2 + K2 + La 5 + La7 + La7d + Lazio Style Channel + MTV + Mtv Music + Mediaset Extra + Milan TV + Motor Trend HD + National Geo HD + NationalGeo +1 + National Geographic Wild + Nat Geo Wild +1 + Nick Junior + Nick Jr+1 + Nickelodeon + Nickelodeon + 1 + Nove + Pesca e Caccia + Premium Action + Premium Cinema 1 + Premium Cinema 2 + Premium Cinema 3 + Premium Crime + Premium Stories + QVC + R101 + La 1 + La 2 + RTL 102.5 TV + Radio 105 + Radio Freccia + Radio Italia Tv + Radio Monte Carlo + Radionorba TV + Rai 1 + Rai 2 + Rai 3 + Rai 4 + Rai 5 + Rai Gulp + Rai Movie + RaiNews24 + Rai Premium + Rai Scuola + RaiSport + Rai Sport + HD + Rai Storia + Rai Yoyo + Real Time + Rete 4 + Sky Arte HD + Sky Atlantic HD + Sky Atlantic +1 + Sky Cinema Action HD + Sky Cinema Collection HD + Sky Cinema Comedy HD + Sky Cinema Drama HD + Sky Cinema Due HD + Sky Cinema Due +24 + Sky Cinema Family HD + Sky Cinema Romance HD + Sky Cinema Suspense HD + Sky Cinema Uno HD + Sky Cinema Uno +24 + Sky Documentaries HD + Sky Documentaries +1 HD + Sky Investigation HD + Sky Investigation +1 HD + Sky Meteo24 + Sky Nature HD + Primafila 1 + Primafila 2 + Primafila 3 + Primafila 4 + Primafila 5 + Sky Serie HD + Sky Sport24 + Sky Sport Action HD + Sky Sport Arena + Sky Sport Calcio + Sky Sport F1 HD + Sky Sport Football HD + Sky Sport MotoGP + Sky Sport NBA + Sky Sport Tennis HD + Sky Sport Uno + Sky Tg24 + Sky Uno HD + Sky Uno +1HD + Sportitalia + Super! + SuperTennis + Tgcom24 + TG Norba24 + TRM h24 + TV2000 + TV8 + Top Calcio 24 + Top Crime + VH1 + Virgin Radio + Warner TV + + + + + + + + + + + + + + + + + + diff --git a/sites/superguidatv.it/superguidatv.it.config.js b/sites/superguidatv.it/superguidatv.it.config.js new file mode 100644 index 00000000..d71e8589 --- /dev/null +++ b/sites/superguidatv.it/superguidatv.it.config.js @@ -0,0 +1,122 @@ +const cheerio = require('cheerio') +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: 'superguidatv.it', + days: 3, + url({ channel, date }) { + let diff = date.diff(dayjs.utc().startOf('d'), 'd') + let day = { + 0: 'oggi', + 1: 'domani', + 2: 'dopodomani' + } + + return `https://www.superguidatv.it/programmazione-canale/${day[diff]}/guida-programmi-tv-${channel.site_id}/` + }, + parser({ content, date }) { + const programs = [] + const items = parseItems(content) + items.forEach(item => { + const $item = cheerio.load(item) + const prev = programs[programs.length - 1] + 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), + category: parseCategory($item), + start, + stop + }) + }) + + return programs + }, + async channels() { + const providers = [ + '', + 'premium/', + 'sky-intrattenimento/', + 'sky-sport/', + 'sky-cinema/', + 'sky-doc-e-lifestyle/', + 'sky-news/', + 'sky-bambini/', + 'sky-musica/', + 'sky-primafila/', + 'dazn/', + 'rsi/' + ] + const promises = providers.map(p => axios.get(`https://www.superguidatv.it/canali/${p}`)) + + const channels = [] + await Promise.all(promises) + .then(responses => { + responses.forEach(r => { + const $ = cheerio.load(r.data) + + $('.sgtvchannellist_mainContainer .sgtvchannel_divCell a').each((i, link) => { + let [_, site_id] = $(link) + .attr('href') + .match(/guida-programmi-tv-(.*)\/$/) || [null, null] + let name = $(link).find('.pchannel').text().trim() + + channels.push({ + lang: 'it', + site_id, + name + }) + }) + }) + }) + .catch(console.log) + + return channels + } +} + +function parseStart($item, date) { + const hours = $item('.sgtvchannelplan_hoursCell') + .clone() + .children('.sgtvOnairSpan') + .remove() + .end() + .text() + .trim() + + return dayjs.tz(`${date.format('YYYY-MM-DD')} ${hours}`, `YYYY-MM-DD HH:mm`, 'Europe/Rome') +} + +function parseTitle($item) { + return $item('.sgtvchannelplan_spanInfoNextSteps').text().trim() +} + +function parseCategory($item) { + const eventType = $item('.sgtvchannelplan_spanEventType').text().trim() + const [_, category] = eventType.match(/(^[^\(]+)/) || [null, ''] + + return category.trim() +} + +function parseItems(content) { + const $ = cheerio.load(content) + + return $('.sgtvchannelplan_divContainer > .sgtvchannelplan_divTableRow') + .has('#containerInfoEvent') + .toArray() +} diff --git a/sites/superguidatv.it/superguidatv.it.test.js b/sites/superguidatv.it/superguidatv.it.test.js new file mode 100644 index 00000000..64774f0c --- /dev/null +++ b/sites/superguidatv.it/superguidatv.it.test.js @@ -0,0 +1,67 @@ +// npm run channels:parse -- --config=sites/superguidatv.it/superguidatv.it.config.js --output=sites/superguidatv.it/superguidatv.it.channels.xml +// npx epg-grabber --config=sites/superguidatv.it/superguidatv.it.config.js --channels=sites/superguidatv.it/superguidatv.it.channels.xml --output=guide.xml --days=2 + +const { parser, url } = require('./superguidatv.it.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('2023-01-11', 'YYYY-MM-DD').startOf('d') +const channel = { + site_id: 'virgin-radio/461', + xmltv_id: 'VirginRadioTV.it' +} + +it('can generate valid url', () => { + expect(url({ channel, date })).toBe( + 'https://www.superguidatv.it/programmazione-canale/oggi/guida-programmi-tv-virgin-radio/461/' + ) +}) + +it('can generate valid url for tomorrow', () => { + expect(url({ channel, date: date.add(1, 'd') })).toBe( + 'https://www.superguidatv.it/programmazione-canale/domani/guida-programmi-tv-virgin-radio/461/' + ) +}) + +it('can generate valid url for after tomorrow', () => { + expect(url({ channel, date: date.add(2, 'd') })).toBe( + 'https://www.superguidatv.it/programmazione-canale/dopodomani/guida-programmi-tv-virgin-radio/461/' + ) +}) + +it('can parse response', () => { + const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8') + let results = parser({ content, date }) + results = results.map(p => { + p.start = p.start.toJSON() + p.stop = p.stop.toJSON() + return p + }) + + expect(results[0]).toMatchObject({ + start: '2023-01-11T01:00:00.000Z', + stop: '2023-01-11T05:00:00.000Z', + title: `All Nite Rock`, + category: 'Musica' + }) + + expect(results[13]).toMatchObject({ + start: '2023-01-12T05:00:00.000Z', + stop: '2023-01-12T05:30:00.000Z', + title: `Free Rock`, + category: 'Musica' + }) +}) + +it('can handle empty guide', () => { + const result = parser({ + date, + content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'), 'utf8') + }) + expect(result).toMatchObject([]) +})