Esempio n. 1
0
def getBacklinks(request):

    alexa = Alexa()
    google = Google()
    data = {'valor': {}, 'paso': 1}
    backlinks = {'google': 0, 'alexa': 0}

    try:

        #self.session = Session()
        #dominio = self.session['dominio']
        #dominio = request.session['dominio']
        dominio = dominio_global
        data_tmp = alexa.getAlexaRank(dominio)
        backlinks['alexa'] = data_tmp['backlinks']
        backlinks['google'] = google.getNumBacklinks(dominio).replace(',', '')

        data['valor'] = backlinks

        return HttpResponse(json.dumps(data), content_type="application/json")

    except Exception as e:
        print str(e)

        return redirect('/')
Esempio n. 2
0
def getBacklinks (request):

    alexa = Alexa()
    google = Google()
    data = {'valor':{} , 'paso': 1}
    backlinks = {'google':0, 'alexa': 0}

    try:

        #self.session = Session()
        #dominio = self.session['dominio']
        #dominio = request.session['dominio']
        dominio = dominio_global
        data_tmp = alexa.getAlexaRank(dominio)
        backlinks['alexa'] = data_tmp['backlinks']
        backlinks['google'] = google.getNumBacklinks(dominio).replace(',','')

        data['valor'] = backlinks

        return HttpResponse(json.dumps(data), content_type="application/json")

    except Exception as e:
        print str(e)

        return redirect('/')
Esempio n. 3
0
def getTrafic(request):
    global dominio_global
    alexa = Alexa()
    data = {'valor': {}, 'paso': 1}

    try:
        dominio = dominio_global
        data['valor'] = alexa.getAlexaRank(dominio)
        return HttpResponse(json.dumps(data), content_type="application/json")

    except:
        return redirect('/')
Esempio n. 4
0
def getTrafic (request):
    global dominio_global
    alexa = Alexa()
    data = {'valor':{}, 'paso': 1}

    try:
        dominio = dominio_global
        data['valor'] = alexa.getAlexaRank(dominio)
        return HttpResponse(json.dumps(data), content_type="application/json")

    except:
        return redirect('/')