 |

02-06-2006, 09:33 PM
|
 |
SEO
|
|
Join Date: May 2005
Location: England, UK
Posts: 621

|
|
ASP solution for Keyword Tool using Yahoo Search Marketing
Hello all!
I've been hard at work writing little bits of code and I thought I would share a handy function I wrote to extract keyword data from Yahoo Search Marketing. It retrieves up to 100 related keyword terms, plus the number of times search on per day in the previous month.
I've configured the URL on this function to get UK based results, but if you want data for different locations, the URL accepts the same parameters as the Yahoo Search API.
e.g.
mkt=us
lang=en_us
I hope some of you will find it useful:
Code:
<%
Function GetKeywords(Term)
URL = "http://inventory.overture.com/d/searchinventory/suggestion/?mkt=uk&lang=en_gb&term=" & server.URLEncode(Term)
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", URL, False
objXMLHTTP.Send
html = objXMLHTTP.responseText
html = lcase(html)
Length = Len(html)
TheStart = InStr(1, html, "<table border=0 cellpadding=1 cellspacing=0 bgcolor=#ffffff width=270>")
IF TheStart > 0 THEN
Keywords = mid(html,TheStart,Length - TheStart)
TheStart = InStr(1, Keywords, "<tr bgcolor=#333333>")
Total = Split(keywords,"<tr")
TotalSize = Ubound(Total) - 2
Dim KeyArray
ReDim KeyArray (TotalSize, 2)
CountStart = InStr(1, Keywords, "> ") + 7
CountEnd = InStr(CountStart,Keywords, "</td>")
Keycount = mid(keywords, CountStart, CountEnd - CountStart)
KeyArray(0, 0) = Keycount
Keywords = replace(keywords, "e8e8e8> ", "#000000>")
KeyStart = InStr(CountEnd, Keywords, "#000000>") + 8
KeyEnd = InStr(KeyStart, Keywords, "</a>")
Keyphrase = Mid(Keywords,KeyStart, KeyEnd - KeyStart)
KeyArray(0, 1) = Keyphrase
FOR x = 1 TO TotalSize - 1
CountStart = InStr(KeyEnd, Keywords, "> ") + 7
CountEnd = InStr(CountStart,Keywords, "</td>")
Keycount = mid(keywords, CountStart, CountEnd - CountStart)
KeyArray(x, 0) = Keycount
KeyStart = InStr(CountEnd, Keywords, "color=#000000>") + 14
KeyEnd = InStr(KeyStart, Keywords, "</a>")
Keyphrase = Mid(Keywords,KeyStart, KeyEnd - KeyStart)
KeyArray(x, 1) = Keyphrase
NEXT
GetKeywords = KeyArray
exit function
ELSE
GetKeywords = False
END IF
End Function
%>
You can see it in action on our site if you click to use the free meta check from our home page.
Comments and suggestions would be most welcome!

|

02-07-2006, 01:46 AM
|
 |
SEO
|
|
Join Date: Feb 2005
Location: C:\Norway
Posts: 122
|
|
Nice, thank's for sharing. BTW, I haven't been messing around with API-stuff, are you running this with your API, or are you running the solution without API?
BTW, if you don't have it, and wan't a Server Header checker like http://www.i-partner.no/tools/sjekk-server-header.asp just let me know. Only drawback with the solution is the need for running through anonymous proxy (if not some pages will throw an error), and I'm running it through some free proxies now (and these ip's lasts only a few days).
Last edited by Mano70 : 02-07-2006 at 01:57 AM.
|

02-07-2006, 04:21 AM
|
 |
SEO
|
|
Join Date: May 2005
Location: England, UK
Posts: 621

|
|
Hi Mano70!
Ah well, I do like to share. I have written some really nice rank checking pages with the search APi's of Google, MSN, and Yahoo (and now integrated the a PageRank checker thanks to you!). This solution isn't using the API's though as there's currently no support or access to this information from the API's, although Google and Yahoo are working to offer that very soon.
Did you try out the meta data checker? I've integrated it with the keyword tool. It will extract the title, description and keywords from any url, and turn the keywords into clickable links into the keyword tool so that you can check if you chosen your keywords wisely. It's pretty cool, if I say so myself.
Can I ask a silly question? Whats a server header checker? Um... and what would it be for? Sorry - I've never heard of the term. But I'm keen to have a look if it's likely to be useful.

|

02-07-2006, 05:34 AM
|
 |
SEO
|
|
Join Date: Feb 2005
Location: C:\Norway
Posts: 122
|
|
|
Last edited by Mano70 : 02-07-2006 at 02:08 PM.
|

02-07-2006, 09:50 PM
|
 |
SEO
|
|
Join Date: May 2005
Location: England, UK
Posts: 621

|
|
Ahaaa!
Well, the function basically returns a two dimsional array with 2 values.
The first being the number of searches per keyword term, the other being the related keywordterms.
All you have to do is call the function by passing it the keyword term you want to check first.
e.g.
resultArray = GetKeywords("search engine optimisation")
Now you'll have all the information you want stored in 'resultArray'.
So you could do whatever you want with that - all I do is output it in a table.

|

02-07-2006, 10:41 PM
|
 |
SEO
|
|
Join Date: Feb 2005
Location: C:\Norway
Posts: 122
|
|
|
That was what I thought, but it only throws out the error Response object, ASP 0106 (0x80020005) > An unhandled data type was encountered which is why I had to ask. Sorry to bother you, have only tried it locally for "fun", but do you have any idea about what's causing the error?
|

02-08-2006, 03:34 PM
|
 |
SEO
|
|
Join Date: May 2005
Location: England, UK
Posts: 621

|
|
|
Are you running it on Windows XP with IIS installed? If so - thats why.
You should be able to get around the problem by installing MS XML 3.0 (or later). If you install the .Net framework version 2.0, it should install everything you need.
If you are running it on a windows server, then maybe best if you contact me directly through our website. My direct email is mark@ you know where .com
|
 |
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|