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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62a9cb49b628181835beea63508837da69571f48
4
- data.tar.gz: eae92513b9f7749a4f6f07a10e8b35280843540b
3
+ metadata.gz: f5c5a597e0033bb29697a196f9d35c19dd23f6b2
4
+ data.tar.gz: ea291d66b2615371402031ecbeafbef42083c8fb
5
5
  SHA512:
6
- metadata.gz: 29a0fc45f8bee0e7354375ab0809e9dfd53880103fdc47237a0dff0e38dc6ffbac4c78059b700dbd8d117fe2e6313c9145a1cc892f4930974b7dcde3d6546fe3
7
- data.tar.gz: 2e7ea250e199c969a39d8fd7dc1691bf499dbf5bd72639eb6ea4120e7634dd1eb8e44fb582909648df4d0ae91a2863e2150477fc7cd6b0fcf959edc0675a971c
6
+ metadata.gz: 316ed1e46e77667bac3dbc46c89c986ed6b03e1cb1e656baa3b42944d23aabf0ec9847ffbb1af71a693a3e5a2f338827f8be4636b6358d2e2bf48ccd8242c7dd
7
+ data.tar.gz: 10b5af9d6366cdebf86499df750685d6f28c517c6297f4b751de0177b05577773ca7c60f5a157268cf24b8869c1e17d9457767cbe1bebd27d219dc6db1358fd3
data/ids_please.gemspec CHANGED
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
22
  s.add_development_dependency 'rake'
23
23
  s.add_development_dependency 'rspec'
24
+ s.add_development_dependency 'byebug'
24
25
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  class IdsPlease
2
2
 
3
- VERSION = '2.2.2'
3
+ VERSION = '2.2.3'
4
4
 
5
5
  end
@@ -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.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-04-13 00:00:00.000000000 Z
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: