Changeset d1bb4f3 for lib/BarnOwl/Module
- Timestamp:
- Mar 12, 2008, 9:20:00 PM (17 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 1c24c69
- Parents:
- 30f0680
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/BarnOwl/Module/Twitter.pm
r30f0680 rd1bb4f3 35 35 # Which was fixed in svn r819 36 36 if((BarnOwl::getvar('twitter:class')||'') eq '') { 37 my $desc = <<'END_DESC'; 38 BarnOwl::Module::Twitter will watch for authentic zephyrs to 39 -c $twitter:class -i $twitter:instance -O $twitter:opcode 40 from your sender and mirror them to Twitter. 41 42 A value of '*' in any of these fields acts a wildcard, accepting 43 messages with any value of that field. 44 END_DESC 37 45 BarnOwl::new_variable_string('twitter:class', 38 46 { 39 47 default => $class, 40 summary => 'Class to watch for Twitter messages' 48 summary => 'Class to watch for Twitter messages', 49 description => $desc 41 50 }); 42 51 BarnOwl::new_variable_string('twitter:instance', 43 52 { 44 53 default => $instance, 45 summary => 'Instance on twitter:class to watch for Twitter messages' 54 summary => 'Instance on twitter:class to watch for Twitter messages.', 55 description => $desc 46 56 }); 47 57 BarnOwl::new_variable_string('twitter:opcode', 48 58 { 49 59 default => $opcode, 50 summary => 'Opcode for zephyrs that will be sent as twitter updates' 60 summary => 'Opcode for zephyrs that will be sent as twitter updates', 61 description => $desc 51 62 }); 52 63 } … … 71 82 } 72 83 84 sub match { 85 my $val = shift; 86 my $pat = shift; 87 return $pat eq "*" || ($val eq $pat); 88 } 89 73 90 sub handle_message { 74 91 my $m = shift; 75 92 ($class, $instance, $opcode) = map{BarnOwl::getvar("twitter:$_")} qw(class instance opcode); 76 93 if($m->sender eq $user 77 && $m->class eq $class78 && $m->instance eq $instance79 && $m->opcode eq $opcode94 && match($m->class, $class) 95 && match($m->instance, $instance) 96 && match($m->opcode, $opcode) 80 97 && $m->auth eq 'YES') { 81 98 twitter($m->body);
Note: See TracChangeset
for help on using the changeset viewer.