def quiz_guess(request, fact_id): message = [] if request.is_ajax(): print 'AJAX' #fact = get_object_or_404(Fact, id=fact_id) pagina = obtenerPagAleatoria() tweets = busqueda.buscarTweets('w3schools') message.append(tweets[1])#fact.type #message.append('Es obvio que Marla es una perra!') else: message.append("You're the lying type, I can just tell.") json = simplejson.dumps(message) return HttpResponse(json, mimetype='application/json')
def devuelve_tweets(request,search): if request.is_ajax(): print 'AJAX' #fact = get_object_or_404(Fact, id=fact_id) tweets = busqueda.buscarTweets(search) #message.append(tweets[1])#fact.type #message.append('Es obvio que Marla es una perra!') else: message.append("You're the lying type, I can just tell.") print tweets[0] print tweets[1] json = simplejson.dumps(tweets) return HttpResponse(json, mimetype='application/json')