Merge branch 'main' of git.owlcode.tech:sergiotarxz/burguillos.info

This commit is contained in:
Sergiotarxz 2023-10-01 16:24:03 +02:00
commit 3770018724
12 changed files with 144 additions and 23 deletions

View File

@ -0,0 +1,15 @@
<category>
<title>Lugares donde celebrar ocasiones.</title>
<description>
<p>Ya sean bodas, bautizos, cumpleaños, fiestas infantiles o comuniones, encuentra en Burguillos el lugar perfecto para recordar para siempre con cariño los momentos especiales de la vida.</p>
<p>¿Quieres que tu comercio aparezca aquí? Contacta con <a href="mailto:contact@owlcode.tech">contact@owlcode.tech</a></p>
</description>
<parent>comercios</parent>
<priority>0</priority>
<menu_text>Celebraciones</menu_text>
<slug>celebraciones</slug>
<img src="/img/celebraciones.webp"/>
<attributes>
</attributes>
</category>

View File

@ -5,6 +5,7 @@
<ogdesc>Mesón - Bar - Cristóbal - Carta y Menú.</ogdesc> <ogdesc>Mesón - Bar - Cristóbal - Carta y Menú.</ogdesc>
<last_modification_date>2023-09-06T11:16+00:00</last_modification_date> <last_modification_date>2023-09-06T11:16+00:00</last_modification_date>
<category>donde-comer</category> <category>donde-comer</category>
<category>index</category>
<slug>bar-cristobal</slug> <slug>bar-cristobal</slug>
<attributes> <attributes>
<attribute>hamburguesas</attribute> <attribute>hamburguesas</attribute>

View File

@ -7,6 +7,7 @@
<img src="/img/beluche.webp" bottom-preview="500"/> <img src="/img/beluche.webp" bottom-preview="500"/>
<pinned>2</pinned> <pinned>2</pinned>
<category>donde-comer</category> <category>donde-comer</category>
<category>index</category>
<attributes> <attributes>
<attribute>hamburguesas</attribute> <attribute>hamburguesas</attribute>
<attribute>reparto-a-domicilio-comida</attribute> <attribute>reparto-a-domicilio-comida</attribute>

View File

@ -8,6 +8,7 @@
contacto.</ogdesc> contacto.</ogdesc>
<img src="/img/yo-to-lo-guiso.webp" /> <img src="/img/yo-to-lo-guiso.webp" />
<category>donde-comer</category> <category>donde-comer</category>
<category>index</category>
<attributes> <attributes>
<attribute>hamburguesas</attribute> <attribute>hamburguesas</attribute>
<attribute>comida-vegana</attribute> <attribute>comida-vegana</attribute>

View File

@ -6,7 +6,7 @@
<img src="/img/farmacia.webp"/> <img src="/img/farmacia.webp"/>
<category>index</category> <category>index</category>
<slug>farmacia-guardia</slug> <slug>farmacia-guardia</slug>
<pinned>1</pinned> <pinned>100</pinned>
<content> <content>
<img alt="Imagen de cruz de Farmacia" src="/img/farmacia.webp"/> <img alt="Imagen de cruz de Farmacia" src="/img/farmacia.webp"/>

View File

@ -6,7 +6,7 @@
<img src="/img/ayuntamiento.webp"/> <img src="/img/ayuntamiento.webp"/>
<category>index</category> <category>index</category>
<slug>telefono-interes-burguillos</slug> <slug>telefono-interes-burguillos</slug>
<pinned>1</pinned> <pinned>100</pinned>
<content> <content>
<img alt="Imagen del ayuntamiento" src="/img/ayuntamiento.webp"/> <img alt="Imagen del ayuntamiento" src="/img/ayuntamiento.webp"/>

View File

