From 2c18281558f2a77f5fa3169836dd8e43941d9472 Mon Sep 17 00:00:00 2001 From: cx uname Date: Fri, 12 Oct 2012 13:41:45 +0400 Subject: [PATCH] update --- gsend.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gsend.go diff --git a/gsend.go b/gsend.go new file mode 100644 index 0000000..c979741 --- /dev/null +++ b/gsend.go @@ -0,0 +1,20 @@ +package main + +import ( + "github.com/cxindex/xmpp" + "io/ioutil" + "os" +) + +func main() { + Conn, err := xmpp.Dial("xmpp.ru:5222", "hypnotoad", "xmpp.ru", "password", "ic", nil) + if err != nil { + println(err) + return + } + + if s, err := ioutil.ReadAll(os.Stdin); err == nil { + Conn.Send("hypnotoad@xmpp.ru", "chat", string(s[:len(s)-1])) + return + } +}