latest reactions

spider
One way is to google for page which cont …
andy
you can find this tool here http://andy. …
Tjarko
Eej Walker, that's pretty cool, I will c …
Walker
Thanks for posting your thoughts. I modi …
Albert
Thanks !! …

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

CF101 Archive: September 2007 Object Oriented PizzaJob Opening for ColdFusion Developer at Arizona State UniversityMy New Experience Getting ColdFusion Builder 2 Console WorkingCF101 Archive: February 2007 Data Table GatewaysJob Opening for Sr. ColdFusion Developer in CA/ San Fernando ValleyColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)Best wishes for the new FuseboxCF101 Archive: January 2007 Data Access ObjectsOpen Source Conference For CFML DevelopersSkype Blocking Web Services with IIS, ColdFusion & RailoCF101 Archive: October 2006 Five Cool Things with ColdFusionGenerate a tag cloud from an RSS feed with ColdFusionColdFusion MeetUp: Cloudy with a Chance of Tests, with Mike HenkeReminder - Adobe CookbooksCF101 Archive: September 2006 A first look at FusionDebug

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2012 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Get SEO keywords automatically from an article or page

I just finished a nice little function to get the "best" keywords for the page displayed in every website we build with our CMS. Below is an example, what you get is a list of the words that are mostly used in the given page and therefore the best to use as META keywords or tags in your page. At least if you like to be found on the contents of your page...

<cfsavecontent variable="txt">
A nice little piece of text with at least twice the word little in the text, and off course three times the word text ;-)
</cfsavecontent>

<cffunction name="getSEOWords" access="public" output="true">
    <cfargument name="content" required="true" type="string" />
    <cfset var lsStopWords = "stop wordlist in your language (google it)" />
    <cfset list = arrayToList(listToArray(REReplace(arguments.content, "[[:space:]]{2,}"," ", "all" ), " ")) />
    <cfset var stWords = structNew() />
    <cfset var lsTop = "" />
    <cfset var aSort = arrayNew(1) />
   
    <!--- Get a unique structure of words counted --->
    <cfloop list="#list#" index="value">
        <cfif !listFindNoCase(lsStopWords, value) && !isNumeric(value)>
            <cfset value = trim(value) />
            <cfif structKeyExists(stWords, value)>
                <cfset stWords[value] = stWords[value] + 1 />
            <cfelse>
                <cfset stWords[value] = 1 />
            </cfif>
        </cfif>
    </cfloop>
   
    <!--- Order the structure with words, first keys are the words with the most counts --->
    <cfset aSort = structSort(stWords, "numeric", "desc") />
   
    <!--- Get the first 15 words from the list, if the count is more than one. --->
    <cfloop from="1" to="15" index="i">
        <cfif stWords[aSort[i]] GT 1>
            <cfset lsTop = listAppend(lsTop, aSort[i]) />
        </cfif>
    </cfloop>

    <cfreturn lsTop />
</cffunction>

<cfoutput>
    #getSEOWords(txt)#
</cfoutput>

6409 viewed | 16 opinion(s)  | del.icio.us | Digg it | Tjarko @ 13/10/09 17:19 cet


Reactions:

Darren Walker wrote.... (mail)

Instead of just judging keywords by counting, why not use the Yahoo term extractor API (http://developer.yahoo.com/search/content/V1/termExtraction.html) - Pass it your content, it will return what is judges are the best keywords. It is a clever way of introspecting your content. If the keywords returned don't match what you think the content is about, then you should probably change your content.

14 October 2009 12:22 cet  

Tjarko wrote.... (site)

Hi Darren, txns, didn't know about that API. Will look into that.

14 October 2009 13:44 cet  

Mike Appenzellar wrote.... (mail)

I tried this and got "Local variable stWords on line 17 must be grouped at the top of the function body. " is this specfic to coldfusion 9?

10 December 2009 13:56 cet  

Tjarko wrote.... (site)

hi Mike,

My bad.. the following should be

<cfset list
<cfset var list

Then it will work :-)

10 December 2009 13:58 cet  

Sebastiaan wrote.... (site)

Hi Tjarko,

Would you suggest injecting meta-tags on the fly with cfhtmlhead per page using your code above? What would else be the use for this function?

25 January 2010 15:07 cet  

Tjarko wrote.... (site)

I would'nt use cfhtmlhead for anything ;-) The way we use it, is in the OnRequestEnd.cfm were we also strip all whitespace and set the title for the page. See this article http://www.mximize.com/strip-whitespace

25 January 2010 15:13 cet  

Download Keylogger wrote.... (mail)

Can you please suggest any tool for finding keywords related to title of article?

Keylogger Software
www.keylogger.in

09 May 2011 14:40 cet  

DVDSoft wrote.... (site)

nice sharing, thanks.

07 June 2011 11:18 cet  

flash recovery wrote.... (site)

It is useful post to get keywords and meta description from the article. Thanks for sharing it.

11 July 2011 14:26 cet  

video wrote.... (site)

good post, i think so.Thank you!

08 August 2011 9:49 cet  

kevin wrote.... (site)

Good Information Very nice post.

17 August 2011 8:42 cet  

audio converter wrote.... (site)

Very useful,thanks for sharing.

19 August 2011 8:09 cet  

Crona wrote.... (site)

thanks for your posting

03 September 2011 8:27 cet  

video converter wrote.... (site)

Very useful,thanks for sharing keep on going another one.You have gained a new reader.Thanks for the info.

27 September 2011 14:56 cet  

monitoring internet wrote.... (mail)

Its really a great post for SEO beginners and SEO Experts both.

mac parental control
http://www.keylogger.in

30 September 2011 13:06 cet  

video converter wrote.... (site)

Nice Post.

01 October 2011 4:22 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!