Plugin Disneylatino.com

Publicado por btocarmona, Noviembre 03, 2012, 11:52:47 PM

Tema anterior - Siguiente tema

btocarmona

Asi es gente no hay mucho mas para decir tengo mi pesado hijo que le encantan estos jueguitos pero mi server tiene un escaso ancho de banda satelital, asi que me puse a crearlo para que mi enano no se duerma esperando que carguen los juegos jaja. espero les sirva gente.

Se los dejo

[spoiler]#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"



// use this line to compile
// g++ -I. -fPIC -shared -g -o disneylatino.com.so disneylatino.com.cpp
// regex
// http.*\.disneylatino\.com.*(\.jpg|\.swf|\.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(".disneylatino.com") != string::npos) and (url.find(".jpg") != string::npos) or (url.find(".swf") != string::npos) or (url.find(".gif") != string::npos)
   ) {
     
       r.file = get_filename(url);
      if (!r.file.empty()) {
         r.match = true;
         r.domain = "DISNEY";
      } else {
         r.match = false;
      }
   } else {
      r.match = false;
   }
   return r;
}

lervis

Disculpa viejo ese es para el de 64 o 32 bits porq lo he intentado poner y no me da sale un monton de letras locas jejeje

cope
/usr/include/c++/4.4/istream:620: error: expected primary-expression before â__delimâ
/usr/include/c++/4.4/istream:620: error: initializer expression list treated as compound expression
In file included from /usr/include/c++/4.4/istream:830,
                 from /usr/include/c++/4.4/iostream:41,
                 from ../utils.cpp:17,
                 from disneylatino.com.cpp:4:
/usr/include/c++/4.4/bits/istream.tcc: In member function âtypename std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::get()â:
/usr/include/c++/4.4/bits/istream.tcc:190: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(_CharT&)â:
/usr/include/c++/4.4/bits/istream.tcc:224: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: At global scope:
/usr/include/c++/4.4/bits/istream.tcc:259: error: âstreamsizeâ has not been declared
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(_CharT*, int, _CharT)â:
/usr/include/c++/4.4/bits/istream.tcc:261: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(std::basic_streambuf<_CharT, _Traits>&, _CharT)â:
/usr/include/c++/4.4/bits/istream.tcc:308: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: At global scope:
/usr/include/c++/4.4/bits/istream.tcc:350: error: âstreamsizeâ has not been declared
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(_CharT*, int, _CharT)â:
/usr/include/c++/4.4/bits/istream.tcc:352: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignore()â:
/usr/include/c++/4.4/bits/istream.tcc:412: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: At global scope:
/usr/include/c++/4.4/bits/istream.tcc:443: error: âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignoreâ is not a static member of âclass std::basic_istream<_CharT, _Traits>â
/usr/include/c++/4.4/bits/istream.tcc:443: error: template definition of non-template âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignoreâ
/usr/include/c++/4.4/bits/istream.tcc:443: error: âstreamsizeâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:505: error: âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignoreâ is not a static member of âclass std::basic_istream<_CharT, _Traits>â
/usr/include/c++/4.4/bits/istream.tcc:505: error: template definition of non-template âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignoreâ
/usr/include/c++/4.4/bits/istream.tcc:505: error: âstreamsizeâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:505: error: expected primary-expression before â__delimâ
/usr/include/c++/4.4/bits/istream.tcc: In member function âtypename std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT, _Traits>::peek()â:
/usr/include/c++/4.4/bits/istream.tcc:573: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: At global scope:
/usr/include/c++/4.4/bits/istream.tcc:600: error: âstreamsizeâ has not been declared
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::read(_CharT*, int)â:
/usr/include/c++/4.4/bits/istream.tcc:602: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: At global scope:
/usr/include/c++/4.4/bits/istream.tcc:628: error: expected constructor, destructor, or type conversion before âbasic_istreamâ
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::putback(_CharT)â:
/usr/include/c++/4.4/bits/istream.tcc:665: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: In member function âstd::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::unget()â:
/usr/include/c++/4.4/bits/istream.tcc:698: error: â_M_gcountâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc: In function âstd::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)â:
/usr/include/c++/4.4/bits/istream.tcc:893: error: âstreamsizeâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:893: error: expected â;â before â__extractedâ
/usr/include/c++/4.4/bits/istream.tcc:901: error: expected â;â before â__numâ
/usr/include/c++/4.4/bits/istream.tcc:902: error: â__numâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:903: error: âstreamsizeâ cannot appear in a constant-expression
/usr/include/c++/4.4/bits/istream.tcc:903: error: template argument 1 is invalid
/usr/include/c++/4.4/bits/istream.tcc:911: error: â__extractedâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:911: error: â__numâ was not declared in this scope
/usr/include/c++/4.4/bits/istream.tcc:936: error: â__extractedâ was not declared in this scope
In file included from /usr/include/c++/4.4/bits/stl_algobase.h:69,
                 from /usr/include/c++/4.4/vector:61,
                 from disneylatino.com.cpp:3:
