npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tv-listings

v0.5.2

Published

tv-listings provides access to TV guide data for various cable and broadcast networks across the United States and Canada.

Downloads

8

Readme

TV Listings API client for node.js

tv-listings is a node.js TV Media api wrapper. It provides access to TV listings for various cable and broadcast networks across the United States and Canada.

Requirements

NOTE: The TV Media API limits usage to 500 queries per key per month. You can retrieve complete TV listings for multiple days in a single query, so this is not necessarily an issue. You'll just want to build your app with the mindset of retrieving a large dataset once and running sub-queries without going back to the API.

Installation

npm install tv-listings

Methods

  • getLineups: Available lineups (providers) for a specific postal/zip code.
  • getLineup: Channel information for a specific lineup.
  • getListings: TV listings for a particular lineup grouped by channel.
  • getListingsChrono: TV listings for a particular lineup in chronological order.
  • getStation: Information on a specific station (channel) including logo.
  • getStationListings: TV listings for a particular station (channel).

NOTE: The methods that retrieve TV listings can take some time to respond, depending on how large the result set is. I've noticed some issues requesting 3 or more days of listings across all channels in one query, but up to 2 days seems reliable.

NOTE: Every cable provider is not included, for example I've noticed Comcast and Fios are not listed while DirecTV and Dish are. I have Fios and use the Dish results. I'm sure there could be a few minor channel differences, but for widely broadcasted channels/shows it works fine.

Usage

Tutorial available here.


var tvAPI = require('tv-listings');
var tv = new tvAPI({
    apiKey: YOUR_TVMEDIA_KEY
});

tv.getLineups({ postalCode: "20001"}, function(err, results) {
    console.log(results);
});

tv.getLineup({ lineupID: "6076D" }, function(err, results) {
    console.log(results);
});

tv.getListings({ lineupID: "6076D", start: moment().format(), end: moment().add(1, 'days').format() }, function(err, results) {
    console.log(results);
});

tv.getListingsChrono({ lineupID: "6076D", sportEventsOnly: "true" }, function(err, results) {
    console.log(results);
});

tv.getStation({ stationID: "668" }, function(err, results) {
    console.log(results);    
});

tv.getStationListings({ stationID: "668" }, function(err, results) {
    console.log(results);
});

Sample Show Listing

{ 
	listDateTime: '2014-08-17 23:20:00',
    duration: '65',
    showID: '836963',
    seriesID: '136977',
    showName: 'Breaking Bad',
    episodeTitle: 'Bit by a Dead Bee',
    episodeNumber: '203',
    repeat: '0',
    new: '0',
    rating: 'TV14',
    captioned: '0',
    educational: '0',
    blackWhite: '0',
    subtitled: '0',
    live: '0',
    hd: '1',
    descriptiveVideo: '0',
    inProgress: '0',
    showType: 'Drama',
    year: '',
    guest: '',
    cast: 'Bryan Cranston, Anna Gunn, Aaron Paul',
    director: '',
    starRating: '0',
    description: 'Covering tracks means a less secure financial situation; the DEA have a break in the case.',
    league: '',
    team1: '',
    team2: '',
    event: null,
    location: '',
    showPicture: '21537.jpg',
    picture: 'http://api.tvmedia.ca/images/shows/21537.jpg' 
}

Sample Sports Listing

{ 
	listDateTime: '2014-08-17 20:00:00',
    duration: '180',
    showID: '101486',
    seriesID: '33461',
    showName: 'Football',
    episodeTitle: '',
    episodeNumber: '',
    repeat: '0',
    new: '0',
    rating: 'TVPG',
    captioned: '0',
    educational: '0',
    blackWhite: '0',
    subtitled: '0',
    live: '1',
    hd: '1',
    descriptiveVideo: '0',
    inProgress: '0',
    showType: 'Sports, Football',
    year: '',
    guest: '',
    cast: '',
    director: '',
    starRating: '0',
    description: 'Football.',
    league: 'NFL',
    team1: 'Denver Broncos',
    team2: 'San Francisco 49ers',
    event: 'Pre-season',
    location: 'Levi\'s Stadium, Santa Clara, Calif.',
    showPicture: '2580.jpg',
    picture: 'http://api.tvmedia.ca/images/shows/2580.jpg' 
}