#!/usr/bin/perl ######################################### # services_k # feeds bPod the keyword list for logged in user ######################################### use localbucky; $dbh = DBI->connect ($dsn); our ($USER, $lastlog) = checkin(); our $logged_in = ($USER != -1); our $TAGS = [ 'Docks', 'Dings', 'Mexico', 'France', 'Breakfast', 'Baked', 'Sandwich' ]; # this start/end shit is all broken anyway #my $start = $input->{s}; #my $end = $input->{e}; my $keywords_hashref = get_keywords(); my $keywords_arrayref = []; print "Content-type: text/html\r\n\r\n"; foreach my $keyword (keys(%$keywords_hashref)) { my $k = $keywords_hashref->{$keyword}; push ( @$keywords_arrayref, $keyword ) if (check_keyword($k)); } my $numItems = @$keywords_arrayref; my $returnString = " &numItems=" . ($numItems ); #$returnString = "duhhh"; @$keywords_arrayref = sort{ lc($a) cmp lc($b) } @$keywords_arrayref; my $keywordCount = 0; foreach my $keyword (@$keywords_arrayref) { $returnString .= "&keyword$keywordCount=$keyword"; my $color = $keywords_hashref->{$keyword}->{color} || "plain"; $returnString .= "&color$keywordCount=$color"; $keywordCount++; } #@$tags_arrayref = sort{ $a cmp $b } @$TAGS; my $tags_arrayref = get_tag_names(); @$tags_arrayref = sort{ lc($a) cmp lc($b) } @$tags_arrayref; my $numTags = @$tags_arrayref; $returnString .= "&numTags=" . $numTags; my $tagCount = 0; foreach my $tag (@$tags_arrayref) { $returnString .= "&tag$tagCount=$tag"; $tagCount++; } print $returnString ; exit(0);