Jump to content

Using computer time in description


Recommended Posts

Hi!

 

I would like to display on one of my mysterys something like "This mystery has been unsolved for X hours", where X is coluld be calculated from computers clock.

 

Since script are not allowed I find this difficult... is there any way to do this using html? It doesn't have to be a running timer; it's ok if the time is called when page is loaded.

Link to comment

Use a dynamic image instead. Kind of like the little geocaching banner showing your stats or like the one used for the Geocaching Rating System at http://www.ratethiscache.com

That sounds like a good idea, but it's a little bit outside anything i've done before... I would be thankful for any help and/or useful links :)

 

I found this, but I can't seem to make it work on a cache page. I tried using their "embed" option, instead of the one that puts javascript on the page, but it still doesn't show up on my test cache page.

 

All of the others I can find require javascript, except for one that uses iframes. But that one doesn't work on a cache page, either.

Link to comment

Use a dynamic image instead. Kind of like the little geocaching banner showing your stats or like the one used for the Geocaching Rating System at http://www.ratethiscache.com

That sounds like a good idea, but it's a little bit outside anything i've done before... I would be thankful for any help and/or useful links :)

 

I found this, but I can't seem to make it work on a cache page. I tried using their "embed" option, instead of the one that puts javascript on the page, but it still doesn't show up on my test cache page.

 

All of the others I can find require javascript, except for one that uses iframes. But that one doesn't work on a cache page, either.

 

Don't know if it'll work on a cache page but I wonder if there might be a counter Applet that you could put on the page.

Link to comment

Use a dynamic image instead. Kind of like the little geocaching banner showing your stats or like the one used for the Geocaching Rating System at http://www.ratethiscache.com

That sounds like a good idea, but it's a little bit outside anything i've done before... I would be thankful for any help and/or useful links :D

 

I found this, but I can't seem to make it work on a cache page. I tried using their "embed" option, instead of the one that puts javascript on the page, but it still doesn't show up on my test cache page.

 

All of the others I can find require javascript, except for one that uses iframes. But that one doesn't work on a cache page, either.

 

Don't know if it'll work on a cache page but I wonder if there might be a counter Applet that you could put on the page.

 

As far as I know, you can't put anything on a cache page other than links and images, not even iframes. Thats why I found the dynamic image idea interesting, but i simply don't know (yet) how to do that :) I actually saw a hit counter as image on a cache page, but haven't found anyone offering time counters that way...

Edited by harpix
Link to comment

As far as I know, you can't put anything on a cache page other than links and images, not even iframes. Thats why I found the dynamic image idea interesting, but i simply don't know (yet) how to do that :ph34r: I actually saw a hit counter as image on a cache page, but haven't found anyone offering time counters that way...

 

I found something that will count days, but not hours. And it's overloaded with cutesy graphics.

http://www.tickerfactory.com/ezticker/tick...gner.php?type=4

Link to comment

Use a dynamic image instead. Kind of like the little geocaching banner showing your stats or like the one used for the Geocaching Rating System at http://www.ratethiscache.com

That sounds like a good idea, but it's a little bit outside anything i've done before... I would be thankful for any help and/or useful links ;)

 

I found this, but I can't seem to make it work on a cache page. I tried using their "embed" option, instead of the one that puts javascript on the page, but it still doesn't show up on my test cache page.

 

All of the others I can find require javascript, except for one that uses iframes. But that one doesn't work on a cache page, either.

 

Don't know if it'll work on a cache page but I wonder if there might be a counter Applet that you could put on the page.

 

As far as I know, you can't put anything on a cache page other than links and images, not even iframes. Thats why I found the dynamic image idea interesting, but i simply don't know (yet) how to do that :ph34r: I actually saw a hit counter as image on a cache page, but haven't found anyone offering time counters that way...

 

I found a bit of code that'll create a dynamic PNG image and made some slight mods to it so that it'll display the current time. This took me about five minutes to get running. I'd show it here but the forum doesn't allow you to use a url for an images that is not a valid image extension.

 

Since someone recently posted a link to one of my caches here I'll use it to demonstrate:

 

Sky Watch

 

Note the image on the page which displays the current time. Wait and reload to watch it change. The code for this is very simple and wouldn't take much work to display the number of days or hours since a specified date/time.

Link to comment

As far as I know, you can't put anything on a cache page other than links and images, not even iframes. Thats why I found the dynamic image idea interesting, but i simply don't know (yet) how to do that :blink: I actually saw a hit counter as image on a cache page, but haven't found anyone offering time counters that way...

 

