AmericaTV Script v.920b by norxh

Features

Screenshot

Screenshot

Copying

Everything in this script is my own work. If you decide to use some code snippets from this script or modify it to suit another project, that is fine with me. Just let me know about it and give me credit where it is due.

Upgrading

If you are upgrading to 0.920b from any previous version: Delete every AmericaTV file in yours Samurize\scripts directory. Then run the included .reg to remove old AmericaTV settings from the registry. Follow the instructions below. You will not need to use reset.

Step-by-step

  1. Prepare: Time Zone
    First you should verify that you timezone settings are correct. Goto the Control Panel then open the Date and Time properties. Select the Time Zone tab, make sure your proper time zone is selected and that the box next to Automatically adjust clock for daylight saving changes is checked. Go back to the Date & Time tab. Make sure your time and date are still correct.
  2. Prepare: AntiScript
    Make sure you are not using any script blocking/antivirus software that will interfere with the scripts operation. Some people actually have this software and don't know it. Note, if you have Norton Antivirus, you may have script blocking. Double click the Antivirus icon in the system tray and disable script blocking if it is not already.
    If you have firewall software make sure Samurize's client.exe and config.exe get internet access.
  3. Zap2it Data Direct: Signup
    Click here. Click Sign Up. Accept the agreement and fill in your info and Submit. Use a real email address! They may ask you to login to their site periodically. For the certificate code use ZIYN-DQZO-SBUT. Click Add a lineup. Go through the process. On the last page you can select the channels you will want on your desktop and click finish.
  4. Script: Settings
    Run the configuration application "ConfigureAmericaTV.hta".
    1. Zap2It Data Direct user/pass
      Put in your Zap2it Data Direct user and password for the account you just setup. Wierd things can happen if these are wrong.
    2. Maximum future data fetch
      This is how far forward (in hours) the script will look for the next show. The default value should be fine. If you have a channel with very long shows, you may see next show reported as Unknown; then you should increase this number.
    3. Data to get per fetch
      This is how much data (in hours) the script will grab in each request when more data is needed.
    4. Truncate length of current/next show
      The number of characters at which the current title and next title are truncated respectively. Titles that are truncated will have ellipsis appended.
    5. Show channel number on the current show lines
      The channel number will be prepended to each line in the current show file.
    6. Show episode info
      This allows you to display the episode specific information if it is available. If you choose "on current show line", it will be appended to each line in the current show file, seperated from the title by a colon. If you choose "in another file", each episode title will be placed on a line in another file, "AmericaTV.meter-episode.txt".
  5. Samurize: Setup
    Move the script in to your Samurize scripts folder and add an Activescript meter and set the type to text. Select "AmericanTV.js" as the script, and "samurizeMain" as the function, then click test script. If all goes properly you should see some status messages, and in the end... "CreateMeters completed successfully." I recommend setting this Activescript to run about every 2 minutes.

    You should end up with four or five files in your AmericaTV folder:
    Your AmericaTV folder is located at:
    There are a million way you could set up your config to display tv data. To get started...
    1. Create text file meters for the -current and -next txt files.
    2. Set each of the two meters' 'number of lines' property to the number of channels you want to display.
    3. Create a text file meter for each channel and point them all to the -progress txt file.
    4. Set all the progress meters to progressbar or pie type and set their 'min' and 'max' values to 0 and 100 respectively.
    5. For each progress meter, set the 'number of lines' property to 1 and set the 'read line' property to number of one of your channels as they appear in your -current and -next txt files. I.e. The 3rd channel listed in current.txt will be line number 3 in the progress txt file.
  6. You: Enjoy!

Troubleshooting

I get an error/I'm not getting any data.
Are you sure about Steps 1 and 2? Is there any helpful messages in the Activescript output?
I get an error about MSXML.
I dont think anyone will have this problem; MSDN says that MSXML3.0 comes with all current versions of Windows. But just in case, try to download and run the MSXML 3.0 SP4 .msi file from Microsoft.
This isn't helping.
Send me an email (see the contact section). Make sure to put "Regarding AmericaTV" in the subject or the mail may be discarded; I get a lot of spam at this address and I don't go through it. Also, don't use words like penis, viagra, or anal. :)

Customizing Output

If you want to customize the output any further you will have to edit some basic JScript. It is not very difficult and you can find lots of information here. I have commented the section you will need to edit. It starts like this...
*createMeters function

You can find more information in the comments in the script. I tried to keep the createMeters function very easy understand (or at least more so than the rest of the script :).

FAQ

Where can I get a good set of channel logos?
The most complete icon set with consistent quality that I have found is the one from GUIFX.
How can I create the ring around the logo effect like in the screenshot?
You'll need to edit the logos in your favorite image editor so they are a nice circle shape and export them to 32bit PNGs. Then add the logos to your config with the Add 32bit PNG command on the Edit Graphics tab.
To turn your progress meters in to rings, set them to pie type and increase their Inner Radius properties to something around 80%. Then position them on top of the logos. Finally set the Start Angle property to 90 and the Sweep property to -360.

Contact

If you have suggestions or questions, contact me at norxh@binnews.com.

Changes