Plugin http://deviantart.net
#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 deviantart.net.so deviantart.net.cpp
// Regex
// http.*\.deviantart\.net.*(\.swf|\.jpg|\.png|\.gif|\.mp3|\.rar|\.zip|\.tar|\.gz|\.flv|\.mp4)
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("deviantart.net/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "DeviantArt";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Saludos
Plugin funcionando sin problemas hasta el momento, es uno de los mas recomendables, ahora esta pagina se ha vuelto muy concurrida, saludos