Accepts
App Store Apps, Articles, Contacts, Dates, Email Addresses, Files, Images, iTunes Products, Locations, Map Links, Media, PDFs, Phone Numbers, Rich Text, Safari Web Pages, Text and URLs
TEXT
<Notion API>

Text
TEXT
Text

Text
TEXT
<YouTube Data API (optional)>

Text
SCRIPTING
Get name of
Shortcut Input

Name
SCRIPTING
If
Name
contains
youtube
COMMENT
If this is a YouTube link, get the video’s title from the YouTube API
TEXT
Match
\?.*$
in
Shortcut Input

Matches
DOCUMENTS
Replace
&feature=share
with
in
Matches

Updated Text
DOCUMENTS
Replace
?v=
with
World
in
Second

Updated Text
DOCUMENTS
Replace
with
World
in
Video ID

Updated Text
VARIABLES
Set variable
URL
to
Video ID 2
URL
https://www.googleapis.com/youtube/v3/videos?id=
Video ID 2
&key=
Youtube Key
&fields=items(id,snippet(channelId,title,categoryId),statistics)&part=snippet,statistics

URL
NETWORK
Get contents of
URL
Options Under Construction

Contents of URL
SCRIPTING
Get dictionary from
Contents of URL

Dictionary
SCRIPTING
Get
Value
for
items
in
Youtube API Response

Dictionary Value
SCRIPTING
Get
Value
for
snippet
in
Items

Dictionary Value
SCRIPTING
Get
Value
for
title
in
Snippet

Dictionary Value
VARIABLES
Set variable
Title
to
Title
VARIABLES
Set variable
URL
to
Name
SCRIPTING
Otherwise
SCRIPTING
Count
Items
in
Name

Count
COMMENT
Sharing a web link can have multiple outcomes.
If Shortcut input = 1 -> need to use “Get URLs from …”
If Shortcut input = 2 -> index 1 is title and index 2 is URL
If Shortcut input = 3 -> index 3 is title and index 2 is URL
SCRIPTING
If
Count
is
1
SCRIPTING
Get
Item At Index
1
from
Name

Item from List
VARIABLES
Set variable
Title
to
Title
WEB
Get URLs from
Shortcut Input

URLs
VARIABLES
Set variable
URL
to
URLs
SCRIPTING
Otherwise
SCRIPTING
If
Count
is
2
SCRIPTING
Get
Item At Index
1
from
Name

Item from List
VARIABLES
Set variable
Title
to
Title
SCRIPTING
Get
Item At Index
2
from
Name

Item from List
VARIABLES
Set variable
URL
to
URL
SCRIPTING
Otherwise
SCRIPTING
Get
Item At Index
3
from
Name

Item from List
VARIABLES
Set variable
Title
to
Title
SCRIPTING
Get
Item At Index
2
from
Name

Item from List
VARIABLES
Set variable
URL
to
URL
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
DOCUMENTS
Replace
"
with
\"
in
Title

Updated Text
VARIABLES
Set variable
Title
to
Updated Text
COMMENT
Ask for user input
SCRIPTING

Provided Input
COMMENT
Check every line to see if there are ‘#’ which indicates a paragraph
if there isn’t a
TEXT
Split
User Input
by
New Lines

Split Text
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
TEXT
Match
#
in
Repeat Item

Matches
SCRIPTING
Count
Items
in
Matches

Count
SCRIPTING
If
Count
is greater than
0
DOCUMENTS
Replace
#
with
World
in
Repeat Item

Updated Text
TEXT
{
"object": "block",
"type": "heading_
Count
",
"heading_
Count
": {
"rich_text": [{
"type": "text",
"text": {
"content": "
Updated Text
",
"link": null
}
}],
"color": "default"
}
}

Text
SCRIPTING
Otherwise
TEXT
{
"object": "block",
"type": "numbered_list_item",
"numbered_list_item": {
"rich_text": [{
"type": "text",
"text": {
"content": "
Repeat Item
",
"link": null
}
}]
}
}

Text
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Repeat Results
with
Custom
,

