#!/usr/bin/perl -w 
#
# The clue code from:
#   http://www.pipetree.com/space/GettingStartedWithDashboard
 
use lib '.'; 
use Dashboard; 
my ($data, $type) = ($ARGV[0] || undef, $ARGV[1] || undef); 

if (! (defined $data && defined $type)) {
  help();
}

my $dash = new Dashboard("Test"); 
$dash->send_cluepacket( 
  "context", 
  1, 
  [ 
    { 
      'data' => $data, 
      'type' => $type, 
      'relevance' => 10, 
    }, 
  ] 
); 


sub help {
  print "Clue sender to Dashboard\n";
  print "\n";
  print "Usage:\n";
  print "  $0 <clue> <type>\n";
  print "\n";
  print "eg:\n";
  print "  $0 http://hostname/rssfeed.rss rss\n";
  print "  $0 \"Andrew Ruthven\" full_name\n";
  print "\n";
  exit 0;
}