I found a bit of code that'll create a dynamic PNG image and made some slight mods to it so that it'll display the current time. This took me about five minutes to get running. I'd show it here but the forum doesn't allow you to use a url for an images that is not a valid image extension.

 

Since someone recently posted a link to one of my caches here I'll use it to demonstrate:

 

Sky Watch

 

Note the image on the page which displays the current time. Wait and reload to watch it change. The code for this is very simple and wouldn't take much work to display the number of days or hours since a specified date/time.

 

Now we're getting very close to what I was looking for :D I'm sure I can alter the code, but how do I get the code...? I've never worked with png before ;)

Link to comment

As far as I know, you can't put anything on a cache page other than links and images, not even iframes. Thats why I found the dynamic image idea interesting, but i simply don't know (yet) how to do that :blink: I actually saw a hit counter as image on a cache page, but haven't found anyone offering time counters that way...

 

I found something that will count days, but not hours. And it's overloaded with cutesy graphics.

http://www.tickerfactory.com/ezticker/tick...gner.php?type=4

 

Not exactly what I had in mind, but it does the job - I found graphics that wasn't to cute, and put in on the cache page - thank you very much! ;):D:D

Link to comment

I doubt you can achieve a "not found since" counter on your cache page. That would involve getting Groundspeak to update the cache page each time a find log was posted or to send that information out with the active content from their cache log servers. Googling "html clock" seemed to generate a few links that seemed interesting.

 

You might try searching the "Geocaching.com Web Site" forum to see if there is any information there.

Link to comment

I doubt you can achieve a "not found since" counter on your cache page. That would involve getting Groundspeak to update the cache page each time a find log was posted or to send that information out with the active content from their cache log servers. Googling "html clock" seemed to generate a few links that seemed interesting.

 

You might try searching the "Geocaching.com Web Site" forum to see if there is any information there.

 

See my response in post #8. The implementation that I created doesn't require any changes to the cache page one the img tag has been added. The src attribute url, rather than pointing to a static jpg, gif, or png image points to a simple php script which generates an image. The url never changes, but output of the php script will change depending on the current time. Modifying the script to achieve a "not found since" counter rather than the current time is simply a matter of setting a date for when the cache placed as a variable, get the current date, doing a little date math, and producing an image from that result. Of course, once the cache *is* found the cache page would have to be edited to remove the image.

Link to comment

I doubt you can achieve a "not found since" counter on your cache page. That would involve getting Groundspeak to update the cache page each time a find log was posted or to send that information out with the active content from their cache log servers. Googling "html clock" seemed to generate a few links that seemed interesting.

 

You might try searching the "Geocaching.com Web Site" forum to see if there is any information there.

 

See my response in post #8. The implementation that I created doesn't require any changes to the cache page one the img tag has been added. The src attribute url, rather than pointing to a static jpg, gif, or png image points to a simple php script which generates an image. The url never changes, but output of the php script will change depending on the current time. Modifying the script to achieve a "not found since" counter rather than the current time is simply a matter of setting a date for when the cache placed as a variable, get the current date, doing a little date math, and producing an image from that result. Of course, once the cache *is* found the cache page would have to be edited to remove the image.

 

This is probably way outside the abilities of the original poster, but you could make this happen, and fairly easily, if you know how to program. The magic recipe is this:

 

Find a way to email the log notification that Groundspeak sends to the cache owner to a script running on a web server. I would probably do this by setting up an email filter to forward geocaching emails to a gmail account, and use their GData API to read the email, but countless other options exist.

 

Once the script has the ability to access the emailed logs, write something to parse the email to determine if its a "Found It" log. If its a found it log, write the timestamp to a file. This is probably 10 lines of code.

 

Modify the image script that outputs the counter to read the timestamp from the file and modify the current date/time (basically current timestamp - last found timestamp).

 

Voila - a current "not found since" time for your page that auto updates and is as current as the email delay + the last time the update script ran - which could be automated to run as often as you like - say every 5-10 minutes.

Link to comment

As understand it, the OP wants a "this cache has not been found in X days" counter on the cache page. In order to implement this you would need to somehow find the time of the last find date somewhere in the HTML that is sent to the browser of perhaps an E-Mail. That information is available. I looked at the cache page requirements which state "You can use HTML in any of the description fields below with the exception of JavaScript and other embedded code. If you do supply HTML you will need to check the box below for the text to render correctly."

 

If you can't have scripts on your cache page it will have to be stored on a server elsewhere and linked to from your cache page. If you don't have your own server I don't think it can be done. A good hosting site I use is www.directnic.com

Edited by JohnX
Link to comment