/usr/include/c++/4.4/bits/stl_iterator.h: At global scope:
/usr/include/c++/4.4/bits/stl_iterator.h: In instantiation of â__gnu_cxx::__normal_iterator<const char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >â:
../utils.cpp:28:   instantiated from here
/usr/include/c++/4.4/bits/stl_iterator.h:679: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:730: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:734: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:738: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:742: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:746: error: no type named âdifference_typeâ in âstruct std::iterator_traits<const char*>â
/usr/include/c++/4.4/bits/stl_iterator.h: In instantiation of â__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >â:
../utils.cpp:28:   instantiated from here
/usr/include/c++/4.4/bits/stl_iterator.h:679: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:730: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:734: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:738: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:742: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h:746: error: no type named âdifference_typeâ in âstruct std::iterator_traits<char*>â
/usr/include/c++/4.4/bits/stl_iterator.h: In instantiation of â__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >â:
/usr/include/c++/4.4/bits/stl_vector.h:741:   instantiated from âvoid std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]â
../utils.cpp:95:   instantiated from here
/usr/include/c++/4.4/bits/stl_iterator.h:679: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_iterator.h:730: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_iterator.h:734: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_iterator.h:738: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_iterator.h:742: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_iterator.h:746: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
In file included from /usr/include/c++/4.4/vector:69,
                 from disneylatino.com.cpp:3:
/usr/include/c++/4.4/bits/vector.tcc: In member function âvoid std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]â:
/usr/include/c++/4.4/bits/stl_vector.h:741:   instantiated from âvoid std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]â
../utils.cpp:95:   instantiated from here
/usr/include/c++/4.4/bits/vector.tcc:321: error: no match for âoperator-â in â__position - std::vector<_Tp, _Alloc>::begin [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]()â
In file included from /usr/include/c++/4.4/vector:61,
                 from disneylatino.com.cpp:3:
/usr/include/c++/4.4/bits/stl_algobase.h: In static member function âstatic _BI2 std::__copy_move_backward<false, false, std::random_access_iterator_tag>::__copy_move_b(_BI1, _BI1, _BI2) [with _BI1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, _BI2 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*]â:
/usr/include/c++/4.4/bits/stl_algobase.h:595:   instantiated from â_BI2 std::__copy_move_backward_a(_BI1, _BI1, _BI2) [with bool _IsMove = false, _BI1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, _BI2 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*]â
/usr/include/c++/4.4/bits/stl_algobase.h:605:   instantiated from â_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = false, _BI1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, _BI2 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*]â
/usr/include/c++/4.4/bits/stl_algobase.h:640:   instantiated from â_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, _BI2 = std::basic_string<char, std::char_traits<char>, std::allocator<char> >*]â
/usr/include/c++/4.4/bits/vector.tcc:308:   instantiated from âvoid std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]â
/usr/include/c++/4.4/bits/stl_vector.h:741:   instantiated from âvoid std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]â
../utils.cpp:95:   instantiated from here
/usr/include/c++/4.4/bits/stl_algobase.h:544: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_algobase.h:544: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_algobase.h:544: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â
/usr/include/c++/4.4/bits/stl_algobase.h:544: error: no type named âdifference_typeâ in âstruct std::iterator_traits<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*>â



porq sera disculpa q te moleste

luistec

Eso se debe a que en el codigo de fuente puso una etiqueta que esta porgusto([spoiler]), por eso se recomienda al publicar un codigo de fuente que se utilice las etiqueta code (code  /code), entonces el codigo sería


#include <iostream>
#include <cstring>
#include <vector>
#include "../utils.cpp"
// use this line to compile
// g++ -I. -fPIC -shared -g -o disneylatino.com.so disneylatino.com.cpp
// regex
// http.*\.disneylatino\.com.*(\.jpg|\.swf|\.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(".disneylatino.com") != string::npos) and (url.find(".jpg") != string::npos) or (url.find(".swf") != string::npos) or (url.find(".gif") != string::npos)
  ) {
     
      r.file = get_filename(url);
     if (!r.file.empty()) {
        r.match = true;
        r.domain = "DISNEY";
     } else {
        r.match = false;
     }
  } else {
     r.match = false;
  }
  return r;
}


Saludos.

lervis

Gracias luis ya pruebo y comento espero q si no es mucha la molestia me ayudes  con lo de aprender a hacer los plugin creo q eres de venezuela pues e visto ese seudonimo en otros foros creo q en uno venezolano.. la idea es poder aportar no me gusta solo pedir ayuda si no tambien colaborar..

gracias a TODOS

lervis

Q bien listo Ahora sip lo pude colocar menos mal ambos ayudaron el pana btcarmona con su buena idea del plugin y el pana luis para pulirlo ahora ya ni pequeño socio y heredero tendra mas tranquilidad porq me tenia loco cuando hiba a jugar en la pagina esa es fanatico de esos juegos y apenas tiene 3 años... jejej maneja mas el internet q la mama ... jejeje

gracias muchachos