fbpx
Wikipedia

Módulo:Ficha de sitio web

Este módulo no tiene página de documentación[crear]
local p = {} local ModuloArgumentos = require('Módulo:Argumentos') local ModuloFicha = require('Módulo:Ficha') local ModuloWikidata = require('Módulo:Wikidata') local ModuloPaginas = require('Módulo:Páginas') local elementoTabla = require('Módulo:Tablas').elemento --local FormatNum = require('Módulo:Formatnum') local argumentos local Entidadale  function p.Ficha(frame)  -- :: Inicializador  argumentos = ModuloArgumentos.obtenerArgumentosConValor(frame)  Entidad = mw.wikibase.getEntity(argumentos.entidad) or mw.wikibase.getEntity(argumentos.id) or {}   -- :: Cabecera  local Titulo = argumentos['nombre'] or obtenerEtiquetaWikidata() or ModuloPaginas.nombrePagina({desambiguar='sí'})   local Captura = argumentos['captura']  local Pie   if Captura then  Pie = argumentos['pie'] or ''  else  Captura, Pie = obtenerImagenWikidata('P18')  end   if Pie then  Pie = '<span style="font-size:smaller">' .. Pie .. '</span>'  end   local Tamano = argumentos['tamaño'] or '250px'   local Logo = argumentos['logo'] or obtenerImagenWikidata('P154') or ''  local TamanoLogo = argumentos['tamaño logo'] or argumentos['tamaño_logo'] or '150px'   -- :: Datos generales  local URL = argumentos['url'] or propiedad('P856',{['enlace']='no', uno='sí'})  local Eslogan = argumentos['eslogan'] or propiedad('P6291',{['lista'] = 'nobullet'}) or ''  local Tipo = argumentos['tipo'] or propiedad('P31', {['uno'] = 'sí'}) or ''  local Creador = argumentos['creador'] or argumentos['autor'] or propiedad('P170', {['uno'] = 'sí'}) or ''  local Propietario = argumentos['propietario'] or propiedad('P127', {['uno'] = 'sí'}) or ''  local Operador = argumentos['adoptada por'] or propiedad('P137', {['uno'] = 'sí'}) or ''  local Pais = argumentos['país'] or propiedad('P495', {['uno'] = 'sí'}) or ''  local Licencia = argumentos['licencia'] or propiedad('P275', {['lista'] = 'nobullet'}) or ''  local Plataforma = argumentos['plataforma'] or propiedad('P400', {['lista'] = 'nobullet'}) or ''   local Dominio  if URL then  Dominio = '<span class="plainlinks">[' .. URL .. ' ' .. URL:match('^%w+://([^/]+)') .. ']</span>'  end   local Comercial = argumentos['comercial']  if Comercial then  if Comercial == 'No' or Comercial == 'no' or Comercial == '{{No}}' or Comercial == '{{no}}' then  Comercial = frame:preprocess('{{no}}')  else  Comercial = frame:preprocess('{{sí}}')  end  end   local Registro = argumentos['registro']  if Registro then  if Registro == 'No' or Comercial == 'no' or Comercial == '{{No}}' or Comercial == '{{no}}' then  Registro = frame:preprocess('{{no}}')  else  Registro = frame:preprocess('{{sí}}')  end  end   -- :: Idiomas  local Idiomas = argumentos['idiomas'] or argumentos['idioma'] or propiedad('P407', {['lista'] = 'nobullet'}) or ''  if string.len(Idiomas) > 200 then  Idiomas = seccionDesplegable('[[Multilingüe]]', Idiomas, frame)  end   local Espanol = argumentos['español'] or argumentos['castellano'] or esUnValor(Entidad, 'P407', 'Q1321')  if Espanol then  Espanol = frame:preprocess('{{sí}}')  else  Espanol = frame:preprocess('{{no}}')  end   -- :: Estadísticas  local Usuarios = argumentos['usuarios'] or propiedad('P1833', {['lista'] = 'nobullet'}) or ''  local Ingresos = argumentos['ingresos'] or propiedad('P2139', {['lista'] = 'nobullet'}) or ''  local Alexa = argumentos['alexa'] or propiedad('P1661', {['lista'] = 'nobullet'})  --if Alexa then  -- Alexa = FormatNum.FormatNum(Alexa)  --end   local Estado = argumentos['estado actual'] or argumentos['estado_actual'] or argumentos['estadoactual']  if Estado == 'activo' then  Estado = '{{Sí|Activo}}'  elseif Estado == 'inactivo' then  Estado = '{{No|Inactivo}}'  end   -- :: Fechas  local Lanzamiento = argumentos['fecha_de_lanzamiento'] or argumentos['fecha lanzamiento'] or argumentos['fechalanzamiento'] or argumentos['lanzamiento'] or propiedad('P571', {['linkback'] = 'no'}) or ''  local Relanzamiento = argumentos['relanzamiento'] or argumentos['ffecharelanzamiento'] or ''  local Cierre = argumentos['cierre'] or argumentos['fechacierre'] or propiedad('P2669', {['linkback'] = 'no'}) or ''   -- :: La ficha  local TablaFicha = {  entidad = argumentos.id,  titulo = Titulo,  clasetitulo = 'comunicación',  estilotitulo = 'background-color: #DCEAEC; color:#000;',  estiloseccion = 'background-color: #DCEAEC; color:#000;',  estiloetiqueta = 'background-color: #DCEAEC; width:35%',  estilodatos = 'width:65%',  imagen = Logo,  ['tamañoimagen'] = TamanoLogo,  imagen2 = Captura,  ['tamañoimagen2'] = Tamano,  pie2 = Pie,  estilopie2 = 'font-size:88%',  {tipo='sección',  titulo = 'Información general',  {'[[Dominio de Internet|Dominio]]', Dominio},  {'Tipo', Tipo},  {'[[Desarrollador de software|Desarrollador]]', Creador},  {'Propietario', Propietario},  {'Operador', Operador},  {'País de origen', Pais},  {'¿Comercial?', Comercial},  {'¿Requiere registro?', Registro},  {'Idiomas disponibles', Idiomas},  {'¿En español?', Espanol},  },  {tipo='sección',  estilodatos = 'text-align:left',  titulo = 'Datos técnicos',  {'Software utilizado', Software},  {'Plataforma', Plataforma},  {'Licencia', Licencia},  },  {tipo='sección',  estilodatos = 'text-align:left',  titulo = 'Datos históricos',  {'Estado actual', Estado},  {'Lanzamiento', Lanzamiento},  {'Relanzamiento', Relanzamiento},  {'Cierre', Cierre},  },  {tipo='sección',  estilodatos = 'text-align:left',  titulo = 'Estadísticas',  {'Usuarios registrados', Registrados},  {'Ranking [[Alexa Internet|Alexa]]', Alexa},  {'Ingresos', Ingresos},  },  {tipo='sección',  titulo = 'Artículos relacionados',  {'', OtrosArticulos}  },  }  return ModuloFicha.infobox(TablaFicha) end  function obtenerEtiquetaWikidata()  if Entidad and Entidad.labels and Entidad.labels.es then  return Entidad.labels.es.value  end end  function obtenerImagenWikidata(propiedad)  local imagen, valorImagen, piesDeImagen, k, pieDeImagen  if not Entidad then  return  end  -- Obtener la primera imagen en Wikidata de la persona  local imagen = elementoTabla(Entidad, 'claims', propiedad,1)  if not imagen then  return  end  valorImagen = elementoTabla(imagen, 'mainsnak','datavalue','value')  piesDeImagen = elementoTabla(imagen, 'qualifiers','P2096')  -- Encontrar el pie en español  if piesDeImagen then  for k,pieDeImagen in pairs(piesDeImagen) do  if pieDeImagen.datavalue.value.language == 'es' then  return valorImagen, pieDeImagen.datavalue.value.text  end  end  end  -- Si no hay pie de imagen en español comprueba si hay fecha especificada para la imagen  piesDeImagen = elementoTabla(imagen, 'qualifiers', 'P585')  if piesDeImagen and piesDeImagen[1] then  return valorImagen, nombre .. ' en ' .. require('Módulo:Wikidata/Fecha').FormateaFechaHora(piesDeImagen[1].datavalue.value, {['formatoFecha']='año',['enlace']='no'})  end  -- Sin pie de imagen en español  return valorImagen end  function propiedad(idPropiedad,opciones)  if Entidad and Entidad.claims and Entidad.claims[idPropiedad] then  if not opciones then  opciones = {['linkback']='sí'}  end  opciones.entityId = Entidad.id  opciones.propiedad = idPropiedad  valorPropiedad = ModuloWikidata.getPropiedad(opciones,Entidad.claims[idPropiedad])  return valorPropiedad  end end  function esUnValor(entidad, idPropiedad, idaBuscar)  if not entidad or not idPropiedad then  return false  end   local declaracion = elementoTabla(entidad, 'claims', idPropiedad)  local idBuscado  if not declaracion then  return false  end   for k,v in pairs(declaracion) do  idBuscado = elementoTabla(v,'mainsnak','datavalue','value','id')  if idBuscado == idaBuscar then  return true  end  end  return false end  function listaDesplegable(titulo, lista, frame)  if not lista then  return  end  return frame:preprocess('{{Lista desplegable|align=left|título='..titulo .. '|1='..lista..'}}') end  function seccionDesplegable(titulo, lista, frame)  if not lista then  return  end  return frame:preprocess('{{Sección desplegable|align=left|título=' .. titulo .. '|datos='.. lista .. '}}') end  function capitalizar(cad)  return string.upper(string.sub(cad,1,1)) .. string.sub(cad,2) end  function obtenerEnumCalculado(entidad)  local valc  for k,v in ipairs(clasificacionValores) do  valc = esUnValor(entidad, v[0], v[1])  if valc then  return v[2]  end  end end  function obtenerValor(entidad, idPropiedad, idValor)  local valor = {}  if not entidad or not idPropiedad or not idValor then  return valor  end   local declaracion = elementoTabla(entidad, 'claims', idPropiedad)  if declaracion then  for k, v in pairs(declaracion) do  local propBuscado = elementoTabla(v, 'mainsnak', 'datavalue', 'value', 'id')  if propBuscado == idValor then  table.insert(valor, v)  end  end  end   return valor end  return p 

