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.