I doubt you can achieve a "not found since" counter on your cache page. That would involve getting Groundspeak to update the cache page each time a find log was posted or to send that information out with the active content from their cache log servers. Googling "html clock" seemed to generate a few links that seemed interesting.

 

You might try searching the "Geocaching.com Web Site" forum to see if there is any information there.

 

See my response in post #8. The implementation that I created doesn't require any changes to the cache page one the img tag has been added. The src attribute url, rather than pointing to a static jpg, gif, or png image points to a simple php script which generates an image. The url never changes, but output of the php script will change depending on the current time. Modifying the script to achieve a "not found since" counter rather than the current time is simply a matter of setting a date for when the cache placed as a variable, get the current date, doing a little date math, and producing an image from that result. Of course, once the cache *is* found the cache page would have to be edited to remove the image.

 

This is probably way outside the abilities of the original poster, but you could make this happen, and fairly easily, if you know how to program. The magic recipe is this:

 

Find a way to email the log notification that Groundspeak sends to the cache owner to a script running on a web server. I would probably do this by setting up an email filter to forward geocaching emails to a gmail account, and use their GData API to read the email, but countless other options exist.

 

Once the script has the ability to access the emailed logs, write something to parse the email to determine if its a "Found It" log. If its a found it log, write the timestamp to a file. This is probably 10 lines of code.

 

Modify the image script that outputs the counter to read the timestamp from the file and modify the current date/time (basically current timestamp - last found timestamp).

 

Voila - a current "not found since" time for your page that auto updates and is as current as the email delay + the last time the update script ran - which could be automated to run as often as you like - say every 5-10 minutes.

 

If you look at my official title, according the our human resources database is reads: "Progammer/Analyst Specialist". However, my official job description is much longer and also includes "Technology Strategist" and "Systems Architect". As a technology strategist I am asked not only to evaluate technologies to determine what might be most appropriate for a specific problem but whether or not it even requires a technical solution.

 

For example, someone once asked me to write a rather robust application that provided a web interface with some pretty elaborate requirements so that they could dynamically update a portion of one web pages. I figured it might take at least a week to develop something that would satisfy all of the requirements and displayed the data they wanted in the specific format that they wanted. Since the data that was being displayed only changed four times a year my answer was, "Or, you could just create a static web page, then spend 10 minutes or so updating it four times a year. Since the web site will probably be redesigned in two years you'll only spend less than an hour and half to produce the same result compared the the 40 hours it would take a developer to create an automated solution."

 

While your solution is elegant it would just be a lot simpler to delete the image tag once the cache has been found.

 

BTW, I posted something in the Geocaching.com Web site forum asking the lackeys if the use of an img tag which used a url which pointed to a script would be acceptable. If it's okay with them I'll post the code that I used. It might also be useful for someone that wanted a count down timer for an event.

Link to comment

 

While your solution is elegant it would just be a lot simpler to delete the image tag once the cache has been found.

 

 

Indeed, If you are going for a one-time thing then sure. I didn't read the original post as just a counter for the first to find, but as a "been X days since last found. Your solution is the easiest way to accomplish that.

 

You gave your credentials, and they sound impressive. I have some of my own, but I work on a really really large scale systems. On the scale I work at automation is critical, so I tend to go for the automated solutions. I love to think of complex systems and turn them into simple models. Granted this is not that complex, but it is fun as it deals with a constrained system and interesting signals. Different worlds and different experiences lead to different solutions :laughing:

 

Plus its fun to get my geek on:)

Edited by debaere
Link to comment

 

While your solution is elegant it would just be a lot simpler to delete the image tag once the cache has been found.

 

 

Indeed, If you are going for a one-time thing then sure. I didn't read the original post as just a counter for the first to find, but as a "been X days since last found. Your solution is the easiest way to accomplish that.

 

You gave your credentials, and they sound impressive. I have some of my own, but I work on a really really large scale systems. On the scale I work at automation is critical, so I tend to go for the automated solutions. I love to think of complex systems and turn them into simple models. Granted this is not that complex, but it is fun as it deals with a constrained system and interesting signals. Different worlds and different experiences lead to different solutions :laughing:

 

Plus its fun to get my geek on:)

 

I was at a conference a few years ago and saw what I still consider to be the best keynote speech that I've seen, from a self-described geek. He said, "I have long hair. I'm overweight, and I don't dress well. I'm a geek." When talking about developing software to solve a problem he said, "If you ask a programmer whether or not a program should be written to solve a problem the answer is always going to be yes."

 

I also work in a somewhat large enterprise (a university with about 19,000 students and 9000 staff/faculty) and have developed a few enterprise scale applications. I just try to be cognizant about applying the appropriate technology for the scale of the problem.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...