Results 1 to 10 of 10
  1. #1
    Full Member c4's Avatar
    Join Date
    January 18th, 2005
    Posts
    488
    ... for those who need the script we talked about a few posts below (Is it possible ...).

    Basically it's just a quite simple CGI script which displays last few keywords (the number can be set) that were used to find your page ... (look at the post above for more info). It recognizes more than 20 Search Engines but you can easily add more to the data.

    Installation is very simple (requires CGI and SSI), all instructions are included in the script (for those who don't know: open it in a PLAIN text editor like Notepad or Wordpad, DO NOT use MS Word!). In case you have any troubles please post'em here as I will be away this week and probably won't have time replying to e-mails.

    The script displays a link to my site below the keywords (just a small font text "By YOURsoft"). I would be grateful if you would leave it there in exchange for this free script but if it bothers you that much you can just put a # at the beginning of the very last line of code.

    I hope you'll like it... Download keywords.zip here (4kb)

    Regards,
    c4



    YOURsoft - worlds 1st dealware scripts!
    NEW - Join YOURsoft "affiliate program for affiliate software"!

  2. #2
    Resident Genius and Staunch Capitalist Leader's Avatar
    Join Date
    January 18th, 2005
    Location
    Florida
    Posts
    12,817
    THANK YOU!

    It sounds great. I'm ecstatic at the thought of having things look "new" despite not touching anything except to install the script and put the little SSI line on the pages to call it.

    All those ancient pages of mine, Forever Young... [img]/infopop/emoticons/icon_biggrin.gif[/img] Nice!

    There is no knowledge that is not power.~~Ralph Waldo Emerson

  3. #3
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    2,082
    Is there any chance at all that google would ban a page for using this? If you have a shopping mall site would you have to place it on every page?
    Cazzie

  4. #4
    Full Member c4's Avatar
    Join Date
    January 18th, 2005
    Posts
    488
    So you like it, great [img]/infopop/emoticons/icon_smile.gif[/img]

    cazzie: No, there is no reason why Google would ban you for using this script, all it does is display keywords (key phrases) that were used to find your site! As for on how many pages you should add it - don't know, it's your call. I'll add it to all pages I know people come to from SE's.



    YOURsoft - worlds 1st dealware scripts!
    NEW - Join YOURsoft "affiliate program for affiliate software"!

  5. #5
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    2,082
    Thanks C4
    Stay tuned for more questions [img]/infopop/emoticons/icon_biggrin.gif[/img] I have never used any scripts before so I am sure I will have many.
    Thanks again
    Cazzie [img]/infopop/emoticons/icon_wink.gif[/img]

  6. #6
    Full Member
    Join Date
    January 18th, 2005
    Posts
    339
    C4,

    If I just wanted to capture the search phrases to the file for study, which lines would I comment out to stop the dynamic writing to the html document?

    Jim in Texas [img]/infopop/emoticons/icon_smile.gif[/img]

    Patriot, Army Type, One Each...
    USA - This We'll Defend

  7. #7
    Full Member c4's Avatar
    Join Date
    January 18th, 2005
    Posts
    488
    You'd leave all the lins like this:

    print LOG "...";

    comment all that just state
    print "...";

    BUT since there MUST be som sort of HTML output in order for CGI to work you will have to have some output - a 1x1 image best.

    So you would use < IMG src="path/to/script.cgi" >

    and change the script to:

    - DELETE everything below line (but leave this line)
    $phrase = "N" unless $phrase;

    PASTE this below that line:


    if ($phrase ne "N") {
    open(LOG, $log);
    @data=<LOG>;
    close(LOG);
    open(LOG, ">$log");
    flock(LOG,2) unless $flock eq "NO";
    $number=$number2save-2;
    print LOG "$phrase\n";
    for ($i=0; $i<=$number; $i++) {chomp $data[$i]; print LOG "$data[$i]\n";}
    close(LOG);
    }
    print "Location: http://www.server.com/path/to/transparent/image.gif \n\n";


    CHANGE the path to the image (it should be a 1x1 transparent gif).


    This should work but I didn't test it because I am going to a trip in about 2 hours and really don't have time!

    Good luck



    YOURsoft - worlds 1st dealware scripts!
    NEW - Join YOURsoft "affiliate program for affiliate software"!

  8. #8
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    United Kingdom
    Posts
    1,797
    I knew I should have kept that to myself... [img]/infopop/emoticons/icon_wink.gif[/img]

    Search Engine Positioning - 1 Design 4 Life

  9. #9
    ABW Ambassador CrazyGuy's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,463
    I have a simple version of this working, but what I haven't solved is how to make it work on a per-page basis. As it stands, the script (this one and mine) writes the keyword to a log file in the directory where the script is.

    Ideally, it should write a log file at a folder or page level.

    I'm sure this can be done, just not sure if I'm the best person to work it out - my effort:output ratio on perl is pretty poor!

    Stewart Hutton | Are you Crazy?

  10. #10
    ABW Ambassador CrazyGuy's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,463
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by CrazyGuy:
    Ideally, it should write a log file at a folder or page level.
    <HR></BLOCKQUOTE>

    OK, I've fixed this for one of my sites, so it might be useful to others. Major health warning - you probably need to know a bit about your server and paths (at a perl level) to make this work for you.

    In a nutshell, I defined the location of the logfile as:

    $log=$ENV{'DOCUMENT_URI'};
    $log =~ s/index.shtml/last_keywords.txt/;
    $log = "/full_path/up_to_where/document_uri_starts".$log;

    This reads the location of the file calling the script (DOCUMENT_URI). In my case, this is always index.shtml, so I swap that for the logfile name, and add the full path prefix so perl knows where the file goes.

    This results in a logfile being created specific to the subdir - which may be a category, manufacturer, etc. In this form, it only works for the index.shtml page, but I guess you could make it more general by swapping any file name for the logfile name.

    BTW - you will have to CHMOD any subdir you use this in to allow the script to write to the file.

    Maybe someone else can make this more user friendly - personally, I'm going to lie down for a while now ...

    Stewart Hutton | Are you Crazy?

  11. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Timezones coding
    By begabloomers in forum WebMerge (Fourthworld.com)
    Replies: 4
    Last Post: August 23rd, 2006, 07:44 PM
  2. Coding Help
    By daniell in forum Midnight Cafe'
    Replies: 1
    Last Post: February 9th, 2002, 01:36 PM
  3. Coding Help
    By daniell in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: February 9th, 2002, 01:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •