El algoritmo del PageRank Español
Miércoles 2 de Agosto del 2006 - Humor, Miscelánea
PHP:
-
function getPagerank(url)
-
{
-
// comenzamos con un valor PR aleatorio
-
pagerank = randomNumber(0, 3);
-
-
if ( pageHostedOn(url, 'google.es') ) {
-
pagerank++;
-
}
-
else if ( pageHostedOn(url, 'microsoft.es') ) {
-
pagerank–;
-
}
-
-
if ( pageValidates(url) ) {
-
pagerank *= .5;
-
}
-
-
tag_value['b'] = 1;
-
tag_value['h2'] = 2;
-
tag_value['h1'] = 3;
-
tag_value['strong'] = -1; // Los del W3C son basura...
-
pagerank = calculateTagsPr(tag_value, pagerank);
-
-
// Sergey dice que los sitios chulos de noticias
-
// usan montones de tablas
-
tablesOnPage = getTagCount('table');
-
if (tablesOnPage>= 50) {
-
pagerank += 2;
-
}
-
-
if (pagerank>= 5) {
-
pagerank = 4; // ayuda a vender AdWords
-
}
-
-
if ( linksFrom('mattcutts.com', url)>= 4 ) {
-
// "Yo sólo enlazo sitios limpios"
-
// – Matt, Feb 2006
-
pagerank += 2;
-
}
-
-
pagerank += countBacklinks(url) / 10000;
-
-
blacklist1 = getList('government.cn/censored.txt');
-
blacklist2 = getList('c: \ larry-page-hatelist.txt');
-
if ( inArray(blacklist1, url) ||
-
inArray(blacklist2, url) ) {
-
pagerank = 0;
-
}
-
-
d = dashesInUrl(url);
-
pagerank = (d>= 3) ? pagerank -1 : pagerank + 1;
-
-
if ( inString(url, 'orquesta mondragón') &
-
(inString(url,'furgoneta')) {
-
// añadido por presión de los EEUU - 2004-12-01.
-
recipient = 'rubalcaba@politicos.es';
-
subject = 'Posible terrorista, deberías ver esto…';
-
sendMailTo(recipient, subject, url);
-
// aún asi quizá sea relevante... por si acaso...
-
pagerank++;
-
}
-
-
if ( inString(title, 'beta') ) {
-
recipient = 'inversiones@informacion-interactiva.com';
-
subject = 'Si compraste Fresqui... deberías mirar esto…';
-
sendMailTo(recipient, subject, url);
-
pagerank++;
-
}
-
-
// ¿¿¿ Has puesto tú esto, Sergei ???
-
// Ahora me explico muchas cosas...
-
if ( inString(title, 'koala') or inString(title, 'opá') ) {
-
pagerank++;
-
}
-
-
if ( month() == 'Junio' || month() == 'Octubre' ) {
-
// hace que la gente hable de bailes de google
-
// y actualizaciones de PR, da publicidad gratis
-
pagerank -= randomNumber(1,3);
-
}
-
-
if ( linkCol(url) == WHITE &&
-
pageCol(url) == WHITE ) {
-
// Hijo del SPAM ! MUERE !!!!
-
pagerank = 0;
-
}
-
-
if (url == 'http://www.webpositer.com') {
-
// esto es una prueba, borrar mañana
-
// – Frank, 3 de Junio de 2003
-
pagerank = 10;
-
}
-
-
return pagerank;
-
}
Recogido, compilado, adaptado y traducido de varias fuentes
Términos relacionados: tag value, chulos, pagerank, google, algoritmo, larry page, aleatorio, koala, inversiones, adwords