<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Parse search keywords from referrer</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/</link>
	<description></description>
	<lastBuildDate>Tue, 10 Jan 2012 01:21:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: RaulentRoi</title>
		<link>http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/comment-page-1/#comment-8874</link>
		<dc:creator>RaulentRoi</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/#comment-8874</guid>
		<description>Thank you goddess for this code. It works just fine and I couldn&#039;t have done it without you.

I did have a couple of problems with it having to do with French accents. And also I chose to clean the keywords when some unwanted characters were in it, like dots or commas. I also eliminated all the one letter words. This is what it turned out like (This is a rough looking code, but I &#039;m just a beginner):

//*First I query the referrals URLs in my data base, which I name URLJustvisited

&#036;URLJustVisited = mysql_result(&#036;result,&#036;i,&quot;URLJustVisited&quot;);
&#036;keywords = ExtractKeywords(&#036;URLJustVisited);
foreach (&#036;keywords as &#036;value) {
if (&#036;keywords != &quot;&quot;) {

//*Now I clean up the unwanted characters - it may seem strange to replace a character by itself, but it does have an effect on the outcome 
&#036;value1 = str_replace(&quot;+&quot;, &quot; &quot;, &#036;value);
&#036;value2 = str_replace(&quot;-&quot;, &quot;&quot;, &#036;value1);
&#036;value3a = str_replace(&quot;qu&#039;&quot;, &quot;&quot;, &#036;value2);
&#036;value3b = str_replace(&quot;d&#039;&quot;, &quot;&quot;, &#036;value3a);
&#036;value3c = str_replace(&quot;l&#039;&quot;, &quot;&quot;, &#036;value3b);
&#036;value3d = str_replace(&quot;n&#039;&quot;, &quot;&quot;, &#036;value3c);
&#036;value3e = str_replace(&quot;m&#039;&quot;, &quot;&quot;, &#036;value3d);
&#036;value3f = str_replace(&quot;j&#039;&quot;, &quot;&quot;, &#036;value3e);
&#036;value3g = str_replace(&quot;t&#039;&quot;, &quot;&quot;, &#036;value3f);
&#036;value3h = str_replace(&quot;&#039;&quot;, &quot;&quot;, &#036;value3g);
&#036;value4 = str_replace(&quot;é&quot;, &quot;é&quot;, &#036;value3h);
&#036;value5 = str_replace(&quot;Ã©&quot;, &quot;é&quot;, &#036;value4);
&#036;value6 = str_replace(&quot;â&quot;, &quot;â&quot;, &#036;value5);
&#036;value7 = str_replace(&quot;ç&quot;, &quot;ç&quot;, &#036;value6);
&#036;value8 = str_replace(&quot;Ã§&quot;, &quot;ç&quot;, &#036;value7);
&#036;value9 = str_replace(&quot;è&quot;, &quot;è&quot;, &#036;value8);
&#036;value10 = str_replace(&quot;Ã¨&quot;, &quot;è&quot;, &#036;value9);
&#036;value11a = str_replace(&quot;:&quot;, &quot;&quot;, &#036;value10);
&#036;value11b = str_replace(&quot;.&quot;, &quot;&quot;, &#036;value11a);
&#036;value11c = str_replace(&quot;;&quot;, &quot;&quot;, &#036;value11b);
&#036;value11d = str_replace(&quot;,&quot;, &quot;&quot;, &#036;value11c);
&#036;value12 = str_replace(&quot;&#092;&quot;&quot;, &quot;&quot;, &#036;value11d);
&#036;value13 = str_replace(&quot; &quot;, &quot; &quot;, &#036;value12);
print &quot;&#036;value13&lt;br&gt;&quot;;

//*Now I clear all one letter results since they are not keywords

if (strlen(&#036;value13) &gt; 1) {

//********************************
//*Now I proceed with the insert - update database with &#036;value13

I had a problem while inserting into DataBase: A &quot;duplicate entry warning&quot; (on die), despite the fact that I querried to make sure that &#036;value did not already exist prior to attempt to insert it in the database. 

Why this happens is still a mystery to me. I went around it by disabling the &quot;OR die&quot; which is not a big problem for my usage since it concerns a very few words that are very unlikely to require analysis.

Finally, I added a delete command to get rid of a bunch of words that are not keywords (the, this, at, for ....). 

Thanks again.
</description>
		<content:encoded><![CDATA[<p>Thank you goddess for this code. It works just fine and I couldn&#039;t have done it without you.</p>
<p>I did have a couple of problems with it having to do with French accents. And also I chose to clean the keywords when some unwanted characters were in it, like dots or commas. I also eliminated all the one letter words. This is what it turned out like (This is a rough looking code, but I &#039;m just a beginner):</p>
<p>//*First I query the referrals URLs in my data base, which I name URLJustvisited</p>
<p>&#36;URLJustVisited = mysql_result(&#36;result,&#36;i,&#034;URLJustVisited&#034;);<br />
&#36;keywords = ExtractKeywords(&#36;URLJustVisited);<br />
foreach (&#36;keywords as &#36;value) {<br />
if (&#36;keywords != &#034;&#034;) {</p>
<p>//*Now I clean up the unwanted characters &#8211; it may seem strange to replace a character by itself, but it does have an effect on the outcome<br />
&#36;value1 = str_replace(&#034;+&#034;, &#034; &#034;, &#36;value);<br />
&#36;value2 = str_replace(&#034;-&#034;, &#034;&#034;, &#36;value1);<br />
&#36;value3a = str_replace(&#034;qu&#039;&#034;, &#034;&#034;, &#36;value2);<br />
&#36;value3b = str_replace(&#034;d&#039;&#034;, &#034;&#034;, &#36;value3a);<br />
&#36;value3c = str_replace(&#034;l&#039;&#034;, &#034;&#034;, &#36;value3b);<br />
&#36;value3d = str_replace(&#034;n&#039;&#034;, &#034;&#034;, &#36;value3c);<br />
&#36;value3e = str_replace(&#034;m&#039;&#034;, &#034;&#034;, &#36;value3d);<br />
&#36;value3f = str_replace(&#034;j&#039;&#034;, &#034;&#034;, &#36;value3e);<br />
&#36;value3g = str_replace(&#034;t&#039;&#034;, &#034;&#034;, &#36;value3f);<br />
&#36;value3h = str_replace(&#034;&#039;&#034;, &#034;&#034;, &#36;value3g);<br />
&#36;value4 = str_replace(&#034;é&#034;, &#034;é&#034;, &#36;value3h);<br />
&#36;value5 = str_replace(&#034;Ã©&#034;, &#034;é&#034;, &#36;value4);<br />
&#36;value6 = str_replace(&#034;â&#034;, &#034;â&#034;, &#36;value5);<br />
&#36;value7 = str_replace(&#034;ç&#034;, &#034;ç&#034;, &#36;value6);<br />
&#36;value8 = str_replace(&#034;Ã§&#034;, &#034;ç&#034;, &#36;value7);<br />
&#36;value9 = str_replace(&#034;è&#034;, &#034;è&#034;, &#36;value8);<br />
&#36;value10 = str_replace(&#034;Ã¨&#034;, &#034;è&#034;, &#36;value9);<br />
&#36;value11a = str_replace(&#034;:&#034;, &#034;&#034;, &#36;value10);<br />
&#36;value11b = str_replace(&#034;.&#034;, &#034;&#034;, &#36;value11a);<br />
&#36;value11c = str_replace(&#034;;&#034;, &#034;&#034;, &#36;value11b);<br />
&#36;value11d = str_replace(&#034;,&#034;, &#034;&#034;, &#36;value11c);<br />
&#36;value12 = str_replace(&#034;&#92;&#034;", &#034;&#034;, &#36;value11d);<br />
&#36;value13 = str_replace(&#034; &#034;, &#034; &#034;, &#36;value12);<br />
print &#034;&#36;value13&lt;br&gt;&#034;;</p>
<p>//*Now I clear all one letter results since they are not keywords</p>
<p>if (strlen(&#36;value13) &gt; 1) {</p>
<p>//********************************<br />
//*Now I proceed with the insert &#8211; update database with &#36;value13</p>
<p>I had a problem while inserting into DataBase: A &#034;duplicate entry warning&#034; (on die), despite the fact that I querried to make sure that &#36;value did not already exist prior to attempt to insert it in the database. </p>
<p>Why this happens is still a mystery to me. I went around it by disabling the &#034;OR die&#034; which is not a big problem for my usage since it concerns a very few words that are very unlikely to require analysis.</p>
<p>Finally, I added a delete command to get rid of a bunch of words that are not keywords (the, this, at, for &#8230;.). </p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/comment-page-1/#comment-8873</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/#comment-8873</guid>
		<description>I have ben looking everywhere to find a function to strip out the keywords from the search engines refering url and looked at the code you have here on this site but I seem to get lost at the end. See, what I need it to do is just...instead of writing to a flat file or lof file, I want to store the keywords in a mysql database so that I can include it with a stats program I have been working on. Any tips? Anything would be appreciated!</description>
		<content:encoded><![CDATA[<p>I have ben looking everywhere to find a function to strip out the keywords from the search engines refering url and looked at the code you have here on this site but I seem to get lost at the end. See, what I need it to do is just&#8230;instead of writing to a flat file or lof file, I want to store the keywords in a mysql database so that I can include it with a stats program I have been working on. Any tips? Anything would be appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer</title>
		<link>http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/comment-page-1/#comment-8872</link>
		<dc:creator>Jennifer</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/#comment-8872</guid>
		<description>Actually - I have MT RefSearch working here too - hadn&#039;t even thought to look to see if it had seperated out a function that would do that... Changing the code above.
&lt;b&gt;To download the full code to MT RefSearch - go &lt;a href=&quot;http://eliot.landrum.cx/archives/2002/12/12/07_the_wonderwhammy_release.php&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/b&gt;</description>
		<content:encoded><![CDATA[<p>Actually &#8211; I have MT RefSearch working here too &#8211; hadn&#039;t even thought to look to see if it had seperated out a function that would do that&#8230; Changing the code above.<br />
<b>To download the full code to MT RefSearch &#8211; go <a href="http://eliot.landrum.cx/archives/2002/12/12/07_the_wonderwhammy_release.php" target="_blank">here</a>.</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richy C.</title>
		<link>http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/comment-page-1/#comment-8871</link>
		<dc:creator>Richy C.</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2003/01/18/parse-search-keywords-from-referrer/#comment-8871</guid>
		<description>I take it you are aware that &lt;a href=&quot;http://blog.beebware.co.uk/archives/000112.html&quot;&gt;MT RefSearch&lt;/a&gt; does a similar thing and copes with around 240 search engines? Include ones which can have &#039;multiple parameters&#039; in the search field?

The code is reasonably documented - so if you want to take a peek - be my guest!</description>
		<content:encoded><![CDATA[<p>I take it you are aware that <a href="http://blog.beebware.co.uk/archives/000112.html">MT RefSearch</a> does a similar thing and copes with around 240 search engines? Include ones which can have &#039;multiple parameters&#039; in the search field?</p>
<p>The code is reasonably documented &#8211; so if you want to take a peek &#8211; be my guest!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

