TV Calendar Reloaded v2.20
Changelog:
- Fixed: Changing the @include in v2.19 actually stopped the script from working anywhere but the homepage (i.e. all other months but the current one would no longer work).
- Added: New showSearchAlias array. Some shows may show up different on TV Calendar than they do on ezRSS (TV Calendar displays Law & Order: SVU, ezRSS displays Law & Order: Special Victums Unit). This new array can hold the TV Calendar version of the show name and the ezRSS version of the show name. If some shows like the Law & Order: SVU have this difference, you can add them to the new showSearchAlias array.
Detailed Description:
A problem was pointed out by a user that existed with the ezRSS search link. There is a discrepancy between the show name displayed by Calendar for TV and ezRSS. Shows like Law & Order: SVU are actually displayed as Law & Order: Special Victims Unit on ezRSS. What this means is the ezRSS search link my script would produce would insert the show name Law & Order: SVU, which would yield no results on ezRSS. A secondary problem was also found where instead of the ampersand sign (&) the script would retrieve (&) which is the HTML code for the ampersand used in order for the actual symbol to be displayed on the webpage. For this and the problem before I came up with a few fixes. To fix the ampersand symbol a new HTMLSymbol "class" was made consisting of two variables. html represented the HTML code (e.g. &) and symbol represented the actual symbol (e.g. &):
function HTMLSymbol ()
{
this.html = "";
this.symbol = "";
}
On startup a new array would be created of type HTMLSymbol and populated:var htmlNameToSymbol = new Array(); htmlNameToSymbol[htmlNameToSymbol.length] = new HTMLSymbol(); htmlNameToSymbol[htmlNameToSymbol.length - 1].html = "&"; htmlNameToSymbol[htmlNameToSymbol.length - 1].symbol = "&";From there just after the show name is retrieved a for loop would run and replace all HTML codes that should really be symbols:
for (k = 0; k < htmlNameToSymbol.length; k++)
{
showName = showName.replace(htmlNameToSymbol[k].html, htmlNameToSymbol[k].symbol);
episodeName = episodeName.replace(htmlNameToSymbol[k].html, htmlNameToSymbol[k].symbol);
}
To fix the first problem of different show names I used a very similar method to the above problem. Firstly I created a ShowSearchAlias "class" with two variables. tvCalendar which is the show named displayed by Calendar for TV and search which is the show name displayed by ezRSS:
function ShowSearchAlias ()
{
this.tvCalendar = "";
this.search = "";
}
Again on startup a new array is created of type ShowSearchAlias and populated with shows with name discrepancies:
var showSearchAlias = new Array() showSearchAlias[showSearchAlias.length] = new ShowSearchAlias(); showSearchAlias[showSearchAlias.length - 1].tvCalendar = "Law & Order: SVU"; showSearchAlias[showSearchAlias.length - 1].search = "Law & Order: Special Victums Unit"; showSearchAlias[showSearchAlias.length] = new ShowSearchAlias(); showSearchAlias[showSearchAlias.length - 1].tvCalendar = "Law & Order: CI"; showSearchAlias[showSearchAlias.length - 1].search = "Law & Order: Criminal Intent";Then it's a simple matter of running a for loop and replacing the show name from Calendar for TV with the show name for ezRSS:
for (var i = 0; i < showSearchAlias.length; i++)
{
if (showSearchAlias[i].tvCalendar == showName)
{
showName = showSearchAlias[i].search;
break;
}
}
ThanksTV Calendar Reloaded Now a multi tool for www.pogdesign.co.uk/cat. Cleans up the website removing links and text, adds torrent search links and formatted file names for each episode for easy copy and renaming.






