From 627ccfc44bcc9bbbe51e8ea9db5f102f8be31744 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Christopher=20Cot=C3=A9?=
Date: Sat, 14 Oct 2023 08:52:48 -0400
Subject: [PATCH] add RSS feeds
---
media/image_metadata.exs | 71 ++++
media/templates/rss.xml.eex | 22 +
www/photography.xml | 274 +++++++++++++
www/photography/index.html | 779 ++++++++++++++++++++++++++++++++++++
www/videos.xml | 164 ++++++++
5 files changed, 1310 insertions(+)
create mode 100644 media/templates/rss.xml.eex
create mode 100644 www/photography.xml
create mode 100644 www/photography/index.html
create mode 100644 www/videos.xml
diff --git a/media/image_metadata.exs b/media/image_metadata.exs
index c354b9db..40d7038a 100644
--- a/media/image_metadata.exs
+++ b/media/image_metadata.exs
@@ -197,6 +197,40 @@ defmodule Videos do
end)
end
+ def rss(videos, media_server) do
+ items =
+ Enum.map(videos, fn v ->
+ %{
+ title: v.name,
+ description: description(v, media_server),
+ link: link(v),
+ hash: v.hash,
+ datetime: v.datetime
+ }
+ end)
+
+ f =
+ EEx.eval_file("templates/rss.xml.eex",
+ title: "Entropealabs Videos",
+ description: "Videos produced by Entropealabs, LTD",
+ link: "https://media.entropealabs.com/videos",
+ items: items
+ )
+
+ File.write!("../www/videos.xml", f)
+ end
+
+ defp description(%{hash: hash, name: name}, media_server) do
+ """
+ #{name}
+
+ """
+ end
+
+ defp link(%{hash: hash}) do
+ "https://media.entropealabs.com/video/#{hash}"
+ end
+
def upload_new(videos, bucket, region) do
new = Enum.reject(videos, & &1.uploaded)
@@ -386,6 +420,7 @@ defmodule Images do
File.write!("../www/index.html", f)
File.write!("../www/photography/tags/latest.html", f)
+ File.write!("../www/photography/index.html", f)
end
def create_tags(images, tags, dates, media_server) do
@@ -433,6 +468,40 @@ defmodule Images do
end)
end
+ def rss(images, media_server) do
+ items =
+ Enum.map(images, fn i ->
+ %{
+ title: i.hash,
+ description: description(i, media_server),
+ link: link(i),
+ hash: i.hash,
+ datetime: i.datetime
+ }
+ end)
+
+ f =
+ EEx.eval_file("templates/rss.xml.eex",
+ title: "Entropealabs Photography",
+ description: "Photography by Entropealabs, LTD",
+ link: "https://media.entropealabs.com/photography",
+ items: items
+ )
+
+ File.write!("../www/photography.xml", f)
+ end
+
+ defp description(%{path: path} = i, media_server) do
+ """
+
+ Æ #{i.aperture} | #{Image.secs(i.exposure_time)} | #{i.focal_length}mm | ISO#{i.iso}
+ """
+ end
+
+ defp link(%{hash: hash}) do
+ "https://media.entropealabs.com/photography/images/#{hash}"
+ end
+
def slug(text), do: String.replace(text, " ", "-")
end
@@ -478,6 +547,7 @@ Images.create_index(images, tag_keys, date_keys, media_server)
Images.create_images(images, tag_keys, date_keys, media_server)
Images.create_tags(tags, tag_keys, date_keys, media_server)
Images.create_dates(dates, tag_keys, date_keys, media_server)
+Images.rss(Enum.slice(images, 0..25), media_server)
Images.upload_new(images, bucket, region)
videos =
@@ -487,4 +557,5 @@ videos =
|> Enum.sort_by(& &1.datetime, {:desc, DateTime})
Videos.create_videos(videos, media_server)
+Videos.rss(videos, media_server)
Videos.upload_new(videos, bucket, region)
diff --git a/media/templates/rss.xml.eex b/media/templates/rss.xml.eex
new file mode 100644
index 00000000..9e7bf2be
--- /dev/null
+++ b/media/templates/rss.xml.eex
@@ -0,0 +1,22 @@
+
+
+
+ <%= title %>
+ <%= description %>
+ <%= link %>
+
+ <%= DateTime.utc_now() |> Calendar.strftime("%Y") %> entropealabs.com All rights reserved
+ <%= DateTime.utc_now() |> Calendar.strftime("%a, %d %b %Y %H:%M:%S %z") %>
+ <%= DateTime.utc_now() |> Calendar.strftime("%a, %d %b %Y %H:%M:%S %z") %>
+ 1800
+ <%= for i <- items do %>
+ -
+ <%= i.title %>
+ ]]>
+ <%= i.link %>
+ <%= i.hash %>
+ <%= i.datetime |> Calendar.strftime("%a, %d %b %Y %H:%M:%S %z") %>
+
+ <% end %>
+
+
diff --git a/www/photography.xml b/www/photography.xml
new file mode 100644
index 00000000..87af1ddd
--- /dev/null
+++ b/www/photography.xml
@@ -0,0 +1,274 @@
+
+
+
+ Entropealabs Photography
+ Photography by Entropealabs, LTD
+ https://media.entropealabs.com/photography
+
+ 2023 entropealabs.com All rights reserved
+ Sat, 14 Oct 2023 12:51:32 +0000
+ Sat, 14 Oct 2023 12:51:32 +0000
+ 1800
+
+ -
+ 40d2d87dd462e53fec61d782fc415cf8
+
+
Æ 1.8 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/40d2d87dd462e53fec61d782fc415cf8
+ 40d2d87dd462e53fec61d782fc415cf8
+ Sun, 08 Oct 2023 12:39:27 +0000
+
+
+ -
+ 56d8b274478dfd343a018aa4f7ebfe3d
+
+
Æ 5.6 | 1⁄500" | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/56d8b274478dfd343a018aa4f7ebfe3d
+ 56d8b274478dfd343a018aa4f7ebfe3d
+ Sun, 08 Oct 2023 12:27:55 +0000
+
+
+ -
+ 4a4dbd617bae562bd64124dfc6726257
+
+
Æ 4.0 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/4a4dbd617bae562bd64124dfc6726257
+ 4a4dbd617bae562bd64124dfc6726257
+ Sun, 08 Oct 2023 11:43:20 +0000
+
+
+ -
+ 4acf16d1b793911164d1e366f7bfffda
+
+
Æ 4.0 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/4acf16d1b793911164d1e366f7bfffda
+ 4acf16d1b793911164d1e366f7bfffda
+ Sun, 08 Oct 2023 11:41:44 +0000
+
+
+ -
+ a41375119c922715ecafbdffa4a7822c
+
+
Æ 4.5 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/a41375119c922715ecafbdffa4a7822c
+ a41375119c922715ecafbdffa4a7822c
+ Sun, 08 Oct 2023 11:32:02 +0000
+
+
+ -
+ 3bf4604ef066322e701d7ba8349bafea
+
+
Æ 4.5 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/3bf4604ef066322e701d7ba8349bafea
+ 3bf4604ef066322e701d7ba8349bafea
+ Sun, 08 Oct 2023 11:29:19 +0000
+
+
+ -
+ 25c450538537fd7a718d3f0a46ce5daa
+
+
Æ 1.8 | ∞ | 35.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/25c450538537fd7a718d3f0a46ce5daa
+ 25c450538537fd7a718d3f0a46ce5daa
+ Sun, 08 Oct 2023 11:26:56 +0000
+
+
+ -
+ dc5577d68d483e7fa12c184b5129b174
+
+
Æ 2.8 | 1⁄250" | 99.0mm | ISO400
+]]>
+ https://media.entropealabs.com/photography/images/dc5577d68d483e7fa12c184b5129b174
+ dc5577d68d483e7fa12c184b5129b174
+ Fri, 06 Oct 2023 11:13:58 +0000
+
+
+ -
+ ae5f994f3d7717ce54dd39979bb4c17f
+
+
Æ 2.8 | 1⁄250" | 99.0mm | ISO400
+]]>
+ https://media.entropealabs.com/photography/images/ae5f994f3d7717ce54dd39979bb4c17f
+ ae5f994f3d7717ce54dd39979bb4c17f
+ Fri, 06 Oct 2023 11:13:52 +0000
+
+
+ -
+ 8441e204de6533b020ac9a3dac54e12d
+
+
Æ 3.5 | 1⁄250" | 115.0mm | ISO400
+]]>
+ https://media.entropealabs.com/photography/images/8441e204de6533b020ac9a3dac54e12d
+ 8441e204de6533b020ac9a3dac54e12d
+ Fri, 06 Oct 2023 11:13:32 +0000
+
+
+ -
+ 4cb58fbced6bf651dfc8e8497d0e03e4
+
+
Æ 3.5 | 1⁄250" | 200.0mm | ISO400
+]]>
+ https://media.entropealabs.com/photography/images/4cb58fbced6bf651dfc8e8497d0e03e4
+ 4cb58fbced6bf651dfc8e8497d0e03e4
+ Fri, 06 Oct 2023 11:13:25 +0000
+
+
+ -
+ c4eaf021154fd661bc8632cd472c7962
+
+
Æ 4.5 | 1⁄125" | 200.0mm | ISO400
+]]>
+ https://media.entropealabs.com/photography/images/c4eaf021154fd661bc8632cd472c7962
+ c4eaf021154fd661bc8632cd472c7962
+ Fri, 06 Oct 2023 11:11:42 +0000
+
+
+ -
+ 265c67ef0a8ba3a8b8d284e98c3ccd90
+
+
Æ 2.8 | ∞ | 92.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/265c67ef0a8ba3a8b8d284e98c3ccd90
+ 265c67ef0a8ba3a8b8d284e98c3ccd90
+ Sat, 30 Sep 2023 20:46:26 +0000
+
+
+ -
+ bf240f0db33c5e56ad2e7b2a1bf79901
+
+
Æ 8.0 | 1⁄1000" | 70.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/bf240f0db33c5e56ad2e7b2a1bf79901
+ bf240f0db33c5e56ad2e7b2a1bf79901
+ Sat, 30 Sep 2023 20:45:56 +0000
+
+
+ -
+ 687e27890679120322231c2a231eaf9f
+
+
Æ 2.8 | ∞ | 145.0mm | ISO100
+]]>
+ https://media.entropealabs.com/photography/images/687e27890679120322231c2a231eaf9f
+ 687e27890679120322231c2a231eaf9f
+ Sat, 30 Sep 2023 20:45:07 +0000
+
+
+ -
+ 39faf0988325668f1be9c6c8e213cc23
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/39faf0988325668f1be9c6c8e213cc23
+ 39faf0988325668f1be9c6c8e213cc23
+ Sat, 30 Sep 2023 12:50:25 +0000
+
+
+ -
+ 21593549494586d94dd4f8c789b26894
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/21593549494586d94dd4f8c789b26894
+ 21593549494586d94dd4f8c789b26894
+ Sat, 30 Sep 2023 12:39:22 +0000
+
+
+ -
+ 185f0d116e40d7c682ea2f1a14cce104
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/185f0d116e40d7c682ea2f1a14cce104
+ 185f0d116e40d7c682ea2f1a14cce104
+ Sat, 30 Sep 2023 12:14:18 +0000
+
+
+ -
+ 3366d26b82f8e9509ac242d802c8f4d8
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/3366d26b82f8e9509ac242d802c8f4d8
+ 3366d26b82f8e9509ac242d802c8f4d8
+ Sat, 30 Sep 2023 12:13:07 +0000
+
+
+ -
+ 18ae1f693e1020889e69fed317e783af
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/18ae1f693e1020889e69fed317e783af
+ 18ae1f693e1020889e69fed317e783af
+ Sat, 30 Sep 2023 12:11:56 +0000
+
+
+ -
+ 1096b8c88faa9fc728ad19549acdd437
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/1096b8c88faa9fc728ad19549acdd437
+ 1096b8c88faa9fc728ad19549acdd437
+ Sat, 30 Sep 2023 12:03:50 +0000
+
+
+ -
+ f547d168f3d5235fc755d1e843afe0f5
+
+
Æ 2.8 | 1⁄1000" | 200.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/f547d168f3d5235fc755d1e843afe0f5
+ f547d168f3d5235fc755d1e843afe0f5
+ Sat, 30 Sep 2023 11:59:26 +0000
+
+
+ -
+ d1412bcd376097453174584ec2e1817b
+
+
Æ 2.8 | 1⁄500" | 110.0mm | ISO200
+]]>
+ https://media.entropealabs.com/photography/images/d1412bcd376097453174584ec2e1817b
+ d1412bcd376097453174584ec2e1817b
+ Sat, 30 Sep 2023 11:56:37 +0000
+
+
+ -
+ a0b8dab83fae32e27ac74d2163e36a75
+
+
Æ 3.5 | 1⁄200" | 200.0mm | ISO640
+]]>
+ https://media.entropealabs.com/photography/images/a0b8dab83fae32e27ac74d2163e36a75
+ a0b8dab83fae32e27ac74d2163e36a75
+ Wed, 27 Sep 2023 21:19:57 +0000
+
+
+ -
+ 35b11425cd1b601e91083f9b381093a0
+
+
Æ 3.5 | 1⁄200" | 200.0mm | ISO640
+]]>
+ https://media.entropealabs.com/photography/images/35b11425cd1b601e91083f9b381093a0
+ 35b11425cd1b601e91083f9b381093a0
+ Wed, 27 Sep 2023 21:18:57 +0000
+
+
+ -
+ cea7b00a7e96f10fd77f28a52b524cf2
+
+
Æ 3.5 | 1⁄200" | 97.0mm | ISO640
+]]>
+ https://media.entropealabs.com/photography/images/cea7b00a7e96f10fd77f28a52b524cf2
+ cea7b00a7e96f10fd77f28a52b524cf2
+ Wed, 27 Sep 2023 21:18:06 +0000
+
+
+
+
diff --git a/www/photography/index.html b/www/photography/index.html
new file mode 100644
index 00000000..607cdaf7
--- /dev/null
+++ b/www/photography/index.html
@@ -0,0 +1,779 @@
+
+
+
+
+
+
+
+ Photography | latest
+
+
+
+
+
+
+
+
+
+
+
diff --git a/www/videos.xml b/www/videos.xml
new file mode 100644
index 00000000..0a882f09
--- /dev/null
+++ b/www/videos.xml
@@ -0,0 +1,164 @@
+
+
+
+ Entropealabs Videos
+ Videos produced by Entropealabs, LTD
+ https://media.entropealabs.com/videos
+
+ 2023 entropealabs.com All rights reserved
+ Sat, 14 Oct 2023 12:51:36 +0000
+ Sat, 14 Oct 2023 12:51:36 +0000
+ 1800
+
+ -
+ New Richmond | 10-08-2023
+ New Richmond | 10-08-2023
+
+]]>
+ https://media.entropealabs.com/video/3e7ce3ef0b169606cdbe342928719634
+ 3e7ce3ef0b169606cdbe342928719634
+ Tue, 10 Oct 2023 17:13:37 +0000
+
+
+ -
+ Novi Bike Park | 09-02-2023
+ Novi Bike Park | 09-02-2023
+
+]]>
+ https://media.entropealabs.com/video/096f12b38af0717d3d836dc059021a24
+ 096f12b38af0717d3d836dc059021a24
+ Fri, 06 Oct 2023 14:42:29 +0000
+
+
+ -
+ Skatepark | 09-09-2023
+ Skatepark | 09-09-2023
+
+]]>
+ https://media.entropealabs.com/video/c58497d555f0886271fe42ae18a69ba9
+ c58497d555f0886271fe42ae18a69ba9
+ Fri, 06 Oct 2023 01:45:38 +0000
+
+
+ -
+ The Church | 09-10-2023
+ The Church | 09-10-2023
+
+]]>
+ https://media.entropealabs.com/video/326f1664b717ebb4a624881df2064332
+ 326f1664b717ebb4a624881df2064332
+ Sun, 10 Sep 2023 22:50:39 +0000
+
+
+ -
+ Backyard Cruise | 09-08-2023
+ Backyard Cruise | 09-08-2023
+
+]]>
+ https://media.entropealabs.com/video/5d36ea72180a0640549445d93414eb6b
+ 5d36ea72180a0640549445d93414eb6b
+ Sat, 09 Sep 2023 18:56:58 +0000
+
+
+ -
+ Water Park | 08-27-2023
+ Water Park | 08-27-2023
+
+]]>
+ https://media.entropealabs.com/video/a51ffdbe691059d692706ecd511eb756
+ a51ffdbe691059d692706ecd511eb756
+ Fri, 01 Sep 2023 14:49:26 +0000
+
+
+ -
+ Triponds | 08-26-2023
+ Triponds | 08-26-2023
+
+]]>
+ https://media.entropealabs.com/video/d1680f15b97bbe30f087cb95cc4a778c
+ d1680f15b97bbe30f087cb95cc4a778c
+ Wed, 30 Aug 2023 18:00:21 +0000
+
+
+ -
+ Kanoe the Kazoo | 08-19-2023
+ Kanoe the Kazoo | 08-19-2023
+
+]]>
+ https://media.entropealabs.com/video/ab0f82d4281c57188c9f7e335aea6a65
+ ab0f82d4281c57188c9f7e335aea6a65
+ Mon, 21 Aug 2023 18:50:32 +0000
+
+
+ -
+ Urbana | 08-12-2023
+ Urbana | 08-12-2023
+
+]]>
+ https://media.entropealabs.com/video/0de505a86fe73b5f7af5f15115bf789f
+ 0de505a86fe73b5f7af5f15115bf789f
+ Fri, 18 Aug 2023 00:37:40 +0000
+
+
+ -
+ Crawlers | 08-10-2023
+ Crawlers | 08-10-2023
+
+]]>
+ https://media.entropealabs.com/video/871d582560962db4cbd0593000d6bf9a
+ 871d582560962db4cbd0593000d6bf9a
+ Fri, 11 Aug 2023 02:41:09 +0000
+
+
+ -
+ Buggy | 08-09-2023
+ Buggy | 08-09-2023
+
+]]>
+ https://media.entropealabs.com/video/3a3063a44387fc9d4f052754ea802733
+ 3a3063a44387fc9d4f052754ea802733
+ Thu, 10 Aug 2023 20:31:30 +0000
+
+
+ -
+ Tunnel Park | 08-08-2023
+ Tunnel Park | 08-08-2023
+
+]]>
+ https://media.entropealabs.com/video/dad6b28a1f34b2d7cb4f7af929ae7c05
+ dad6b28a1f34b2d7cb4f7af929ae7c05
+ Wed, 09 Aug 2023 16:46:48 +0000
+
+
+ -
+ River | 08-07-2023
+ River | 08-07-2023
+
+]]>
+ https://media.entropealabs.com/video/167e29dc5b7c05c05021395b4cca29e2
+ 167e29dc5b7c05c05021395b4cca29e2
+ Tue, 08 Aug 2023 15:08:29 +0000
+
+
+ -
+ Grand Rapids Bike Park | 08-05-2023
+ Grand Rapids Bike Park | 08-05-2023
+
+]]>
+ https://media.entropealabs.com/video/64f7d344c9993bf7837bd5dbcc553207
+ 64f7d344c9993bf7837bd5dbcc553207
+ Mon, 07 Aug 2023 18:41:39 +0000
+
+
+ -
+ Tip of the Thumb
+ Tip of the Thumb
+
+]]>
+ https://media.entropealabs.com/video/cfeaa8d830c1da8ecf7f8749019c9c44
+ cfeaa8d830c1da8ecf7f8749019c9c44
+ Thu, 03 Aug 2023 00:14:18 +0000
+
+
+
+
--
2.45.3