Skip to content

Instantly share code, notes, and snippets.

@kvld
Created January 24, 2016 00:30
Show Gist options
  • Save kvld/ac945e6985bf9ddb00ce to your computer and use it in GitHub Desktop.
Save kvld/ac945e6985bf9ddb00ce to your computer and use it in GitHub Desktop.

Revisions

  1. kvld created this gist Jan 24, 2016.
    21 changes: 21 additions & 0 deletions script.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    import vk
    from time import sleep

    GROUP = 100000
    IMG = "https://pp.vk.me/ccc/vvv/11111/NJSUbjs.jpg"

    api = vk.API(vk.Session())

    offset = 0
    count = api.groups.getMembers(group_id=GROUP)['count']
    users_in_group = []
    while count > 0:
    users_in_group += api.groups.getMembers(group_id=GROUP, offset=offset, count=1000)['users']
    offset, count = offset + 1000, count - 1000
    if offset % 5000 == 0:
    sleep(1)

    last_numbers = IMG.split('/')[4][-3:]
    suspected_users = [user for user in users_in_group if str(user)[-3:] == last_numbers]
    for user in suspected_users:
    print("https://vk.com/id%s" % user)