módulo, ficha, sitio, este, módulo, tiene, página, documentación, crear, módulo, ficha, sitio, código, discusión, tests, comprobar, tests, subpáginas, enlaces, local, local, moduloargumentos, require, módulo, argumentos, local, moduloficha, require, módulo, fi. Este modulo no tiene pagina de documentacion crear Modulo Ficha de sitio web codigo doc discusion tests comprobar tests subpaginas enlaces local p local ModuloArgumentos require Modulo Argumentos local ModuloFicha require Modulo Ficha local ModuloWikidata require Modulo Wikidata local ModuloPaginas require Modulo Paginas local elementoTabla require Modulo Tablas elemento local FormatNum require Modulo Formatnum local argumentos local Entidadale function p Ficha frame Inicializador argumentos ModuloArgumentos obtenerArgumentosConValor frame Entidad mw wikibase getEntity argumentos entidad or mw wikibase getEntity argumentos id or Cabecera local Titulo argumentos nombre or obtenerEtiquetaWikidata or ModuloPaginas nombrePagina desambiguar si local Captura argumentos captura local Pie if Captura then Pie argumentos pie or else Captura Pie obtenerImagenWikidata P18 end if Pie then Pie lt span style font size smaller gt Pie lt span gt end local Tamano argumentos tamano or 250px local Logo argumentos logo or obtenerImagenWikidata P154 or local TamanoLogo argumentos tamano logo or argumentos tamano logo or 150px Datos generales local URL argumentos url or propiedad P856 enlace no uno si local Eslogan argumentos eslogan or propiedad P6291 lista nobullet or local Tipo argumentos tipo or propiedad P31 uno si or local Creador argumentos creador or argumentos autor or propiedad P170 uno si or local Propietario argumentos propietario or propiedad P127 uno si or local Operador argumentos adoptada por or propiedad P137 uno si or local Pais argumentos pais or propiedad P495 uno si or local Licencia argumentos licencia or propiedad P275 lista nobullet or local Plataforma argumentos plataforma or propiedad P400 lista nobullet or local Dominio if URL then Dominio lt span class plainlinks gt URL URL match w lt span gt end local Comercial argumentos comercial if Comercial then if Comercial No or Comercial no or Comercial No or Comercial no then Comercial frame preprocess no else Comercial frame preprocess si end end local Registro argumentos registro if Registro then if Registro No or Comercial no or Comercial No or Comercial no then Registro frame preprocess no else Registro frame preprocess si end end Idiomas local Idiomas argumentos idiomas or argumentos idioma or propiedad P407 lista nobullet or if string len Idiomas gt 200 then Idiomas seccionDesplegable Multilingue Idiomas frame end local Espanol argumentos espanol or argumentos castellano or esUnValor Entidad P407 Q1321 if Espanol then Espanol frame preprocess si else Espanol frame preprocess no end Estadisticas local Usuarios argumentos usuarios or propiedad P1833 lista nobullet or local Ingresos argumentos ingresos or propiedad P2139 lista nobullet or local Alexa argumentos alexa or propiedad P1661 lista nobullet if Alexa then Alexa FormatNum FormatNum Alexa end local Estado argumentos estado actual or argumentos estado actual or argumentos estadoactual if Estado activo then Estado Si Activo elseif Estado inactivo then Estado No Inactivo end Fechas local Lanzamiento argumentos fecha de lanzamiento or argumentos fecha lanzamiento or argumentos fechalanzamiento or argumentos lanzamiento or propiedad P571 linkback no or local Relanzamiento argumentos relanzamiento or argumentos ffecharelanzamiento or local Cierre argumentos cierre or argumentos fechacierre or propiedad P2669 linkback no or La ficha local TablaFicha entidad argumentos id titulo Titulo clasetitulo comunicacion estilotitulo background color DCEAEC color 000 estiloseccion background color DCEAEC color 000 estiloetiqueta background color DCEAEC width 35 estilodatos width 65 imagen Logo tamanoimagen TamanoLogo imagen2 Captura tamanoimagen2 Tamano pie2 Pie estilopie2 font size 88 tipo seccion titulo Informacion general Dominio de Internet Dominio Dominio Tipo Tipo Desarrollador de software Desarrollador Creador Propietario Propietario Operador Operador Pais de origen Pais Comercial Comercial Requiere registro Registro Idiomas disponibles Idiomas En espanol Espanol tipo seccion estilodatos text align left titulo Datos tecnicos Software utilizado Software Plataforma Plataforma Licencia Licencia tipo seccion estilodatos text align left titulo Datos historicos Estado actual Estado Lanzamiento Lanzamiento Relanzamiento Relanzamiento Cierre Cierre tipo seccion estilodatos text align left titulo Estadisticas Usuarios registrados Registrados Ranking Alexa Internet Alexa Alexa Ingresos Ingresos tipo seccion titulo Articulos relacionados OtrosArticulos return ModuloFicha infobox TablaFicha end function obtenerEtiquetaWikidata if Entidad and Entidad labels and Entidad labels es then return Entidad labels es value end end function obtenerImagenWikidata propiedad local imagen valorImagen piesDeImagen k pieDeImagen if not Entidad then return end Obtener la primera imagen en Wikidata de la persona local imagen elementoTabla Entidad claims propiedad 1 if not imagen then return end valorImagen elementoTabla imagen mainsnak datavalue value piesDeImagen elementoTabla imagen qualifiers P2096 Encontrar el pie en espanol if piesDeImagen then for k pieDeImagen in pairs piesDeImagen do if pieDeImagen datavalue value language es then return valorImagen pieDeImagen datavalue value text end end end Si no hay pie de imagen en espanol comprueba si hay fecha especificada para la imagen piesDeImagen elementoTabla imagen qualifiers P585 if piesDeImagen and piesDeImagen 1 then return valorImagen nombre en require Modulo Wikidata Fecha FormateaFechaHora piesDeImagen 1 datavalue value formatoFecha ano enlace no end Sin pie de imagen en espanol return valorImagen end function propiedad idPropiedad opciones if Entidad and Entidad claims and Entidad claims idPropiedad then if not opciones then opciones linkback si end opciones entityId Entidad id opciones propiedad idPropiedad valorPropiedad ModuloWikidata getPropiedad opciones Entidad claims idPropiedad return valorPropiedad end end function esUnValor entidad idPropiedad idaBuscar if not entidad or not idPropiedad then return false end local declaracion elementoTabla entidad claims idPropiedad local idBuscado if not declaracion then return false end for k v in pairs declaracion do idBuscado elementoTabla v mainsnak datavalue value id if idBuscado idaBuscar then return true end end return false end function listaDesplegable titulo lista frame if not lista then return end return frame preprocess Lista desplegable align left titulo titulo 1 lista end function seccionDesplegable titulo lista frame if not lista then return end return frame preprocess Seccion desplegable align left titulo titulo datos lista end function capitalizar cad return string upper string sub cad 1 1 string sub cad 2 end function obtenerEnumCalculado entidad local valc for k v in ipairs clasificacionValores do valc esUnValor entidad v 0 v 1 if valc then return v 2 end end end function obtenerValor entidad idPropiedad idValor local valor if not entidad or not idPropiedad or not idValor then return valor end local declaracion elementoTabla entidad claims idPropiedad if declaracion then for k v in pairs declaracion do local propBuscado elementoTabla v mainsnak datavalue value id if propBuscado idValor then table insert valor v end end end return valor end return p Obtenido de https es wikipedia org w index php title Modulo Ficha de sitio web amp oldid 123476376, wikipedia, wiki, leyendo, leer, libro, biblioteca,

español

, española, descargar, gratis, descargar gratis, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, imagen, música, canción, película, libro, juego, juegos