Browse files

simple publish script for testing

  • Loading branch information...
1 parent 6fd91ba commit cd98995d443a83a047d17badd94fdd5c93fd426c @dpavlin dpavlin committed Aug 28, 2010
Showing with 18 additions and 0 deletions.
  1. +18 −0 scripts/publish.pl
View
18 scripts/publish.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+use Redis;
+
+my $pub = Redis->new();
+
+my $channel = $ARGV[0] || die "usage: $0 channel\n";
+
+print "#$channel > ";
+while(<STDIN>) {
+ chomp;
+ $channel = $1 if s/\s*\#(\w+)\s*//; # remove channel from message
+ my $nr = $pub->publish( $channel, $_ );
+ print "#$channel $nr> ";
+}
+

0 comments on commit cd98995

Please sign in to comment.