xmltv-parser
Library to parse XMLTV format
Last updated 4 years ago by nch3v .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install xmltv-parser 
SYNC missed versions from official npm registry.

Install

npm i xmltv-parser

Use

var XmltvParser = require('xmltv-parser');
var file = '/path/file';
var parser = new XmltvParser();

parser.onChannel = function(chan) {
  // channel local id
  console.log(chan.id);

  // channel names (usually only one)
  console.log(chan.names);
};

parser.onProgramme = function(prog) {
  // title & sub title
  console.log(prog.title);
  console.log(prog.subTitle);

  // channel local id
  console.log(prog.chan);

  // broadcast start & end
  console.log(prog.start, prog.end);

  // description
  console.log(prog.desc);

  // array of category
  console.log(prog.cat);

  // array of credited person as an object {name, role} where role can be actor, director, presenter, ...
  for(var c=0; c<prog.credits; c++) {
    console.log(prog.credits[c].name,': ', prog.credits[c].role);
  }
}

parser.parseFile(file);

Current Tags

  • 1.0.0                                ...           latest (4 years ago)

1 Versions

  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |