Apache::Keywords

Apache::Keywords is a Perl module that can store keywords as a personal profile in a cookie.
Download

Apache::Keywords Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Magnus Cedergren
  • Publisher web site:
  • http://search.cpan.org/~magnus/Apache-Keywords-0.1/lib/Apache/Keywords.pm

Apache::Keywords Tags


Apache::Keywords Description

Apache::Keywords is a Perl module that can store keywords as a personal profile in a cookie. Apache::Keywords is a Perl module that can store keywords as a personal profile in a cookie.SYNOPSISIn 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: 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" >.METHODSThe following methods could be use in dynamic web scripts:$k = new Apache::Keywords; Make a new Apache::Keywords object and return it.$k->name(); Sets the name of the cookie that is used for the personal profile. Without argument, the function returns the name of the cookie.$k->expires(); Sets the cookie parameter for expiration. Without argument, the function returns the expiration time already set.$k->path(); Sets the path to be associated with the cookie. Without argument, the function returns the path already set.$k->domain(); Sets the domain name to be associated with the cookie. Without argument, the function returns the domain name already set.$k->new_keywords($r,); Add the new keywords of this HTTP-call. The argument is a string with the different words separated with space. $r is the Apache mod_perl request object.$k->new_keywords_asp($Request,); A special version of new_keywords() suited for Apache::ASP. The $Request object is special for Apache::ASP.$k->profile; Return the profile in a hash reference, e.g. profile->{'horse'} == 3, profile->{'dog'} == 2.$k->profile_asp A special version of profile() suited for Apache::ASP. The $Request is special for Apache::ASP.Requirements:· Perl Requirements: · Perl


Apache::Keywords Related Software