Query visit a profile for OKC implemented

This commit is contained in:
Ahmed Boussadia 2014-05-07 15:02:07 +02:00 committed by Romain Bignon
commit 641bbf7a7a
4 changed files with 61 additions and 27 deletions

View file

@ -252,3 +252,22 @@ class OkCBrowser(BaseBrowser):
# return True
# except ValueError:
# return False
@check_login
def visit_profile(self, id):
self.location(self.absurl('/profile/%s' % id))
stalk, u, tuid = self.page.get_visit_button_params()
if stalk and u and tuid:
# Premium users, need to click on "visit button" to let the other person know his profile was visited
data = urllib.urlencode({
'ajax' : 1,
'stalk': stalk,
'u':u,
'tuid': tuid
})
self.addheaders = [('Referer', self.page.url), ('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8')]
self.open('http://m.okcupid.com/profile', data=data)
return True