skype 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/History.txt +5 -0
- data/README.md +1 -1
- data/lib/skype/version.rb +1 -1
- data/lib/skype/wrappers/chat.rb +1 -1
- data/samples/chat.rb +27 -5
- data/test/test_chat.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eced28795b2a77a42df86107d84682ef5d8380b
|
4
|
+
data.tar.gz: a451d065c2e3f5b13ae653afe33781b85bd4064a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9531c430f248eff98199bd17f948dbe95a35769dc564b029e40dba90e64514986ebfebe4132486c68549b56b6649cec9c1d763e9a32908bc8ff8872b20d46a18
|
7
|
+
data.tar.gz: 9b1a8bff9f6dcc04c07ef8ebda9257ca43654e060ee9e9e712adff4c8f98b99f3e35a18441d563acc35907079c24e57d12881114f84e1d368b70f48f65fb2907
|
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/README.md
CHANGED
data/lib/skype/version.rb
CHANGED
data/lib/skype/wrappers/chat.rb
CHANGED
@@ -16,7 +16,7 @@ module Skype
|
|
16
16
|
attr_reader :id, :topic, :members
|
17
17
|
|
18
18
|
def initialize(id)
|
19
|
-
@id = id
|
19
|
+
@id = id
|
20
20
|
@topic = ::Skype.exec("GET CHAT #{@id} TOPIC").scan(/TOPIC (.*)$/)[0][0].toutf8 rescue @topic = ""
|
21
21
|
@members = ::Skype.exec("GET CHAT #{@id} MEMBERS").scan(/MEMBERS (.+)$/)[0][0].split(/\s/) rescue @members = []
|
22
22
|
end
|
data/samples/chat.rb
CHANGED
@@ -6,11 +6,33 @@ require 'skype'
|
|
6
6
|
|
7
7
|
chats = Skype.chats
|
8
8
|
puts "#{chats.length} chats found"
|
9
|
-
|
9
|
+
chats.each_with_index do |c, index|
|
10
|
+
title = "#{c.topic} #{c.members[0..5].join(',')} (#{c.members.size} users)".strip
|
11
|
+
puts "[#{index}] #{title}"
|
12
|
+
end
|
13
|
+
|
14
|
+
chat = nil
|
15
|
+
loop do
|
16
|
+
print "select [0]~[#{chats.size-1}] >"
|
17
|
+
line = STDIN.gets.strip
|
18
|
+
next unless line =~ /^\d+$/
|
19
|
+
chat = chats[line.to_i]
|
20
|
+
break
|
21
|
+
end
|
10
22
|
|
11
|
-
|
12
|
-
|
23
|
+
Thread.new do
|
24
|
+
last_id = 0
|
25
|
+
loop do
|
26
|
+
chat.messages.each do |m|
|
27
|
+
next unless last_id < m.id
|
28
|
+
puts m
|
29
|
+
last_id = m.id
|
30
|
+
end
|
31
|
+
sleep 1
|
32
|
+
end
|
33
|
+
end
|
13
34
|
|
14
|
-
|
15
|
-
|
35
|
+
loop do
|
36
|
+
line = STDIN.gets.strip
|
37
|
+
chat.post line
|
16
38
|
end
|
data/test/test_chat.rb
CHANGED