pluggin FUNCIONAN BIEN..SPEED.COM.DO
Cita de: kuichines en Noviembre 19, 2013, 11:07:14 PM
pluggin FUNCIONAN BIEN..SPEED.COM.DO
Gracias amigo por su aporte:
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o petardashd.com.so petardashd.com.cpp
// Regex
// http.*\petardashd\.com.*(\.swf|\.|\.mov|\.avi|\.mkv|\.jpg|\.png|\.mp4|\.flv)
string dominiotxt="petardasHD";
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()-3)+"_"+resultado.
at(resultado.size()-2)+"_"+resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-3)
+"_"+resultado.at(resultado.size()-2)+"_"+
resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find("petardashd.com/") !=
string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = dominiotxt;
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "../utils.cpp"
using namespace std;
// use this line to compile
// g++ -I. -fPIC -shared -g -o speed.com.do.so speed.com.do.cpp
// Regex
// http.*\.speed\.com\.do.*(\.swf|\.jpg|\.png|\.gif)
string dominiotxt="Claro Speed Test";
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()-3)+"_"+resultado.at(resultado.size()-2)+"_"+resultado.at(resultado.size()-1);
} else {
stringexplode(url, "/", &resultado);
return resultado.at(resultado.size()-3)+"_"+resultado.at(resultado.size()-2)+"_"+resultado.at(resultado.size()-1);
}
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find("speed.com.do/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = dominiotxt;
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Saludos