I'm trying to edit a script to give me a customized tab in Firefox. I want the tab to automatically open a specific Google search of tv.com to give me only the shows that will be on today. Here's what I've got:
Here's the result it gives me in Google (yes I know it's hacky, but I'm not particularly skilled in JS, and this is just for fun anyways):
Your search - site:www.tv.com "Airs: 5/13/9" - did not match any documents.
I need the date search to append leading zeros if the month, day, or year is a single digit; I've seen multiple ways to append leading zeros, but I don't really know how to integrate them into this script to make it work. Does anyone have any suggestions?
Do I simply paste this whole block into the URL bar just as I do with my script?
No, just really only need the function.
Pass the 'info' to it from where ever your date is supplied.
Note, the function could be modified further if you always get a "new Date()"
instead of reading from a text box as in the example. The example allows you
to try different inputs that you might receive to test for correct actions.
How you use the function depends upon your needs.
Your example code doesn't supply enough information for me to advise.
In your example, you can only supply the current date so I not sure how
you are going to specify different dates and air times.
The idea is specifically to get the current date. My problem is that I'm not a JS coder...I write Java, HTML, CSS, etc, etc. All I want is this one script, because I want to be able to search the tv.com site on any given day specifically for the new tv shows.
You said to put the function into the script; when I do so (and I'm not at all sure I'm doing it correctly), the script doesn't work when I paste it into the URL bar. Here's what I'm pasting in:
If yes, none of the solutions I have provided have been designed with that in mind.
And, if so, your original request is not very clear on that point.
I thought you have been trying to create a website with the link to the TV search
being updated every day that you enter into the site. Save the last script file
and execute it with your browser pointing to the saved file. It works fine then.