Es un hosting de imágenes medianamente bueno y ultimamente muy usado en mi red:
#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 tinypic.com.so tinypic.com.cpp
// Regex
// http.*\.tinypic\.com.*(\.swf|\.jpg|\.png)
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(".tinypic.com/") != string::npos)
) {
r.file = get_filename(url);
if (!r.file.empty()) {
r.match = true;
r.domain = "tinypic";
} else {
r.match = false;
}
}
else
{
r.match = false;
}
return r;
}
Saludos
Plugin funcionando sin problemas, Saludos