Combined Text
TEXT
{
"filter": {
"and": [{"property": "URL",
"url": {
"equals": "
URL
"
}
}
]
},
"sorts": [
{
"property": "Review Stage",
"direction": "ascending"
}
]
}

Text
SCRIPTING
Get dictionary from
Text

Dictionary
NETWORK
Get contents of
https://api.notion.com/v1/databases/
Database Id
/query
Options Under Construction

Contents of URL
SCRIPTING
Get dictionary from
Contents of URL

Dictionary
SCRIPTING
Get
Value
for
results
in
Dictionary

Dictionary Value
SCRIPTING
If
Dictionary Value
does not have any value
COMMENT
If there is NOT a existing page (by matching url)-> Post
TEXT
URL

Text
SCRIPTING
If
Text
contains
youtube
DOCUMENTS
Replace
youtube.com
with
www.youtube.com
in
Text

Updated Text
DOCUMENTS
Replace
&feature=share
with
World
in
Updated Text

Updated Text
DOCUMENTS
Replace
watch?v=
with
embed/
in
Updated Text

Updated Text
DOCUMENTS
Replace
/
with
\/
in
Updated Text

Updated Text
TEXT
"children":[
{
"object": "block",
"type": "heading_1",
"heading_1": {
"rich_text": [{
"type": "text",
"text": {
"content": "Notes",
"link": null
}
}],
"color": "default",
"children": [
Combined Text
]
}},
{
"object": "block",
"type": "divider",
"divider": {}
},
{
"type": "video",
"object": "block",
"video": {
"type": "external",
"external": {
"url": "
Escaped URL
"
}
}
}
]

Text
SCRIPTING
Otherwise
SAFARI
Get article from
URL

Article
DOCUMENTS
Replace
[\u202F\u00A0]
with
World
in
Article

Updated Text
DOCUMENTS
Replace
[""”“'\t]
with
'
in
Updated Text

Updated Text
TEXT
Split
Updated Text
by
New Lines

Split Text
SCRIPTING
Repeat with each item in
Split Text

Repeat Results
TEXT
{
"type": "paragraph",
"object": "block",
"paragraph": {
"rich_text": [{
"type": "text",
"text": {
"content": "
Repeat Item
",
"link": null
}
}],
"color": "default",
}
}

Text
SCRIPTING
End Repeat

Repeat Results
TEXT
Combine
Repeat Results
with
Custom
,

Combined Text
TEXT
"children":[
{
"object": "block",
"type": "heading_1",
"heading_1": {
"rich_text": [{
"type": "text",
"text": {
"content": "Notes",
"link": null
}
}],
"color": "default",
"children": [
Combined Text
]
}},
{
"object": "block",
"type": "divider",
"divider": {}
},
paragraphs
]

Text
SCRIPTING
End If

If Result
TEXT
{
"parent": { "database_id": "
Title
" },
"properties": {
"Name": {
"title": [
{
"text": {
"content": "
URL
"
}
}
]
},
"URL": {
"url":"
If Result
"
},
"Database": {
"select": {
"name": "Links"
}
},
"Status": {
"select": {
"name": "Review"
}
}
},
Database Id
}

Text
SCRIPTING
Get dictionary from
Text

Dictionary
NETWORK
Get contents of
https://api.notion.com/v1/pages
Options Under Construction

Contents of URL
SCRIPTING
Otherwise
COMMENT
If there is a existing page (by matching url) -> Append
SCRIPTING
Get
First Item
from
Dictionary Value

Item from List
SCRIPTING
Get
Value
for
id
in
Item from List

Dictionary Value
NETWORK
Get contents of
https://api.notion.com/v1/blocks/
Page ID
/children
Options Under Construction

Contents of URL
SCRIPTING
Get dictionary from
Contents of URL

Dictionary
SCRIPTING
Get
Value
for
results
in
Dictionary

Dictionary Value
SCRIPTING
Repeat with each item in
Dictionary Value

Repeat Results
SCRIPTING
Get
Value
for
id
in
Repeat Item

Dictionary Value
SCRIPTING
Get
Value
for
has_children
in
Repeat Item

Dictionary Value
SCRIPTING
If
Dictionary Value
is
<value>
VARIABLES
Set variable
Note Toggle
to
Dictionary Value
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results