ids_please 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ids_please.gemspec +1 -0
- data/lib/ids_please/grabbers/facebook.rb +2 -1
- data/lib/ids_please/grabbers/vkontakte.rb +6 -0
- data/lib/ids_please/version.rb +1 -1
- data/spec/ids_please/basic_spec.rb +5 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5c5a597e0033bb29697a196f9d35c19dd23f6b2
|
4
|
+
data.tar.gz: ea291d66b2615371402031ecbeafbef42083c8fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 316ed1e46e77667bac3dbc46c89c986ed6b03e1cb1e656baa3b42944d23aabf0ec9847ffbb1af71a693a3e5a2f338827f8be4636b6358d2e2bf48ccd8242c7dd
|
7
|
+
data.tar.gz: 10b5af9d6366cdebf86499df750685d6f28c517c6297f4b751de0177b05577773ca7c60f5a157268cf24b8869c1e17d9457767cbe1bebd27d219dc6db1358fd3
|
data/ids_please.gemspec
CHANGED
@@ -27,7 +27,8 @@ class IdsPlease
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def find_network_id
|
30
|
-
find_by_regex(/entity_id":"(\d+)"/)
|
30
|
+
find_by_regex(/entity_id":"(\d+)"/) || find_by_regex(/al:ios:url" content="fb:\/\/page\/\?id=(\d+)"/) ||
|
31
|
+
find_by_regex(/"pageID":"(\d+)"/)
|
31
32
|
rescue => e
|
32
33
|
record_error __method__, e.message
|
33
34
|
return nil
|
@@ -2,6 +2,7 @@ class IdsPlease
|
|
2
2
|
module Grabbers
|
3
3
|
class Vkontakte < IdsPlease::Grabbers::Base
|
4
4
|
def grab_link
|
5
|
+
prepare_link
|
5
6
|
agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36'
|
6
7
|
@page_source ||= open(link, 'User-Agent' => agent).read.encode('utf-8')
|
7
8
|
@network_id = find_by_regex(/href="\/wall(-\d+)_/)
|
@@ -19,6 +20,11 @@ class IdsPlease
|
|
19
20
|
record_error __method__, e.message
|
20
21
|
return self
|
21
22
|
end
|
23
|
+
|
24
|
+
def prepare_link
|
25
|
+
id = @link.split('/').last
|
26
|
+
@link = "https://new.vk.com/#{id}"
|
27
|
+
end
|
22
28
|
end
|
23
29
|
end
|
24
30
|
end
|
data/lib/ids_please/version.rb
CHANGED
@@ -168,6 +168,11 @@ describe IdsPlease do
|
|
168
168
|
expect(@recognizer.parsed[:facebook]).to eq(%w(fb_acc fb_acc2))
|
169
169
|
end
|
170
170
|
|
171
|
+
it 'get right id from facebook Arabic link' do
|
172
|
+
@recognizer = IdsPlease.new('https://www.facebook.com/%D8%A7%D9%84%D9%85%D8%B1%D9%83%D8%B2-%D8%A7%D9%84%D8%AB%D9%82%D8%A7%D9%81%D9%8A-%D8%A7%D9%84%D9%82%D8%A8%D8%B7%D9%8A-%D8%A7%D9%84%D8%A3%D8%B1%D8%AB%D9%88%D8%B0%D9%83%D8%B3%D9%8A-%D8%A8%D8%A7%D9%84%D9%85%D8%A7%D9%86%D9%8A%D8%A7-179240385797/')
|
173
|
+
expect(@recognizer.grab[:facebook].first.network_id).to eq('179240385797')
|
174
|
+
end
|
175
|
+
|
171
176
|
it 'get right id from linkedin link' do
|
172
177
|
expect(@recognizer.parsed[:linkedin]).to eq(['xnutsive', 'evil-martians', '12341234'])
|
173
178
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ids_please
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gazay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Helps to get ids or screen names from links to social network accounts
|
42
56
|
email: alex.gaziev@gmail.com
|
43
57
|
executables:
|