|
|
 |
RE: FN-FORUM ASP Question - Simple I hope.
date posted 17th January 2002 15:01
OK Matthew,
You've tempted me... I've looked at the references I've looked at Dave's and
Jon's code and I am finding this a very useful tutorial... NOW let's see how
the expert would code the problem then!
Mark Anderson
01202 775483
07802 404838 mob
Web Development and database design
[EMAIL REMOVED]
http://www.anderson.uk.com
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] Behalf Of Matthew Reynolds
Sent: 17 January 2002 13:17
To: [EMAIL REMOVED]
Subject: RE: FN-FORUM ASP Question - Simple I hope.
I take it the reason why you're constructing a Dictionary from the
querystring values is for debugging? You know that in production, you'd use
Request.QueryString to get the values back, right?
I'm still not happy with the scalability of this solution. Opening and
parsing the XML file per request would be wrong! This kind of thing with
classic ASP is a nightmare. I seem to remember as well that loading
Dictionary objects into the Application variables (under no circumstances do
this in Session!) causes horrible threading problems in ASP and would
further complicate the problem.
I think this is a great demonstration of how to solve the problem, but in my
opinion it's unworkable in anything other than a very small, very very low
traffic site.
Not wishing to seem overly cocky, but I do have some qualification in this
area:
http://www.amazon.com/exec/obidos/search-handle-url/index=books&field-author
=Reynolds%2C%20Matthew/103-9193137-3786237
http://www.asptoday.com/authors/author.asp?AuthorsID=310
...I just don't want you running into a major scalability problem! =)
Cheers,
Matthew
-----Original Message-----
From: [EMAIL REMOVED]
[EMAIL REMOVED] Behalf Of Jon Boyce
Sent: 17 January 2002 11:35
To: [EMAIL REMOVED]
Subject: Re: FN-FORUM ASP Question - Simple I hope.
OK, I've created a small asp page and XML file which I've attached to this
post. I hope we're allowed to attach files :P
Note: On line 44 we assign a dictionary value and key, this key and value
will be URL encoded. So you will need to write a routine to covert those
back to plain text. Sorry for leaving this out, but I'm snowed under with
some big projects.
I've also left alot of the error checking routines out. I wanted to leave
you some work. :P
Jon Boyce
Web Designer/Developer
[EMAIL REMOVED]
----- Original Message -----
From: "Jon Boyce" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Thursday, January 17, 2002 9:52 AM
Subject: Re: FN-FORUM ASP Question - Simple I hope.
> Instead of using a huge 'Select Case'. You could use an XML file to define
> the differences in the search engines query strings. For example, you
could
> create an element like this.
>
>
> google.yahoo.com
> p
>
>
>
> www.google.com
> q
>
>
>
> In your asp script you select the XML node that has a text element
matching
> the specified domain and use the keywords element to know which key/value
to
> extract from the query string.
>
> With a 'little' coding this could be implemented quite well.
>
>
> Jon Boyce
> Web Designer/Developer
> [EMAIL REMOVED]
>
>
>
> ----- Original Message -----
> From: "David Eckersall" [EMAIL REMOVED]
> To: [EMAIL REMOVED]
> Sent: Thursday, January 17, 2002 1:35 AM
> Subject: Re: FN-FORUM ASP Question - Simple I hope.
>
>
> > grab the querystring part of the url via the relevant server variable
> (think
> > it is just QUERYSTRING), then check which search engine it came from via
> the
> > referer url and do a relevant pattern match using the regexp object.
have
> a
> > gander on 4guys if you havent used the regexp before - id type some out
> but
> > i cant remember it offhand and i need some sleep :)
> >
> > this will retrieve the querystringname=keywords, you then just do a
> mid(str,
> > x,y) with str being the value of a match, x being the position of the
> > '='(you might have to add 1 in order not to have the equals sign
attached)
> > and y being the length of the string.
> >
> > if you're planning on using the results for a lot of different search
> > engines expect a looong time coding the biggest select case statement
> known
> > to man!
> > ----- Original Message -----
> > From: "Jonathan Irvine" [EMAIL REMOVED]
> > To: "FREELANCERS" [EMAIL REMOVED]
> > Sent: Wednesday, January 16, 2002 6:35 PM
> > Subject: FN-FORUM ASP Question - Simple I hope.
> >
> >
> > > Evening all, and happy new year to all that remember me. Hope you a
good
> > > one!
> > >
> > > Something's been really annoying me for a few hours and I thought I'd
> see
> > if
> > > any of you people could help me.
> > >
> > > I have a small, very simple, script on an ASP page that gets the
> referrer
> > > URL and if that referrer is a specified search engine displays which
one
> > on
> > > the web page. I also need to extract a little information from the
> > referring
> > > url about what keywords were used to find the site.
> > >
> > > Since all search engines have the keywords in their querystrings,
which
> in
> > > turn are part of the referring url I need a method of taking them out
> and
> > > displaying them.
> > >
> > > I hope everyone is following.......here's an example.
> > >
> > > 1. Somebody searches for 'dustnet york' on yahoo....
> > > 2. they are taken to this page:
> > > http://google.yahoo.com/bin/query?p=dustnet+york&hc=0&hs=0
> > > 3. The person click the link to http://www.york.dustnet.co.uk and are
> > taken
> > > there
> > >
> > > 4. The script gets the URL referrer
> > > (http://google.yahoo.com/bin/query?p=dustnet+york&hc=0&hs=0, as above)
> > > 5. It then recognises the url from yahoo, and sets a variable
> SearchEngine
> > =
> > > Yahoo
> > >
> > > 6. Now this is what I can't do.....It then extracts the keywords from
p=
> > and
> > > sets them as a variable KeyWords = "dustnet+york"
> > >
> > > If the original search engine were google, it would have a referring
url
> > of
> > > http://www.google.com/search?hl=en&q=dustnet+york and would extract
the
> q=
> > >
> > > Basically. How do I go from a string to just the p=, q= (o s=, query=
> for
> > > other search engines)
> > >
> > > Cheers,
> > >
> > > Jon
> > >
> > >
> > > ============================================================
> > > = Get your message here for as little as £1 per week =
> > > = =
> > > = http://www.freelancers.net/cgi/sponsor.cgi?action=show =
> > > ============================================================
> > >
> > > * Free listing for freelancers
> > > * Free to advertise jobs
> > > * Free jobs distribution service
> > > * Free database of 5000 freelancers
> > >
> > > Freelancers and Freelance Jobs:
> > > http://www.freelancers.net
> > >
> > > Forum FAQs:
> > > http://freelancers.netrickery.com
> > >
> > > To unsubscribe please email:
> > > [EMAIL REMOVED]
> > >
> > > If you have difficulties unsubscribing please email:
> > > [EMAIL REMOVED]
> >
> >
> > ============================================================
> > = Get your message here for as little as £1 per week =
> > = =
> > = http://www.freelancers.net/cgi/sponsor.cgi?action=show =
> > ============================================================
> >
> > * Free listing for freelancers
> > * Free to advertise jobs
> > * Free jobs distribution service
> > * Free database of 5000 freelancers
> >
> > Freelancers and Freelance Jobs:
> > http://www.freelancers.net
> >
> > Forum FAQs:
> > http://freelancers.netrickery.com
> >
> > To unsubscribe please email:
> > [EMAIL REMOVED]
> >
> > If you have difficulties unsubscribing please email:
> > [EMAIL REMOVED]
> >
>
>
> ============================================================
> = Get your message here for as little as £1 per week =
> = =
> = http://www.freelancers.net/cgi/sponsor.cgi?action=show =
> ============================================================
>
> * Free listing for freelancers
> * Free to advertise jobs
> * Free jobs distribution service
> * Free database of 5000 freelancers
>
> Freelancers and Freelance Jobs:
> http://www.freelancers.net
>
> Forum FAQs:
> http://freelancers.netrickery.com
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
============================================================
= Get your message here for as little as £1 per week =
= =
= http://www.freelancers.net/cgi/sponsor.cgi?action=show =
============================================================
* Free listing for freelancers
* Free to advertise jobs
* Free jobs distribution service
* Free database of 5000 freelancers
Freelancers and Freelance Jobs:
http://www.freelancers.net
Forum FAQs:
http://freelancers.netrickery.com
To unsubscribe please email:
[EMAIL REMOVED]
If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
|
 |
|