Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Parsing Search Engine Keywords From Referral URL

Hello,

Does anyone know of any ASP.NET specific information on parsing the key terms from a referral URL for all the major search engines? Trying to display targeted ads dynamically based on the referral URL and am having difficulty finding resources on the subject that aren't years old and written in PHP or Perl.

Thanks
0
mskibbz
Asked:
mskibbz
1 Solution
 
AerosSagaCommented:
Just find the characters used to delimit the keywords and write a little parsing routine, you can use the php or pearl ones as examples or to find the delimitation characters.  Heres a little example of how to parse for delimited character pattern:

HttpContext.Current.User = New GenericPrincipal(User.Identity, Split(authTicket.UserData, ","))

This splits comma seperated values, you should easily be able to adapt this and use something like this for additional referrer information.

Response.Write("<TABLE><pre>")
If Not Request.UrlReferrer Is Nothing Then
   Response.Write("<TR><TD>Referer</td><td>" & Request.UrlReferrer.ToString() & "</td></tr><pre>")
Else
   Response.Write("<TR><TD>Referer</td><td>blind (no referer)</td></tr><pre>")
End If

Response.Write("<TR><TD>User Agent</td><td>" & Request.UserAgent() & "</td></tr><pre>")
Response.Write("<TR><TD>Host Address</td><td>" & Request.UserHostAddress.ToString & "</td></tr><pre>")
Response.Write("<TR><TD>Host Name</td><td>" & Request.UserHostName & "</td></tr><pre>")
Response.Write("</TABLE>")

Regards,

Aeros
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now