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.
@@ -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 = parse_json(response)
16
- doc.nil? ? 0 : doc["users"].to_i
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.json?query="
23
+ "http://tracktweets.aimbulance.com/api/v1/groups/#{group_id}/urls/count.xml?query="
21
24
  end
22
25
  end
23
26
  end
@@ -1,3 +1,3 @@
1
1
  module ShareChecker
2
- VERSION = "0.1.4".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
Binary file
File without changes
File without changes
File without changes
@@ -0,0 +1,95 @@
1
+ SQL (0.3ms)  SELECT name
2
+ FROM sqlite_master
3
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
4
+ 
5
+ SQL (0.1ms) select sqlite_version(*)
6
+ SQL (150.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
7
+ SQL (0.1ms) PRAGMA index_list("schema_migrations")
8
+ SQL (70.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
+ SQL (0.3ms) SELECT name
10
+ FROM sqlite_master
11
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
12
+ SQL (0.4ms)  SELECT name
13
+ FROM sqlite_master
14
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
15
+ 
16
+ SQL (0.4ms)  SELECT name
17
+ FROM sqlite_master
18
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
19
+ 
20
+ SQL (0.4ms)  SELECT name
21
+ FROM sqlite_master
22
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
23
+ 
24
+ SQL (0.4ms)  SELECT name
25
+ FROM sqlite_master
26
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
27
+ 
28
+ SQL (0.4ms)  SELECT name
29
+ FROM sqlite_master
30
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
31
+ 
32
+ SQL (0.4ms)  SELECT name
33
+ FROM sqlite_master
34
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
35
+ 
36
+ SQL (0.4ms)  SELECT name
37
+ FROM sqlite_master
38
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
39
+ 
40
+ SQL (0.4ms)  SELECT name
41
+ FROM sqlite_master
42
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
43
+ 
44
+ SQL (0.4ms)  SELECT name
45
+ FROM sqlite_master
46
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
47
+ 
48
+ SQL (0.4ms)  SELECT name
49
+ FROM sqlite_master
50
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
51
+ 
52
+ SQL (0.4ms)  SELECT name
53
+ FROM sqlite_master
54
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
55
+ 
56
+ SQL (0.4ms)  SELECT name
57
+ FROM sqlite_master
58
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
59
+ 
60
+ SQL (0.4ms)  SELECT name
61
+ FROM sqlite_master
62
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
63
+ 
64
+ SQL (0.4ms)  SELECT name
65
+ FROM sqlite_master
66
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
67
+ 
68
+ SQL (0.4ms)  SELECT name
69
+ FROM sqlite_master
70
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
71
+ 
72
+ SQL (0.5ms)  SELECT name
73
+ FROM sqlite_master
74
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
75
+ 
76
+ SQL (0.4ms)  SELECT name
77
+ FROM sqlite_master
78
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
79
+ 
80
+ SQL (0.4ms)  SELECT name
81
+ FROM sqlite_master
82
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
83
+ 
84
+ SQL (0.5ms)  SELECT name
85
+ FROM sqlite_master
86
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
87
+ 
88
+ SQL (0.4ms)  SELECT name
89
+ FROM sqlite_master
90
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
91
+ 
92
+ SQL (0.6ms)  SELECT name
93
+ FROM sqlite_master
94
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
95
+ 
@@ -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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
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-08 00:00:00 Z
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/spec_helper.rb
100
- - spec/providers/vkontakte_spec.rb
101
- - spec/providers/tweetracker_spec.rb
102
- - spec/providers/odnoklassniki_spec.rb
103
- - spec/providers/facebook_spec.rb
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.8.10
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/spec_helper.rb
141
- - spec/providers/vkontakte_spec.rb
142
- - spec/providers/tweetracker_spec.rb
143
- - spec/providers/odnoklassniki_spec.rb
144
- - spec/providers/facebook_spec.rb
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