Hi there,
I have this scinario where I want to get all the images URL from my Notion Page
The notion page has multiple blocks where I want to get 2 items, name and image URL
Here is a picture of it
It has a total of 100 blocks, each block has name and image URL as you see from the picture above
Here is a sample JSON extracted
[
{
"object": "list",
"results": [
{
"object": "block",
"id": "4df20a19-f7b0-458c-8b5e-cae520453438",
"created_time": "2021-09-25T20:28:00.000Z",
"last_edited_time": "2021-09-26T10:48:00.000Z",
"has_children": false,
"archived": false,
"type": "heading_3",
"heading_3": {
"text": [
{
"type": "text",
"text": {
"content": "Google Images + Yandex",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "Google Images + Yandex",
"href": null
}
]
}
},
{
"object": "block",
"id": "ea167287-d773-460e-adcb-cd6baf62dcf2",
"created_time": "2021-09-25T21:41:00.000Z",
"last_edited_time": "2021-09-25T21:41:00.000Z",
"has_children": false,
"archived": false,
"type": "paragraph",
"paragraph": {
"text": [
]
}
},
{
"object": "block",
"id": "652dea37-8f7d-44f6-97af-daaa7dac7929",
"created_time": "2021-09-25T23:14:00.000Z",
"last_edited_time": "2021-09-25T23:14:00.000Z",
"has_children": false,
"archived": false,
"type": "heading_2",
"heading_2": {
"text": [
{
"type": "text",
"text": {
"content": "American Crew Cooling Aftershave",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "American Crew Cooling Aftershave",
"href": null
}
]
}
},
{
"object": "block",
"id": "de540c11-12b5-4e9c-9968-b161e29cda87",
"created_time": "2021-09-25T23:14:00.000Z",
"last_edited_time": "2021-09-25T23:14:00.000Z",
"has_children": false,
"archived": false,
"type": "image",
"image": {
"caption": [
],
"type": "external",
"external": {
"url": "https://cdn.shopify.com/s/files/1/0045/5104/9304/products/SHAVE_BEARD005_POSTSHAVECOOLINGLOTION_1024x1024.jpg?v=1583253854"
}
}
}
],
"next_cursor": "32fe55b6-7a38-4cda-b378-9330aa665d0a",
"has_more": true
}
]
After extracting the images URL and name, I want to download each images to my PC and rename each picture with the “name” or maybe send it to FTP.
I just want to know how the workflow has to be for making loop to extract data from JSON, rename the file from the name of the previous block and then send a requests (this process must be repeated for all images ).
Thank you