D
D
Drjabaka2015-04-18 21:34:53
Python
Drjabaka, 2015-04-18 21:34:53

How to send a message with a VKontakte tag?

Hey guys! Already tired of trying to insert a tag to the message - it (the message) does not see it in the published messages on the community wall ... Here is the code:

f = open('c:\\zit.html','r',encoding='utf8')
r = f.read().split('<p>')
message = r[random.randint(0, len(r)-1)]
print(message)
message=message + "<br>"
tag=input("Теги: ")
while tag!="":
    message=message+"#"+tag+" "
    tag=input("Теги: ")
print(message)
url = "https://api.vkontakte.ru/method/" \
        "wall.post?&access_token=" + access_token +\
        "&owner_id=-" + domain +\
        "&message=" + message.encode("utf8")
page = requests.get(url)
print(page.text)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Drjabaka, 2015-04-29
@Drjabaka

answer: you can replace the pound sign with % 23 ,
entered it in the browser in the search and it replaces the pound sign with % 23

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question