AmericaTV Script v.95b 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 from .906b or earlier: Delete every AmericaTV file in yours Samurize\scripts directory. Follow the instructions below.
If you are upgrading from .920b: Run the new config app and click uninstall. Then follow the instructions below.

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 will ask you to login once every few months to validate your subscription. 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. You should only select the channels you want, it will save bandwidth, time and memory.
  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".
    7. Trap unhandled errors
      This setting is on by default and should be left on unless you need exceptions to trickle out of the script; this is useful for debugging.
  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 one or two minutes. Note that this is not the interval that the script updates from the internet, just how often Samurize requests the script updates its text files.

    You should end up with four or five files in your AmericaTV folder:
    Your AmericaTV folder is located at:
    * A very easy way to access the "Application Data" folder from a My Computer window or a file open dialog is to just type "%APPDATA%" without the quotes in to the address bar or file name text box respectively and hit enter.
    * If you want to navigate to it the old fashioned way and can't see the "Application Data" folder in your user folder it is because it is hidden. You can either type it directly into the address bar in My Computer or enable viewing of hidden folders by clicking Tools > Folder Options > View and then checking "Show hidden files and folders".

    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 don't understand the last step/I need help configuring Samurize.
You'll need to understand Samurize basics of creating meters and configs. There is plenty of information in Samurize Visual Tutorial, Samurize 1.0.1 Visual Tutorial, and the forums.
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.

Uninstall

I hate programs that leave registry keys and other garbage around my system. AmericaTV is 100% uninstallable. Just click Uninstall in the config applet, then delete the applet itself, this readme, and the script.

Contact

If you have suggestions or questions, contact me at norxh@binnews.com. Please make sure that your question are about AmericaTV and not Samurize! I'm sorry I don't have time to answer all the emails asking how to make configs for Samurize.

Changes