Buenas amigo firecold espero te encuentres bien hermano, queria solicitar su gran ayuda para la creación de 3 plugin o si algún compañero del foro que los tenga en producción y los pueda compartir.. saludos a todos... espero por su pronta ayuda..
http://www.cadivi.gob.ve/
http://www.seniat.gob.ve/
http://www.inces.gob.ve/
Buenas Amigo Aqui Acabo De Hacerte 2 de los plugins probado y cacheando
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o seniat.gob.ve.so seniat.gob.ve.cpp
// regex
// http.*\.seniat\.gob\.ve.*(\.gif|\.jpg|\.png|\.swf)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".seniat.gob.ve") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "seniat";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o cadivi.gob.ve.so cadivi.gob.ve.cpp
// regex
// http.*\.cadivi\.gob\.ve.*(\.jpg|\.png|\.gif)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".cadivi.gob.ve/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos) or (url.find(".gif") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "Cadivi";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
el del ince no lo probe pero dime si te cachea
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o inces.gob.ve.so inces.gob.ve.cpp
// regex
// http.*\.inces\.gob\.ve.*(\.jpg|\.png|\.gif)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".inces.gob.ve/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos) or (url.find(".gif") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "inces";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
Comenta Si te Funcionaron Saludos :)
Cita de: JoseM14 en Octubre 23, 2013, 06:10:42 PM
Buenas Amigo Aqui Acabo De Hacerte 2 de los plugins probado y cacheando
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o seniat.gob.ve.so seniat.gob.ve.cpp
// regex
// http.*\.seniat\.gob\.ve.*(\.gif|\.jpg|\.png|\.swf)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".seniat.gob.ve") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "seniat";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o cadivi.gob.ve.so cadivi.gob.ve.cpp
// regex
// http.*\.cadivi\.gob\.ve.*(\.jpg|\.png|\.gif)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".cadivi.gob.ve/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos) or (url.find(".gif") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "Cadivi";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
el del ince no lo probe pero dime si te cachea
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o inces.gob.ve.so inces.gob.ve.cpp
// regex
// http.*\.inces\.gob\.ve.*(\.jpg|\.png|\.gif)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".inces.gob.ve/") != string::npos) and ((url.find(".jpg") != string::npos) or (url.find(".png") != string::npos) or (url.find(".gif") != string::npos))
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "inces";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
Comenta Si te Funcionaron Saludos :)
Gracias amigo por participar y colaborar en este foro, Bienvenido y espero que te puedas beneficiar con este proyecto, Saludos
Muchas gracias hermano por su gran ayuda, le estaré comentando como me va con los plugin.. saludos..
para que se vea màs elegante los còdigos : click en el signo numeral luego poner al lado de code=cpp
entonces aparecerà asi :
#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o seniat.gob.ve.so seniat.gob.ve.cpp
// regex
// http.*\.seniat\.gob\.ve.*(\.gif|\.jpg|\.png|\.swf)
string get_filename(string url) {
vector<string> resultado;
if (url.find("?") != string::npos) {
stringexplode(url, "?", &resultado);
stringexplode(resultado.at(resultado.size()-2), "/", &resultado);
return resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find(".seniat.gob.ve") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "seniat";
} else {
r.match = false;
}
} else {
r.match = false;
}
return r;
}
Saludos
Buenos aportes
De Nada Amigo y Bueno Amigo David y firecold Estare al Pendiente Para ver Como lo Hago Mas Elegante jejeje :)
excelente felicidades viejo.... gracias
me funciona perfecto, pero no me aparece en la parte de "contenido cache" por que sera? lo mismo me pasa con otros dominios
ahora me hace cache seniat perfecto, pero cadivi solo 3 items.. osea 3 archivos png y ya.. mas nada.. usando el regexp que esta en el cpp