notes, for the record
Matt S Trout [Tue, 25 Jan 2011 03:58:32 +0000 (03:58 +0000)]
notes/jsetup [new file with mode: 0644]
notes/xmppnotes [new file with mode: 0644]

diff --git a/notes/jsetup b/notes/jsetup
new file mode 100644 (file)
index 0000000..cc524a3
--- /dev/null
@@ -0,0 +1,5 @@
+use App::Clifton::Tower::Jabber
+my $j = $_SERVER->_new_child('App::Clifton::Tower::Jabber', { server => $_SERVER, bridge_name => 'hearts', jabber_config => $_SERVER->current_config->bridges->get({ name => 'hearts' })->jabber });
+my $xmpp = $j->xmpp_client;
+$xmpp->compose(to => 'mst@corvina.org', body => 'hi')->send
+$xmpp->configure(on_message => $j->_replace_weakself('handle_message'));
diff --git a/notes/xmppnotes b/notes/xmppnotes
new file mode 100644 (file)
index 0000000..62875c3
--- /dev/null
@@ -0,0 +1,15 @@
+use Net::Async::XMPP::Client
+my $xmpp = Net::Async::XMPP::Client->new
+$_SERVER->add_child($xmpp);
+$xmpp->login(jid => 'dexter@sevvie.co', host => 'corvina.org', password => "2smvjCsn");
+$xmpp->compose(to => 'mst@corvina.org', body => 'hi')->send
+$xmpp->configure(on_message => sub { print STDERR $_[1]->body."\n" });
+
+re.pl$ use Net::Async::IRC;
+re.pl$ $_SERVER->add_child(my $irc = Net::Async::IRC->new);
+ $irc->login(nick => 'clifton_mst', host => 'irc.perl.org', on_login => sub { print STDERR "login\n" });
+$irc->send_message("JOIN", undef, '#hearts');
+
+$xmpp->configure(on_message => sub { if ($_[1]->to eq 'dexter@sevvie.co'){ $irc->send_message("PRIVMSG", undef, '#hearts', $_[1]->body) } });
+
+$irc->configure(on_message_text => sub { my $h = $_[2]; if (!$h->{prefix_is_me} && $h->{target_name} eq '#hearts') { $xmpp->compose(to => 'mst@corvina.org', body => join(': ', $h->{prefix_name}, $h->{text}))->send } });