From 0315defb21813b06274a9990c09d82dabd93be05 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Fri, 19 May 2023 22:31:29 +0200 Subject: [PATCH] mastodon wall style --- .idea/workspace.xml | 11 ++--- src/Controller/DefaultController.php | 4 +- templates/default/index.html.twig | 64 +++++++++++++++++++--------- 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 774564a..3423565 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -11,12 +11,9 @@ - - - - - - + + + diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 64e0d59..14852e5 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -12,8 +12,10 @@ class DefaultController extends AbstractController public function index(): Response { + // TODO merge all these post list and deduplicate them $url = "https://mastodon.cipherbliss.com/api/v1/timelines/public?remote=false&allow_local_only=true&only_media=true"; -// $url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/art&only_media=true"; + $url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/art"; + $url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/mastoart"; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $url ); diff --git a/templates/default/index.html.twig b/templates/default/index.html.twig index febb436..17861ca 100644 --- a/templates/default/index.html.twig +++ b/templates/default/index.html.twig @@ -6,52 +6,76 @@
-

Hello {{ controller_name }}! ✅

- - le truc par défaut +

Découverte d'artistes sur mastodon

{{ data | length }} Images

- {{ (data) | length }} + {# {{ (data) | length }}#}
-

liste des images

- {% for img in (data) %} -{# {{ img }}#} - {{ img.media_attachments | length }} - {% for media in img.media_attachments %} - +

liste des images

+ {% for img in (data) %} + {# {{ img }}#} + {# {{ img.media_attachments | length }}#} + {% for media in img.media_attachments %} +
+
- image - - {{ img.account.acct }} - - + + image + + {{ img.account.acct }} + +
+ + {% endfor %} {% endfor %} - {% endfor %}
-

debug

- {{ dump(data) }} +{#

debug

#} +{# {{ dump(data) }}#}