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.
Search for possible authors of anonymous post in vk.com group by photo
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment