Selling cookie info to third-parties is a classic example of you can make money without doing evil.
RSS

CGIComment cookie patch

2005/01/06 filed under /nanoblogger

A lot of blogs have the abillity to add comments. My blog uses CGIComment for that. Unfortunately, that script doesn't support cookies to store the user's info. This patch will "fix" that. Please note that it's a nasty hack, so make sure you keep a backup of your original cgicomment.pl around!

--- CGIComment-1.1/cgicomment.pl	Tue Feb 10 12:29:32 2004
+++ cgicomment.pl	Fri Jan  6 22:01:56 2005
@@ -253,6 +253,18 @@
 {
 	# differs from LoadCommentInfo in that the information is fetched
 	# from the web input form
+        ($CommentInfo{'cookieauthor'},
+         $CommentInfo{'cookieemail'},
+         $CommentInfo{'cookiesite'}) =  split(';;', $cgi->cookie('blog'))
+       		if($cgi->cookie('blog'));
+
+        $CommentInfo{'cookieauthor'} = $cgi->param('author') 
+   	   if($cgi->param('author'));
+        $CommentInfo{'cookieemail'}  = $cgi->param('email')
+   	   if($cgi->param('email'));
+        $CommentInfo{'cookiesite'}   = $cgi->param('site')  
+   	   if($cgi->param('site'));
+
 	$CommentInfo{'article'}  = filterUserInput($cgi->param('article'));
 
 	$CommentInfo{'email'} = filterUserInput($cgi->param('email')) || '';
@@ -736,7 +748,15 @@
 }
 
 
-print "Content-type: text/html\n\n";
+FetchCommentInfo();
+
+my $cookie = $cgi->cookie(-name  => 'blog',
+                          -value => ($CommentInfo{'cookieauthor'}||'').";;".
+                                    ($CommentInfo{'cookieemail'}||'') .";;".
+				     ($CommentInfo{'cookiesite'}||''),
+                          -expires=>'+1y');
+
+print $cgi->header(-cookie=>$cookie);
 
 $CommentInfo{'basedir'} = $basedir;
 
Posted by: B10m | permanent link | comments (0)

Pop, Soda, Coke, or ...

2005/01/06 filed under /web

Some people really have too much time on their hands, really. Today I came across The Pop vs. Soda Page, a page about "The Great Pop vs. Soda Controversy".

The page takes data from a survey of USA-citizens about how they call a "carbonated soft drink" and the location of these people. The results are plotted, resulting in a nice map of the USA, which colorfully shows the individual states and what the most used word is: pop, soda, coke, or other.

Well done! Now go do something useful!? ;)

Posted by: B10m | permanent link | comments (0)
return-member