Skip to content

Commit

Permalink
Add actual mandaljazz albums from Flickr
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshenrik committed Nov 1, 2024
1 parent e389efa commit 1180a56
Show file tree
Hide file tree
Showing 14 changed files with 2,175 additions and 59 deletions.
18 changes: 12 additions & 6 deletions scripts/fetch-from-flickr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import "dotenv/config";
import { createFlickr } from "flickr-sdk";
import fs from "fs";

const USER_ID = "201530280@N05";

const { flickr } = createFlickr(process.env.FLICKR_API_KEY);

// See docs: https://www.flickr.com/services/api/flickr.urls.lookupUser.html
const lookupUserResponse = await flickr("flickr.urls.lookupUser", {
url: "https://www.flickr.com/people/mandaljazz/",
});

const user_id = lookupUserResponse.user.id;

// See docs: https://www.flickr.com/services/api/flickr.photosets.getList.html
const photosetsResponse = await flickr("flickr.photosets.getList", {
user_id: USER_ID,
user_id,
primary_photo_extras: "url_z",
});

Expand All @@ -16,7 +22,7 @@ console.log("Found", photosetsResponse.photosets.photoset.length, "albums");
for (const photoset of photosetsResponse.photosets.photoset) {
const photos = await flickr("flickr.photosets.getPhotos", {
photoset_id: photoset.id,
user_id: USER_ID,
user_id,
extras: "url_s, url_z, url_o",
});

Expand All @@ -31,13 +37,13 @@ for (const photoset of photosetsResponse.photosets.photoset) {
title: photoset.title._content,
description: photoset.description._content,
id: photoset.id,
href: `https://www.flickr.com/photos/${USER_ID}/albums/${photoset.id}`,
href: `https://www.flickr.com/photos/${user_id}/albums/${photoset.id}`,
url_z: photoset.primary_photo_extras.url_z,
height_z: photoset.primary_photo_extras.height_z,
width_z: photoset.primary_photo_extras.width_z,
photos: photos.photoset.photo.map((photo) => ({
title: photo.title,
href: `https://www.flickr.com/photos/${USER_ID}/${photo.id}/in/album-${photoset.id}/`,
href: `https://www.flickr.com/photos/${user_id}/${photo.id}/in/album-${photoset.id}/`,
url_o: photo.url_o,
url_z: photo.url_z,
width_z: photo.width_z,
Expand Down
33 changes: 0 additions & 33 deletions src/content/flickr-albums/72177720320878569.json

This file was deleted.

55 changes: 55 additions & 0 deletions src/content/flickr-albums/72177720320931090.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"title": "Mandaljazz 2014",
"description": "I 2014 ble Mandaljazz født!",
"id": "72177720320931090",
"href": "https://www.flickr.com/photos/201554230@N07/albums/72177720320931090",
"url_z": "https://live.staticflickr.com/65535/54047229658_34bb9e0c3a_z.jpg",
"height_z": 640,
"width_z": 427,
"photos": [
{
"title": "Jazzlaug",
"href": "https://www.flickr.com/photos/201554230@N07/54046974946/in/album-72177720320931090/",
"url_o": "https://live.staticflickr.com/65535/54046974946_90750da5a4_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54046974946_ed8f01258e_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54046974946_ed8f01258e_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Erik Kimestad Kvartett",
"href": "https://www.flickr.com/photos/201554230@N07/54047229658/in/album-72177720320931090/",
"url_o": "https://live.staticflickr.com/65535/54047229658_2ffe2dc3b6_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047229658_34bb9e0c3a_z.jpg",
"width_z": 427,
"height_z": 640,
"url_s": "https://live.staticflickr.com/65535/54047229658_34bb9e0c3a_m.jpg",
"width_s": 160,
"height_s": 240
},
{
"title": "Mathias Eick Quintet",
"href": "https://www.flickr.com/photos/201554230@N07/54046111702/in/album-72177720320931090/",
"url_o": "https://live.staticflickr.com/65535/54046111702_3e5bf2b781_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54046111702_588e8ddd5a_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54046111702_588e8ddd5a_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Dr. Kay and his Interstellar Tone Scientists",
"href": "https://www.flickr.com/photos/201554230@N07/54046111707/in/album-72177720320931090/",
"url_o": "https://live.staticflickr.com/65535/54046111707_bcab5488e6_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54046111707_044d1d6e57_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54046111707_044d1d6e57_m.jpg",
"width_s": 240,
"height_s": 160
}
]
}
55 changes: 55 additions & 0 deletions src/content/flickr-albums/72177720320931490.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"title": "Mandaljazz 2015",
"description": "",
"id": "72177720320931490",
"href": "https://www.flickr.com/photos/201554230@N07/albums/72177720320931490",
"url_z": "https://live.staticflickr.com/65535/54047341089_3c61fc9368_z.jpg",
"height_z": 427,
"width_z": 640,
"photos": [
{
"title": "Broen",
"href": "https://www.flickr.com/photos/201554230@N07/54047456115/in/album-72177720320931490/",
"url_o": "https://live.staticflickr.com/65535/54047456115_8253fc7c23_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047456115_7c14394888_z.jpg",
"width_z": 640,
"height_z": 465,
"url_s": "https://live.staticflickr.com/65535/54047456115_7c14394888_m.jpg",
"width_s": 240,
"height_s": 175
},
{
"title": "Bjørn Charles Dreyer",
"href": "https://www.flickr.com/photos/201554230@N07/54047341084/in/album-72177720320931490/",
"url_o": "https://live.staticflickr.com/65535/54047341084_1b81c427c7_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047341084_6ac6ac2804_z.jpg",
"width_z": 640,
"height_z": 412,
"url_s": "https://live.staticflickr.com/65535/54047341084_6ac6ac2804_m.jpg",
"width_s": 240,
"height_s": 154
},
{
"title": "Kristoffer Lo",
"href": "https://www.flickr.com/photos/201554230@N07/54047341089/in/album-72177720320931490/",
"url_o": "https://live.staticflickr.com/65535/54047341089_d38075d41e_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047341089_3c61fc9368_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047341089_3c61fc9368_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Ryvingen fyr",
"href": "https://www.flickr.com/photos/201554230@N07/54047264408/in/album-72177720320931490/",
"url_o": "https://live.staticflickr.com/65535/54047264408_1b5e93250a_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047264408_00e5193709_z.jpg",
"width_z": 427,
"height_z": 640,
"url_s": "https://live.staticflickr.com/65535/54047264408_00e5193709_m.jpg",
"width_s": 160,
"height_s": 240
}
]
}
99 changes: 99 additions & 0 deletions src/content/flickr-albums/72177720320933247.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"title": "Mandaljazz 2016",
"description": "",
"id": "72177720320933247",
"href": "https://www.flickr.com/photos/201554230@N07/albums/72177720320933247",
"url_z": "https://live.staticflickr.com/65535/54047288413_4d676c9004_z.jpg",
"height_z": 427,
"width_z": 640,
"photos": [
{
"title": "Horse Orchestra",
"href": "https://www.flickr.com/photos/201554230@N07/54047288518/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047288518_1c54ab65f1_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047288518_a3cdc28062_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047288518_a3cdc28062_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Sun Ra Arkestra",
"href": "https://www.flickr.com/photos/201554230@N07/54046172217/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54046172217_0d6ff33298_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54046172217_ccf99235a5_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54046172217_ccf99235a5_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Sun Ra Arkestra",
"href": "https://www.flickr.com/photos/201554230@N07/54047288413/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047288413_dd6a8b024e_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047288413_4d676c9004_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047288413_4d676c9004_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Pop-up konsert i byen.",
"href": "https://www.flickr.com/photos/201554230@N07/54046172227/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54046172227_f98b90fe9c_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54046172227_86ea3bb8bc_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54046172227_86ea3bb8bc_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Barnekonsert - Klangbein",
"href": "https://www.flickr.com/photos/201554230@N07/54047365844/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047365844_9de718ca20_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047365844_b258c58e03_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047365844_b258c58e03_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Stemning i bakgården",
"href": "https://www.flickr.com/photos/201554230@N07/54047480615/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047480615_0927235618_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047480615_f2eab8b7d6_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047480615_f2eab8b7d6_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "Band of Gold",
"href": "https://www.flickr.com/photos/201554230@N07/54047288463/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047288463_f9c0bc7424_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047288463_63bc36152b_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047288463_63bc36152b_m.jpg",
"width_s": 240,
"height_s": 160
},
{
"title": "De frivillige på Mandaljazz 2016!",
"href": "https://www.flickr.com/photos/201554230@N07/54047480605/in/album-72177720320933247/",
"url_o": "https://live.staticflickr.com/65535/54047480605_d29867e247_o.jpg",
"url_z": "https://live.staticflickr.com/65535/54047480605_145852026b_z.jpg",
"width_z": 640,
"height_z": 427,
"url_s": "https://live.staticflickr.com/65535/54047480605_145852026b_m.jpg",
"width_s": 240,
"height_s": 160
}
]
}
Loading

0 comments on commit 1180a56

Please sign in to comment.