Respondiendo a la peticion de un amigo, les entrego este plugin:
Saludos
Código (cpp) [Seleccionar]
#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 meridiano.com.ve.so meridiano.com.ve.cpp
// Regex
// http.*\.meridiano\.com\.ve.*(\.swf|\.jpg|\.png|\.gif)
string get_filename(string url) {
vector<string> resultado;
string retorna = "";
stringexplode(url, "/", &resultado);
retorna = resultado.at(resultado.size()-2) + "-"+resultado.at(resultado.size()-1);
return retorna;
}
extern "C" resposta getmatch(const string url) {
resposta r;
if ( (url.find("meridiano.com.ve/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "meridiano";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Saludos