Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[RELEASED] Search Timer 1.2

Quote Reply
[RELEASED] Search Timer 1.2
HI,

I have updated this first posting rather than adding a new thread.

Search Timer 1.2 is now available and it works this time and has been tested.

Download it below.

http://odp.wiredon.net/cgi-bin/mail.cgi

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
Nice idea on how to share an 'always' current version of your plugin...

Unfortunately, because its in your admin, it is password protected. And I'm sure you don't want to be giving out your admin passwords....

AlexJ

Quote Reply
Re: Search Timer Plugin Released In reply to
lol true...

Alex is a plugin repositry coming soon????

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Search Timer Plugin Released In reply to
It's already here. We are still polishing it, but for now you can submit plugins for review and ones we deem to be safe, we'll happily put up on our server so that clicking on Show will list it.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Search Timer Plugin Released In reply to
Jeeeeeeez Im really sorry everyone....I submitted that post at 1.45am last night and I SO wasn't concerntrating.

I also forgot to tell you what tag you needed to add to your page to get it to work..

IM REALLY SORRY..............

OK it is fixed now........you still have to go to the same URL..mail.cgi but the link has been changed to a non password protected place.

The tag that shows the time is <%time%>

Let me know if you have any MORE trouble....lol

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
It was a bad idea giving you all the URL to a cgi script that sends me an email before you download 8(

I've had about 40-50 emails so far saying "Someone has downloaded the Search Timer"....I just hope it works for you all because I don't want 50 complaints!

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
Problem.
It's returning this for my time
-981587801.00

This is very strange.

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Search Timer Plugin Released In reply to
Hi,

Open up SearchTimer.pm and in sub Stop try removing "%.2f",

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
Now I get
-981600403
Notice its missing the .00

I think I discovered a conflict.
Doesn't <%time%> also display the current server time on the cgi pages?

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: Search Timer Plugin Released In reply to
Hi Paul,

Couple comments, you want:

use Time::HiRes qw/time/;

at the beginning of SearchTimer, otherwise you don't get the acurate times. You may want to do in your Install.pm in sub install:

eval { require Time::HiRes; };
if ($@) {
$Plugins::SearchTimer::error = "You must have the Time::HiRes module to use this plugin.";
return;
}

Also, to figure the total elapsed time, you want finish - start, not start - finish. ;)

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Search Timer Plugin Released In reply to
Eek...I was just using the code that you gave me :(

my $args = shift;
$args->{end_time} = time;
$args->{search_time} = sprintf ("%.2f", $args->{start_time} - $args->{end_time});
return $args;

Serves me right though...I should check it myself because you are busy and are only writing tips quickly.

I apologise again to everyone....

I can either scrap the plugin or fix it up and IT WILL WORK THIS TIME. What do you all think?

I have to admit that I was just in a rush to create some sort of plugin and it wasn't checked so I blame myself.

I can assure you that the Top10 Searches plugin WORKS.




Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
:(

I've done everything you said and have checked the code and I just can't see anything wrong, but I'm still getting....

94798465384.69

....or something like that.

Knowing me, I've probably missed something really obvious...here is the code I have.......


package Plugins::Timer;
# ==================================================================
use strict;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$IN $DB $TPL/;
use Time::HiRes qw/time/;

sub Start {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'search_results'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $args = shift;
$args->{start_time} = time;
return $args;
return CONTINUE;
}

sub Stop {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'search_results'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $args = shift;
$args->{end_time} = time;
$args->{search_time} = sprintf ("%.2f", $args->{end_time} - $args->{start_time});
return $args;
return CONTINUE;
}

# Always end with a 1.
1;




Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: Search Timer Plugin Released In reply to
Hi,

Sorry, that's my fault. You can't pass the start time through like that. You'll need to use a global instead. Try adding:

use vars qw/$START_TIME/;

and then in sub Start:

$START_TIME = time;

and then in sub Stop:

$args->{search_time} = sprintf("%.2f", time - $START_TIME);

Does that make sense?

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Search Timer Plugin Released In reply to
Well it's my fault really....I should learn some darn OO code.

Alex....don't know if this is a secret or not but I was wondering what your plugins script looks like...

http://www.gossamer-threads.com/perl/plugins.cgi?do=plugin

I was thinking about making a plugin to download my plugins from my site like you can do with the ones in your repository.

Using the existing example I have managed to get it to work except that it always gives a 404 error when I try to connect to my plugins page - ie.. Sorry, the plugins couldn't be retrieved because the plugins page couldn't be found.

I notice that you have used another port for your plugins page and it is blocked to the public so does this mean that it is a secret and you don't want people doing this kind of thing?

If it is ok please could you tell me how your plugins.cgi page is setup possibly as a private message...

I see you are using a few parameters such as p= and v= etc but whatever I try always gives a 404 ;(

Thanks a lot 8)

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: [RELEASED] Search Timer 1.2 In reply to
i installed the search timer but the times do not appaer on my webpages. any suggestions?

Quote Reply
Re: [RELEASED] Search Timer 1.2 In reply to
Read the "About" page in the Search Timer plugin menu.

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: [RELEASED] Search Timer 1.2 In reply to
I have version 1. How can I get the new version?
The version I have only has edit and unistall, it does not have an about.

Ken

Quote Reply
Re: [RELEASED] Search Timer 1.2 In reply to
You can get it here.......

ftp.wiredon.net/pub/gt/

Will be ready in 2 mins....

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: [PaulW] Search Timer 1.2 In reply to
Does this mod still exist? The links to download it don't seems to work.

Sean