@ -0,0 +1,47 @@
<post>
<author>Burguillos.info</author>
<date>2023-09-28T09:59+00:00</date>
<title>Baby Parks - Donde celebrar cumpleaños en Burguillos.</title>
<ogdesc>Baby Parks - Donde celebrar cumpleaños en Burguillos.</ogdesc>
<img src="/img/baby-parks.webp" bottom-preview="500"/>
<category>celebraciones</category>
<slug>baby-parks</slug>
<content>
<img witdh="50%" alt="Fotografía baby park" style="border: solid 1px black" src="/img/baby-parks.webp" bottom-preview="500"/>
<h2>¿Aun no sabes donde celebrar el cumpleaños de tu hijo o nieto?</h2>
<p>El Baby Parks, localizado en Calle los Almendros número 2 local c, es un lugar que puedes alquilar y tiene todo lo necesario para que tanto los peques como los mayores se lo puedan pasar bomba.</p>
<p>Contacta al teléfono <a href="tel:+34698902365">698 902 365</a> para reservar o más información.</p>
<p>Los precios son:</p>
<ul>
<li>Lunes a Jueves: 50€</li>
<li>Viernes a domingo y festivos: 75€</li>
</ul>
<p>La infraestructura para adultos incluye:</p>
<ul>
<li>Barra.</li>
<li>Botellero.</li>
<li>Arcón congelador.</li>
<li>Cafetera.</li>
<li>Microondas.</li>
<li>Sandwichera.</li>
<li>Equipo de sonido.</li>
</ul>
<p>Y para los peques:</p>
<ul>
<li>Pista americana.</li>
<li>Cama elástica.</li>
<li>Baby park.</li>
</ul>
<p>¿Quieres ver tu negocio localizado en Burguillos en este espacio? Contacta con <a href="mailto:contact@owlcode.tech">contact@owlcode.tech</a>.</p>
</content>
</post>

View File

@ -0,0 +1,50 @@
package BurguillosInfo::Ads::OwlcodeTech;
use v5.36.0;
use strict;
use warnings;
use utf8;
use feature 'signatures';
use Moo;
use parent 'BurguillosInfo::Ad';
sub id ($self) {
return 'owlcode-tech';
}
sub weight {
return 50;
}
sub seconds($self) {
return 15;
}
sub max_alternative {
return 1;
}
sub default_alternative($self) {
return int($self->alternative * ($self->max_alternative + 1));
}
sub is_active ($self) {
return 1;
}
sub img ($self) {
return '/img/owlcode-tech.webp';
}
sub text($self) {
return '¿Tienes una PYME o eres autónomo y aun no tienes presencia web? Consigue una web totalmente subvencionada. Pulsa aquí para más información.';
}
sub href {
return 'mailto:contact@owlcode.tech?subject=Quiero%20una%20web%20completamente%20subvencionada';
}
1;

View File

