>>667399
#!/usr/bin/env python
#vim:fileencoding=utf8
from urllib import urlopen, urlencode
from BeautifulSoup import BeautifulSoup
URL = 'ССЫЛКА НА СКРИПТ ФОРМЫ'
PASSWORD = 'ПАРОЛЬ ДЛЯ УДАЛЕНИЯ'
TEXT = u'ТЕКСТ СООБЩЕНИЙ'#.encode('utf-8')
data_post = {
'gb2': 'thread',
'parent': <НОМЕР ТРЕДА>,
'password': PASSWORD,
'task': 'post',
}
data_del = [
('password', PASSWORD),
('task', 'delete'),
]
data_post['shampoo'] = TEXT.encode('utf-8')
r = urlopen(URL, urlencode(data_post))
soup = BeautifulSoup(r)
posts = soup.findAll(text=TEXT.splitlines()[0])
if posts:
post_ids = [post.parent.parent.parent.a['name'] for post in posts]
data = data_del + [('delete', post_id) for post_id in post_ids]
r = urlopen(URL, urlencode(data))