Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf8 -*-
- from darth import *
- from random import choice
- from time import sleep
- album_id = 197002724
- photo_ids = []
- o = 0
- l = 1000
- while 1:
- r = vk.api('photos.get', {'album_id': album_id, 'offset': o, 'count': l})
- photo_ids += [item['id'] for item in r['items']]
- o += l
- if o >= r['count']:
- break
- print u'Фоточек: %s' % len(photo_ids)
- group_ids = [
- # 59921851,
- # 51609737,
- 47350356,
- 42416529,
- 19814678,
- 39130136,
- # 39410357,
- 39673900,
- 38518878,
- # 30127198, # стена закрыта
- # 65420545,
- # 41258869,
- # 24261502,
- # 34985835,
- # 46039830,
- 36352266,
- 17164406,
- # 23206079,
- # 8337923,
- 31234562,
- 52805991,
- 44339426,
- 24045232,
- 56028682,
- 39228798,
- 16526901,
- 52651103,
- 33704965,
- 28304846,
- 59721672,
- 55940002,
- 61831751,
- # 55897568,
- # 50794393,
- ]
- queue = []
- while 1:
- vk.api('account.setOnline')
- r = vk.api('friends.getRequests')
- print 'requests: %s' % r['count']
- for user_id in r['items']:
- params = {'user_id': user_id}
- code = vk.api('friends.add', params)
- # отменил заявку
- if code != 2:
- vk.api('friends.delete', params)
- else:
- # лайкаем фотки с авки, но не более 3
- # r = vk.api('photos.getProfile', {'owner_id': user_id, 'count': 3, 'rev': 1})
- # L = [x['id'] for x in r['items']]
- # for x in L:
- # vk.api('likes.add', {'owner_id': user_id, 'type': 'photo', 'item_id': x})
- # sleep(1)
- pass
- for group_id in group_ids:
- print 'http://vk.com/club%s' % group_id
- if len(queue) == len(group_ids):
- owner_id, post_id = queue.pop(0)
- vk.api('wall.delete', {'owner_id': owner_id, 'post_id': post_id})
- owner_id = -group_id
- r = vk.api('wall.post', {'owner_id': owner_id, 'attachments': 'photo%s_%s' % (vk.user_id, choice(photo_ids))})
- # print u'Опубликовали http://vk.com/wall-%s_%s' % (group_id, r['post_id'])
- queue.append((owner_id, r['post_id']))
- sleep(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement