share_checker 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/share_checker/providers/tweetracker.rb +7 -4
- data/lib/share_checker/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/dummy/log/test.log +95 -0
- data/spec/providers/tweetracker_spec.rb +6 -1
- metadata +32 -20
@@ -10,14 +10,17 @@ module ShareChecker
|
|
10
10
|
# "users":26,
|
11
11
|
# "query":"http://www.mcdonaldseurokids2012.com.ua/challenges/1/works/140"
|
12
12
|
# }
|
13
|
-
#
|
13
|
+
# or
|
14
|
+
# <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<track-item>\n <query>http://www.mcdonaldseurokids2012.com.ua/works/474</query>\n <tweets type=\"integer\">1</tweets>\n <users type=\"integer\">1</users>\n <id>4e8f06abc546611f21000177</id>\n</track-item>\n
|
15
|
+
|
14
16
|
def parse(response)
|
15
|
-
doc =
|
16
|
-
|
17
|
+
doc = ::Nokogiri::XML(response)
|
18
|
+
node = doc.at("users")
|
19
|
+
node.nil? ? 0 : node.content.to_i
|
17
20
|
end
|
18
21
|
|
19
22
|
def url
|
20
|
-
"http://tracktweets.aimbulance.com/api/v1/groups/#{group_id}/urls/count.
|
23
|
+
"http://tracktweets.aimbulance.com/api/v1/groups/#{group_id}/urls/count.xml?query="
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,95 @@
|
|
1
|
+
[1m[36mSQL (0.3ms)[0m [1m SELECT name
|
2
|
+
FROM sqlite_master
|
3
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
4
|
+
[0m
|
5
|
+
[1m[35mSQL (0.1ms)[0m select sqlite_version(*)
|
6
|
+
[1m[36mSQL (150.5ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
7
|
+
[1m[35mSQL (0.1ms)[0m PRAGMA index_list("schema_migrations")
|
8
|
+
[1m[36mSQL (70.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
9
|
+
[1m[35mSQL (0.3ms)[0m SELECT name
|
10
|
+
FROM sqlite_master
|
11
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
12
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
13
|
+
FROM sqlite_master
|
14
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
15
|
+
[0m
|
16
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
17
|
+
FROM sqlite_master
|
18
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
19
|
+
[0m
|
20
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
21
|
+
FROM sqlite_master
|
22
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
23
|
+
[0m
|
24
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
25
|
+
FROM sqlite_master
|
26
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
27
|
+
[0m
|
28
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
29
|
+
FROM sqlite_master
|
30
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
31
|
+
[0m
|
32
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
33
|
+
FROM sqlite_master
|
34
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
35
|
+
[0m
|
36
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
37
|
+
FROM sqlite_master
|
38
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
39
|
+
[0m
|
40
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
41
|
+
FROM sqlite_master
|
42
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
43
|
+
[0m
|
44
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
45
|
+
FROM sqlite_master
|
46
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
47
|
+
[0m
|
48
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
49
|
+
FROM sqlite_master
|
50
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
51
|
+
[0m
|
52
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
53
|
+
FROM sqlite_master
|
54
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
55
|
+
[0m
|
56
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
57
|
+
FROM sqlite_master
|
58
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
59
|
+
[0m
|
60
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
61
|
+
FROM sqlite_master
|
62
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
63
|
+
[0m
|
64
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
65
|
+
FROM sqlite_master
|
66
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
67
|
+
[0m
|
68
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
69
|
+
FROM sqlite_master
|
70
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
71
|
+
[0m
|
72
|
+
[1m[36mSQL (0.5ms)[0m [1m SELECT name
|
73
|
+
FROM sqlite_master
|
74
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
75
|
+
[0m
|
76
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
77
|
+
FROM sqlite_master
|
78
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
79
|
+
[0m
|
80
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
81
|
+
FROM sqlite_master
|
82
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
83
|
+
[0m
|
84
|
+
[1m[36mSQL (0.5ms)[0m [1m SELECT name
|
85
|
+
FROM sqlite_master
|
86
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
87
|
+
[0m
|
88
|
+
[1m[36mSQL (0.4ms)[0m [1m SELECT name
|
89
|
+
FROM sqlite_master
|
90
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
91
|
+
[0m
|
92
|
+
[1m[36mSQL (0.6ms)[0m [1m SELECT name
|
93
|
+
FROM sqlite_master
|
94
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
95
|
+
[0m
|
@@ -5,8 +5,13 @@ describe ShareChecker::Providers::Tweetracker do
|
|
5
5
|
@provider = ShareChecker.provider("tweetracker", "http://www.google.com.ua/", :group_id => 'test')
|
6
6
|
end
|
7
7
|
|
8
|
-
it "should parse response from tweetracker" do
|
8
|
+
it "should parse json response from tweetracker" do
|
9
9
|
response = "{\"tweets\":30,\"id\":\"4e281dcec546612414000004\",\"users\":26,\"query\":\"http://www.mcdonaldseurokids2012.com.ua/challenges/1/works/140\"}"
|
10
|
+
@provider.parse_json(response)["users"].should == 26
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should parse xml response from tweetracker" do
|
14
|
+
response = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<track-item>\n <query>http://www.mcdonaldseurokids2012.com.ua/works/474</query>\n <tweets type=\"integer\">1</tweets>\n <users type=\"integer\">26</users>\n <id>4e8f06abc546611f21000177</id>\n</track-item>\n"
|
10
15
|
@provider.parse(response).should == 26
|
11
16
|
end
|
12
17
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Igor Galeta
|
@@ -16,7 +16,8 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-10-
|
19
|
+
date: 2011-10-24 00:00:00 +03:00
|
20
|
+
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
23
|
name: activesupport
|
@@ -83,26 +84,32 @@ extensions: []
|
|
83
84
|
extra_rdoc_files:
|
84
85
|
- README.rdoc
|
85
86
|
files:
|
86
|
-
- lib/share_checker.rb
|
87
|
-
- lib/share_checker/config.rb
|
88
|
-
- lib/share_checker/providers/odnoklassniki.rb
|
89
87
|
- lib/share_checker/providers/tweetracker.rb
|
90
|
-
- lib/share_checker/providers/vkontakte.rb
|
91
|
-
- lib/share_checker/providers/facebook.rb
|
92
88
|
- lib/share_checker/providers/twitter.rb
|
89
|
+
- lib/share_checker/providers/facebook.rb
|
90
|
+
- lib/share_checker/providers/odnoklassniki.rb
|
91
|
+
- lib/share_checker/providers/vkontakte.rb
|
92
|
+
- lib/share_checker/config.rb
|
93
93
|
- lib/share_checker/version.rb
|
94
94
|
- lib/share_checker/provider.rb
|
95
|
+
- lib/share_checker.rb
|
95
96
|
- MIT-LICENSE
|
96
97
|
- Rakefile
|
97
98
|
- Gemfile
|
98
99
|
- README.rdoc
|
99
|
-
- spec/
|
100
|
-
- spec/
|
101
|
-
- spec/
|
102
|
-
- spec/
|
103
|
-
- spec/
|
100
|
+
- spec/dummy/log/production.log
|
101
|
+
- spec/dummy/log/server.log
|
102
|
+
- spec/dummy/log/test.log
|
103
|
+
- spec/dummy/log/development.log
|
104
|
+
- spec/dummy/db/test.sqlite3
|
104
105
|
- spec/providers/twitter_spec.rb
|
106
|
+
- spec/providers/facebook_spec.rb
|
107
|
+
- spec/providers/odnoklassniki_spec.rb
|
108
|
+
- spec/providers/tweetracker_spec.rb
|
109
|
+
- spec/providers/vkontakte_spec.rb
|
105
110
|
- spec/share_checker_spec.rb
|
111
|
+
- spec/spec_helper.rb
|
112
|
+
has_rdoc: true
|
106
113
|
homepage: https://github.com/galetahub/share_checker
|
107
114
|
licenses: []
|
108
115
|
|
@@ -132,15 +139,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
139
|
requirements: []
|
133
140
|
|
134
141
|
rubyforge_project:
|
135
|
-
rubygems_version: 1.
|
142
|
+
rubygems_version: 1.6.2
|
136
143
|
signing_key:
|
137
144
|
specification_version: 3
|
138
145
|
summary: Insert ShareChecker summary.
|
139
146
|
test_files:
|
140
|
-
- spec/
|
141
|
-
- spec/
|
142
|
-
- spec/
|
143
|
-
- spec/
|
144
|
-
- spec/
|
147
|
+
- spec/dummy/log/production.log
|
148
|
+
- spec/dummy/log/server.log
|
149
|
+
- spec/dummy/log/test.log
|
150
|
+
- spec/dummy/log/development.log
|
151
|
+
- spec/dummy/db/test.sqlite3
|
145
152
|
- spec/providers/twitter_spec.rb
|
153
|
+
- spec/providers/facebook_spec.rb
|
154
|
+
- spec/providers/odnoklassniki_spec.rb
|
155
|
+
- spec/providers/tweetracker_spec.rb
|
156
|
+
- spec/providers/vkontakte_spec.rb
|
146
157
|
- spec/share_checker_spec.rb
|
158
|
+
- spec/spec_helper.rb
|