ids_please 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ids_please/odnoklassniki.rb +6 -4
- data/lib/ids_please.rb +1 -1
- data/spec/ids_please/basic_spec.rb +6 -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: 8be9083e210f8b4df81b14c15e8ca7065cf5abd9
|
4
|
+
data.tar.gz: 369434e6de5f193aa1435be83e0f52b94b104f10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49d8e1bd0da7ec6112ed78efc71502a7d91f1005ddca7cc2fd24617fb2da35769abe832dd2edbab2fd095d9a067b892219de15014cc1efd467e310ca4b22290e
|
7
|
+
data.tar.gz: 7f8bbbf422297eae40f64ae6ad17cc2246b2a640eb33cd5a1c19f0bbaf359b74378b1798d9a6b7017f62458228f8652ac3b69576b713471ad108b7014ac2d5d3
|
@@ -4,10 +4,12 @@ class IdsPlease
|
|
4
4
|
MASK = /odnoklassniki/i
|
5
5
|
|
6
6
|
def self.parse_link(link)
|
7
|
-
if link.path
|
8
|
-
|
9
|
-
elsif link.path
|
10
|
-
link.path.split('/')
|
7
|
+
if matched = link.path.match(/\/(\d{2,})/)
|
8
|
+
matched[1]
|
9
|
+
elsif link.path =~ /\/about\//
|
10
|
+
link.path.split('/')[-2]
|
11
|
+
elsif link.path.split('/').size >= 3
|
12
|
+
link.path.split('/')[2]
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
data/lib/ids_please.rb
CHANGED
@@ -14,6 +14,8 @@ describe IdsPlease do
|
|
14
14
|
https://soundcloud.com/sc_acc
|
15
15
|
https://youtube.com/channels/yb_acc
|
16
16
|
http://tumblr-acc.tumblr.com
|
17
|
+
http://odnoklassniki.com/profile/12341234/about
|
18
|
+
http://odnoklassniki.com/group/43214321/about?some=123
|
17
19
|
)
|
18
20
|
|
19
21
|
not_recognazible_links = %w(
|
@@ -73,6 +75,10 @@ describe IdsPlease do
|
|
73
75
|
expect(@recognizer.parsed[:tumblr].first).to eq('tumblr-acc')
|
74
76
|
end
|
75
77
|
|
78
|
+
it 'get right id from odnoklassniki link' do
|
79
|
+
expect(@recognizer.parsed[:odnoklassniki]).to eq(['12341234', '43214321'])
|
80
|
+
end
|
81
|
+
|
76
82
|
end
|
77
83
|
|
78
84
|
end
|