summaryrefslogtreecommitdiff
path: root/cgi-bin/services_k
diff options
context:
space:
mode:
Diffstat (limited to 'cgi-bin/services_k')
-rwxr-xr-xcgi-bin/services_k62
1 files changed, 62 insertions, 0 deletions
diff --git a/cgi-bin/services_k b/cgi-bin/services_k
new file mode 100755
index 0000000..3ce9940
--- /dev/null
+++ b/cgi-bin/services_k
@@ -0,0 +1,62 @@
+#!/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);