Skip to content

Instantly share code, notes, and snippets.

@ddimtirov
Created November 2, 2013 07:44
Show Gist options
  • Save ddimtirov/7276589 to your computer and use it in GitHub Desktop.
Save ddimtirov/7276589 to your computer and use it in GitHub Desktop.
A stupid script to emulate "dynamic" signature on a Phorum account.
#!/usr/bin/python
# -*- coding: windows-1251 -*-
import random, time, datetime, httplib, urllib
random.seed()
def changeSig(signature):
headers = {
"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"
}
params = {
"username": "blah",
"password": "not-telling-you",
}
conn = httplib.HTTPConnection("bpm.cult.bg")
conn.request("POST", "/forum/login.php", urllib.urlencode(params), headers)
response = conn.getresponse()
redirectedUrl = response.getheader('location')
paramList = redirectedUrl[redirectedUrl.find('?')+1:].split('&')
formParams = {
"process": "1",
"id": "666",
"email": "123@abc.com",
"hide_email": "1",
"name": "blah blah",
"icq": "1234567",
"signature": signature
}
for pair in paramList:
param = pair.split('=')
formParams[param[0]] = param[1]
conn.request("POST", "/forum/profile.php", urllib.urlencode(formParams), headers)
conn.close()
print signature
while True:
left = datetime.datetime(2005, 5, 5, 11, 55, 55, 555555) - datetime.datetime.now()
try:
# if left.days == 0 and left.seconds < 300:
changeSig("ok, ������� 2005/05/05 05:05:05.050, ���� �� ������ �� ������ ���� ������������: �yp!")
# else:
# seconds = left.seconds % 60
# minutes = left.seconds / 60 % 60
# hours = left.seconds / 3600 % 24
# changeSig("������� ��-����� �� %d ���, %d ����, %d ������..." % (left.days, hours, minutes))
except:
print "exception"
sleepDuration = random.randint(120, 240)
print time.ctime(), "sleeping %dsec" % sleepDuration
time.sleep(sleepDuration) # seconds
print 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment