Hello
Im making a command for my tv-use
The command takes two arguments: Program category + start-time  (using
from as a modifier between)
f.eks
"tv movies from 17"
The problem is that the site uses id-numbers for the various program-
categories. 1 = children-programs, 12 = movies etc. So I tried to
substitute the searchterms with numbers in my if/ else construction

The question: Can someone help me to sort out the if - else
construction so that it works (I know its not right...) For the moment
it responds only to the if statement

Here is the code

CmdUtils.CreateCommand({
name: "tv",
icon: "http://www.myspace.com/favicon.ico";,
preview: "(Category) from (time)  <br> <p> Categories: <br> <p> all
<br> children <br> science <br> movies <br> sports",
description: "Searches dagbladet.no for tv-program",
takes: {"keywords": noun_arb_text},
modifiers: {"from": noun_arb_text},

execute: function( keywords, modifiers ) {

var strKeyWords = keywords.text;
var strFrom = modifiers.from.text;

if (keywords.text = "movies") {
                        strKeyWords = 12;
      }
else if (keywords.text = "sports") {
                        strKeyWords = 4;
      }
else if (keywords.text = "children") {
                        strKeyWords = 1;
      }
else if (keywords.text = "science") {
                        strKeyWords = 2;
      }
else if (keywords.text = "all") {
                        strKeyWords = 0;
      }
/* Put together our search URL */

var strURL = "http://fredag.dagbladet.no/tv/index.html?kategori_id="; +
strKeyWords +
"&dag=0&fra_tid=" +
strFrom +
"&til_tid=5";

/* "fra" = from, "dag" = day, "til" = to, "tid" = time */

/* Open the URL in a new window or tab */
Utils.openUrlInBrowser( strURL );
}
});

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to