|
Apache::Keywords - Store keywords as a personal profile in a cookie. |
Apache::Keywords - Store keywords as a personal profile in a cookie.
The package Apache::Keywords contains:
Makefile.PL
lib/Apache/Keywords.pm
README
MANIFEST
You need Apache::Constants and Apache::Cookie to use Apache::Keywords.
tar zxf Apache-Keywords-0.1.tar.gz
perl Makefile.PL
make
make install
In a dynamic mod_perl source-file:
use Apache::Keywords;
# Create a keywords object
$k = new Apache::Keywords;
# Set different parameters
$k->name('PersonalProfile');
$k->expires('+1M');
$k->path("/");
$k->domain('xxx.com');
# Get parameters
print $k->expires;
print $k->path;
...
# Add new keywords to the profile
$k->new_keywords($r,"horse, dog");
# Special version for Apache::ASP
$k->new_keywords_asp($Request,"cars, motorcycles");
# Return the content of the cookie profile
$hashref = $k->profile($r);
print $hashref->{'horse'};
%hash = %$hashref;
# Special version for Apache::ASP
$k->profile_asp($Request);
In a the .htaccess for apache static-files, e.g. .html-files: <Files ~ (\.html)> SetHandler perl-script PerlFixupHandler Apache::Keywords PerlSetVar KeywordsName ``PersonalProfile'' PerlSetVar KeywordsExpires ``+1M'' PerlSetVar KeywordsPath ``/'' PerlSetVar KeywordsDomain ``xxx.com'' </Files>
An Apache::Keywords class object will generate/update a cookie. The cookie contains a personal profile, e.g. counts the different keywords that are added to it. The module could be configured as a ``PerlFixupHandler'' for a static file in mod_perl, e.g. HTML-files. It could also be used in web scripts, like mod_perl scripts that uses Apache::ASP or Apache::Registry. In the static version, Apache::Keywords fetches the keywords from phrases like <META NAME=``keywords'' CONTENT=``cars, motorcycles''>.
The following methods could be use in dynamic web scripts:
new_keywords() suited for Apache::ASP. The $Request
object is special for Apache::ASP.
profile() suited for Apache::ASP. The $Request
is special for Apache::ASP.
Copyright 2000 Magnus Cedergren, mace@lysator.liu.se
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Apache::Keywords - Store keywords as a personal profile in a cookie. |