homepage Welcome to WebmasterWorld Guest from 54.204.243.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Links
Froggyman



 
Msg#: 634 posted 5:21 am on May 4, 2001 (gmt 0)

I have built a robot into my forum script that parses the message form for keywords and links them with relevent pages on the site. The script works fantastically and the number of pages viewed per visitor has risen considerably, BUT, words are often repeated in messages and thus links are repeated. How will search engines deal with this?

 

Brett_Tabke

WebmasterWorld Administrator brett_tabke us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 634 posted 11:58 am on May 4, 2001 (gmt 0)

It would be seen as machine generated spam I'm affraid. What language?

If perl, just map your words into an associative array for easy removal of the dupes.

@page = split(/ /,$page); #where $page = the page text.
foreach (@page) {
%words{$_}++;
}
#now the page words are in %words.

foreach $key (sort keys %words) {
$key ...do something with the word here for your link...
}

There are a bazillion ways to do it depending on your structure. I'd certainly get rid of the dupes.

Froggyman



 
Msg#: 634 posted 5:05 pm on May 4, 2001 (gmt 0)

Thanks Brett. I figured the extra links wouldn't help. Unfortunately, my script is a bit more complicated. For example, the word "script" could be linked to any number of pages depending on the context of the sentence. Manipulating the words would crush the algorithm I'm currently using.

Would a search engine see a difference between...

/search.html?foo1 or /search.html#foo1
/search.html?foo2 or /search.html#foo2

...even if they are both the same page? If they would see a difference then my solution would be vastly simplified.

Froggyman



 
Msg#: 634 posted 5:41 pm on May 4, 2001 (gmt 0)

Maybe this will help.

Here is the current code:
$message =~ s/ any words/ <a href="$link">any words<\/a>/g;

$message = entire variable from text input form
$link = link to keyword page
" any words" = parsed language in form($message)

Now lets say that there are three occurances of " any words" in $message. How would I change just the first occurance into a link and leave the rest alone?

theperlyking

10+ Year Member



 
Msg#: 634 posted 6:43 pm on May 4, 2001 (gmt 0)

Remove the global option (g)in the substitution.
i.e
$message =~ s/ any words/ <a href="$link">any words<\/a>/;

Froggyman



 
Msg#: 634 posted 7:46 pm on May 4, 2001 (gmt 0)

That worked PerlyKing! I now have a lean green forum machine :)

Now that the messages will be linked to relevent pages (automatically) on the site (without repetitive links) how do you (or others) think the search engine spiders will react?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved