-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
7 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
print("Content-Type: text/html\n") | ||
import mysql.connector | ||
import json | ||
|
||
MAXIMO_DOMINIOS_A_LISTAR = 4 | ||
|
||
mydb = mysql.connector.connect( | ||
host="localhost", | ||
user="terrassahash", | ||
passwd="HOMzOnzFaoBqvSk7", | ||
db="terrassahash", | ||
port=3306 | ||
) | ||
|
||
def obtenerListadoDominios( maximoLineas): | ||
"Obtenemos los ultimos analisis realizados en nuestra bd" | ||
mycursor = mydb.cursor() | ||
mycursor.execute("SELECT nombreDominio FROM dominio ORDER BY fecha DESC LIMIT " + str(maximoLineas)) | ||
|
||
resultado = [] | ||
for item in mycursor: | ||
resultado.append(item); | ||
return resultado | ||
|
||
resultado = {} | ||
|
||
resultado["respuesta"] = obtenerListadoDominios(MAXIMO_DOMINIOS_A_LISTAR) | ||
|
||
print(json.dumps(resultado)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
negro,fuego,tiroteo,blanco,tirar,asesinato,amarillo,golpe,suicidio,gitano,dispara,paliza,bandas,puto,nazi,agresor,mono,esclavo,certificado,denuncia,lotería,barcelona | ||
1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,1, 2, 3,2,1,1,1 | ||
|
||
negro, negra, mercado, odio, puto, putos, puta, putas, moros, cago, gilipollas, manteros, chupar, cojones, invasor, terrorista, muerte, muera, sangre, panchi, asqueroso, sudaca, raza, matarlos, Franco, matar, reviento, agrede, meca, machete, chabola, negrito, hijo, ilegal, indigente, inferior, peste, zorra, perra, cabrón, immigrante, pobre, sucio, orco, sobras, mueran, negrita, hija ,moro, culo | ||
2,2,1,1,3,3,3,3,3,1,2,1,2,2,3,3,3,3,3,1,1,1,2,3,3,3,1,1,2,3,1,1,3,2,2,1,2,3,3,3,2,2,1,1,1,2,3,2,2,4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
function getAjax(url,success){ | ||
var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); | ||
xhr.open('GET', url); | ||
function getAjax() { | ||
$.ajax({ | ||
url: "../../obtenerListadoDominios.py", | ||
type: "GET", | ||
success: function (response) { | ||
alert(response); | ||
var obj = JSON.parse(response); | ||
}, | ||
error: function (xhr, ajaxOptions, thrownError) { | ||
alert(xhr.status); | ||
alert(thrownError); | ||
} | ||
}) | ||
} | ||
|
||
} | ||
|
||
|
||
getAjax(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters