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

tvguide

v1.2.2

Published

Node module that auto-gets current (Dutch) tv show information

Downloads

5

Readme

nodejs - tvguide

[8-4-2015] Time fix... again

Since I've been quite active with my Pi home automation lately, I thought I'd finally tackle the still sketchy wait time calculation. The main issue wasn't the code so much as my Pi not being set to the correct timezone - although there may have been something wrong with the code (at the very least it's cleaner now).

If you're using Raspbian (or any kind of Linux, I suppose), check if your timezone is correct by typing

in your terminal. If this doesn't show the correct time AND timezone offset, do the following:

Make sure that after /zoneinfo/ you choose your correct location!

Description

tvguide is a Node.JS module that takes data from tvgids.nl and calls back with a list of new show information every time a new show starts. The module can be used to make a web app that provides real-time tv show information on the channels of your choice. Currently, only the running and next shows are listed. Maybe I will implement a full guide later.

Install

As always, use the npm package manager:

Next, include the module with a require at the top of your node server script

Below is the full reference, but for the trial-and-error users, the following snippet is all that is implemented in my own server.js:

The fun stuff

This NPM library is part of a bigger project - which is a universal remote/tv guide web app hosted on a Raspberry pi. The ingredients:

  • A Raspberry pi running Raspbian (will also test with ArchLinux)
  • Node.JS for Raspbian (see http://weworkweplay.com/play/raspberry-pi-nodejs/)
  • LIRC (definitely check out http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/; very clear information on the remote control part of the project - this is where i got 90% of my info from)
  • A simple IR-led cicuit (from the previous source: http://upverter.com/alexbain/f24516375cfae8b9/Open-Source-Universal-Remote/). I did, however, make some changes:
    • No resistor between the gpio pin and the base of the transistor
    • A current-limiting resistor of 5.6 Ohm between the source voltage and the emitter
  • To get you going, there is a small node.js script and basic HTML web-app provided in the 'example' folder. I am developing this seperately on https://github.com/jouweneel/tvguideRemote

Function reference

Channel list functions

The channel list is an array of numbers representing a TV channel.

Guide fields functions

The guide fields is an array of strings representing channel information (show name, start time, etc.) Channels are indexed 0,1,2,... in the order defined by the channel list (previous section).

Guide functions

The guide contains an updated version of all channels in the channel list. It contains the currently playing and the next show. For some reason, the Date() function in node doesn't always adjust for local timezone, so a function to adjust for the timezone is present.

Updater functions

The updater auto-updates the guide when new show information is available. In order to acces the guide as soon as it's updated.