Answer the question
In order to leave comments, you need to log in
How to understand from the VK link what it is for?
Good afternoon! How can you implement a link type definition and what is it for? So if it is on a post/photo, you need to get the owner id, post id ( photo id ) from the url.
Link examples:
https://vk.com/wall-185434489_738132?z=photo-185434489_457345154%2Fwall-185434489_738132 -- photo ( owner_id: -185434489, photo id: 457345154)
https://vk.com/im?sel=253206460&w=wall-151130550_4298586%2F098513c657c2d9a85f -- post ( owner_id: -151130550, post id: 4298586 )
if 'wall' in task['url']:
parsed = urlparse.urlparse(task['url'])
if 'w' in parse_qs(parsed.query):
p_url = parse_qs(parsed.query)['w'][0].replace('wall', '').split('_')
else:
p_url = parsed.path.replace('wall', '').split('_')
info['post_id'] = p_url[1]
info['owner_id'] = p_url[0]
Answer the question
In order to leave comments, you need to log in
I didn’t understand your question a little, but I think you are advised to read https://vk.com/dev/wall.post (more other tabs for other links
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question