2014-11-12 20:41:29 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import BaseHTTPServer
|
2015-04-19 18:41:24 -05:00
|
|
|
import application
|
2014-11-12 20:41:29 -06:00
|
|
|
from urlparse import urlparse, parse_qs
|
|
|
|
|
|
|
|
logged = False
|
|
|
|
verifier = None
|
|
|
|
|
|
|
|
class handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|
|
|
|
|
|
|
def do_GET(self):
|
|
|
|
global logged
|
|
|
|
self.send_response(200)
|
|
|
|
self.send_header("Content-type", "text/html")
|
|
|
|
self.end_headers()
|
|
|
|
logged = True
|
|
|
|
params = parse_qs(urlparse(self.path).query)
|
|
|
|
global verifier
|
|
|
|
verifier = params.get('oauth_verifier', [None])[0]
|
2015-04-19 18:41:24 -05:00
|
|
|
self.wfile.write("You have successfully logged into Twitter with" + application.name + ". "
|
2014-11-12 20:41:29 -06:00
|
|
|
"You can close this window now.")
|