@ -32,7 +32,7 @@ sub new {
return bless {}, shift; return bless {}, shift;
} }
sub _ReturnCacheFilter($self, $filters = 1) { sub _ReturnCacheFilter ( $self, $filters = 1 ) {
my %posts_by_category_filtered; my %posts_by_category_filtered;
my %posts_by_slug_filtered; my %posts_by_slug_filtered;
my $iso8601 = DateTime::Format::ISO8601->new; my $iso8601 = DateTime::Format::ISO8601->new;
@ -50,8 +50,8 @@ sub _ReturnCacheFilter($self, $filters = 1) {
} }
} }
$posts_by_slug_filtered{ $post->{slug} } = $post; $posts_by_slug_filtered{ $post->{slug} } = $post;
$posts_by_category_filtered{ $post->{category} } //= []; $posts_by_category_filtered{ $category } //= [];
push @{ $posts_by_category_filtered{ $post->{category} } }, $post; push @{ $posts_by_category_filtered{ $category } }, $post;
} }
} }
return ( \%posts_by_category_filtered, \%posts_by_slug_filtered ); return ( \%posts_by_category_filtered, \%posts_by_slug_filtered );
@ -69,16 +69,19 @@ sub _GeneratePostFromFile ( $self, $post_file ) {
or die "Missing date at $post_file."; or die "Missing date at $post_file.";
my $ogdesc = $dom->at(':root > ogdesc')->text my $ogdesc = $dom->at(':root > ogdesc')->text
or die "Missing ogdesc at $post_file"; or die "Missing ogdesc at $post_file";
my $category = $dom->at(':root > category')->text my @categories = $dom->find(':root > category')->map('text')->each;
or die "Missing category at $post_file."; my $slug = $dom->at(':root > slug')->text
my $slug = $dom->at(':root > slug')->text
or die "Missing slug at $post_file."; or die "Missing slug at $post_file.";
my $content_tag = $dom->at(':root > content') my $content_tag = $dom->at(':root > content')
or die "Missing content at $post_file."; or die "Missing content at $post_file.";
for my $tag ($content_tag->children->each) {
$tag->content($tag->content =~ s/\n//gr); for my $tag ( $content_tag->children->each ) {
$tag->content( $tag->content =~ s/\n//gr );
} }
my $content = $content_tag->content; if ( !scalar @categories ) {
die 'Missing category';
}
my $content = $content_tag->content;
my $pinned_node = $dom->at(':root > pinned'); my $pinned_node = $dom->at(':root > pinned');
my $image_element = $dom->at(':root > img'); my $image_element = $dom->at(':root > img');
my $image; my $image;
@ -106,7 +109,8 @@ sub _GeneratePostFromFile ( $self, $post_file ) {
author => $author, author => $author,
date => $date, date => $date,
ogdesc => $ogdesc, ogdesc => $ogdesc,
category => $category, categories => [@categories],
category => $categories[0],
slug => $slug, slug => $slug,
content => $content, content => $content,
attributes => $attributes, attributes => $attributes,
@ -147,16 +151,18 @@ sub _GeneratePostCache ($self) {
if ( !defined $post ) { if ( !defined $post ) {
next; next;
} }
my $category = $post->{category}; my $categories = $post->{categories};
$cached_posts_by_category->{$category} //= []; for my $category ($post->{categories}->@*) {
my $slug = $post->{slug}; $cached_posts_by_category->{$category} //= [];
my $category_posts = $cached_posts_by_category->{$category}; my $slug = $post->{slug};
$cached_posts_by_slug->{$slug} = $post; my $category_posts = $cached_posts_by_category->{$category};
push @$category_posts, $post; $cached_posts_by_slug->{$slug} = $post;
push @$category_posts, $post;
}
} }
} }
sub Retrieve($self, $filters = 1) { sub Retrieve ( $self, $filters = 1 ) {
if ( defined $cached_posts_by_category && defined $cached_posts_by_slug ) { if ( defined $cached_posts_by_category && defined $cached_posts_by_slug ) {
return $self->_ReturnCacheFilter($filters); return $self->_ReturnCacheFilter($filters);
} }
@ -189,7 +195,7 @@ sub RetrieveAllPostsForCategory ( $self, $category_name ) {
sub comparePinned ( $self, $a, $b ) { sub comparePinned ( $self, $a, $b ) {
my $cmp = $b->{pinned} <=> $a->{pinned}; my $cmp = $b->{pinned} <=> $a->{pinned};
if ( $cmp != 0 ) { if ( $cmp != 0 ) {
return $cmp; return $cmp;
} }
return int( rand(3) ) - 1; return int( rand(3) ) - 1;
@ -220,14 +226,14 @@ sub RetrieveDirectPostsForCategory ( $self, $category_name ) {
return $self->shufflePostsIfRequired( $category, [@$posts] ); return $self->shufflePostsIfRequired( $category, [@$posts] );
} }
sub PreviewOg($self, $post, $isWhatsApp) { sub PreviewOg ( $self, $post, $isWhatsApp ) {
my $title = $post->{title}; my $title = $post->{title};
my $content = $post->{content}; my $content = $post->{content};
my $image_file = $post->{image}; my $image_file = $post->{image};
my $image_bottom_preview = $post->{image_bottom_preview}; my $image_bottom_preview = $post->{image_bottom_preview};
if ($isWhatsApp) { if ($isWhatsApp) {
return BurguillosInfo::Preview->WhatsappAlternativeGenerate( $title, $content, $image_file, return BurguillosInfo::Preview->WhatsappAlternativeGenerate( $title,
$image_bottom_preview ); $content, $image_file, $image_bottom_preview );
} }
return BurguillosInfo::Preview->Generate( $title, $content, $image_file, return BurguillosInfo::Preview->Generate( $title, $content, $image_file,
$image_bottom_preview ); $image_bottom_preview );

BIN
public/img/baby-parks.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB