Skip to content

Commit

Permalink
VK updates, v0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
soxoj committed Jan 16, 2021
1 parent 452447b commit 9e68f69
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

## [Unreleased]

## [0.0.4] - 2021-01-16
* actualized Vimeo and VK

## [0.0.3] - 2021-01-15
* actualized Twitter
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
with open('README.md') as fh:
long_description = fh.read()

setup(name='socid_extractor',
version='0.0.3',
setup(name='socid-extractor',
version='0.0.4',
description='Extract accounts\' identifiers from personal pages on various platforms',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
10 changes: 9 additions & 1 deletion socid_extractor/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,17 @@
}
},
'VK user profile': {
'flags': ['var vk =', 'change_current_info'],
'flags': ['Profile.init({', 'change_current_info'],
'regex': r'Profile\.init\({"user_id":(?P<vk_id>\d+).*?(,"loc":"(?P<vk_username>.*?)")?,"back":"(?P<fullname>.*?)"'
},
'VK closed user profile': {
'flags': ['var vk =', 'page_current_info'],
'regex': r'<h1 class="page_name">(?P<fullname>.*?)</h1>'
},
'VK blocked user profile': {
'flags': ['window.vk = {', '/images/deactivated_50.png'],
'regex': r'<h2 class="op_header">(?P<fullname>.+?)</h2>'
},
'Gravatar': {
'flags': ['gravatar.com\\/avatar', 'thumbnailUrl'],
'regex': r'^(.+?)$',
Expand Down
13 changes: 13 additions & 0 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ def test_vk_user_profile_no_username():
assert info.get('fullname') in ('Юля Заболотная', 'Yulya Zabolotnaya')


def test_vk_closed_user_profile():
info = extract(parse('https://vk.com/alex')[0])

assert info.get('fullname') in ('Александр Чудаев')


def test_vk_blocked_user_profile():
headers = {'User-Agent': 'Curl'}
info = extract(parse('https://vk.com/alexaimephotography', headers=headers)[0])

assert info.get('fullname') in ('Alex Aimé')


def test_yandex_disk():
info = extract(parse('https://yadi.sk/d/xRJFp3s2QWYv8')[0])

Expand Down

0 comments on commit 9e68f69

Please sign in to comment.