gtalk 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gtalk.rb +41 -0
- metadata +62 -0
data/lib/gtalk.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'easy-gtalk-bot'
|
3
|
+
|
4
|
+
p "ENV['GTALK_HEADER'] #{ENV['GTALK_HEADER']}"
|
5
|
+
p "ENV['GTALK_ME'] #{ENV['GTALK_ME']}"
|
6
|
+
p "ENV['GTALK_US'] #{ENV['GTALK_US']}"
|
7
|
+
p "ENV['GTALK_LOGIN'] #{ENV['GTALK_LOGIN']}"
|
8
|
+
p "ENV['GTALK_PASSWORD'] #{ENV['GTALK_PASSWORD']}"
|
9
|
+
|
10
|
+
module GtalkMsgPrivate
|
11
|
+
def gbot()
|
12
|
+
if ENV['GTALK_LOGIN'].include?("@")
|
13
|
+
login = ENV['GTALK_LOGIN']
|
14
|
+
else
|
15
|
+
login = "#{ENV['GTALK_LOGIN']}@gmail.com"
|
16
|
+
end
|
17
|
+
bot = GTalk::Bot.new(:email => login, :password => "#{ENV['GTALK_PASSWORD']}")
|
18
|
+
bot.get_online
|
19
|
+
return bot
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
include GtalkMsgPrivate
|
24
|
+
|
25
|
+
def gtalk_to(to,msg)
|
26
|
+
bot = gbot
|
27
|
+
bot.message(to,"#{ENV['GTALK_HEADER']}#{msg}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def gtalk_me(msg)
|
31
|
+
gtalk_to("#{ENV['GTALK_ME']}",msg)
|
32
|
+
end
|
33
|
+
alias gtalk gtalk_me
|
34
|
+
|
35
|
+
def gtalk_us(msg)
|
36
|
+
us = ENV['GTALK_US'].split(",")
|
37
|
+
bot = gbot
|
38
|
+
us.each do |one|
|
39
|
+
bot.message("#{one}","#{ENV['GTALK_HEADER']}#{msg}")
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gtalk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Kimat Boven
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: easy-gtalk-bot
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: Once require it provides you with gtalkme(msg) gtalkto(to,msg)
|
31
|
+
email: tobeportable@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/gtalk.rb
|
37
|
+
homepage: ''
|
38
|
+
licenses: []
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 1.8.24
|
58
|
+
signing_key:
|
59
|
+
specification_version: 3
|
60
|
+
summary: lets you send gtalk messages
|
61
|
+
test_files: []
|
62
|
+
has_rdoc:
|