type
status
date
slug
summary
tags
category
icon
password
背景
Notion:all in one
我习惯将资料统一归档到Notion,因此在手机微信公众号内容作为稍后阅读保存到Notion就比较麻烦,需要文章链接,再打开Notion,再打开到对应的Datebase,新建一条数据,编辑标题,并粘贴链接。
框架介绍

- iOS/Android 复制网页链接,通过快捷指令/ Automate发送给Worker
- Worker收到链接后,获取链接地址的文章标题,将标题及URL通过Notion API保存到指定的Datebase
服务端搭建
Notion API
创建Notion Integration及获取Notion API key
- 在Integration 页面点击「Create new integration」可以创建Integration ;
- 填写workspace、Name,点击「Submit」;
- 在Secrets页面,点击「Show」,即可复制获取Notion API key。
授权 Notion Integration
- 点击 Datebase 右上角的「…」;
- 再点击「Connect to」;
- 选择你的 Integration Name。
CF Worker
- 在左侧导航栏中选择「Workers 和 Pages」;
- 点击「创建应用程序」;
- 点击「创建Worker」;
- 填写名称「notion」,点击部署;
- 点击编辑代码;
- 删除所有代码,粘贴以下代码,并在
sendToNotion
函数中修改3个地方, database_id
:网页端打开对应的Database,查看网页链接,在「?v=」后的32个字符就是database_id
;Authorization
:之前Integration中获得的Notion API key,以secret_开头;properties
:属性结构则需跟你的Database结构一致,通过postman发送get命令获取你的Database结构,修改相应内容。或者依据我的Datebase建立,则不需要修改;

- 点击「保存并部署」;
- 获取Worker的API地址(建议增加自己域名镜像绑定,自行搜索)

- 在浏览器中输入API地址加url参数即可实现在在Datebase中添加网页标题及URL,eg:
https://notion.xxxxxx.workers.dev/?url=https://www.baidu.com
Turning:使用postman进行调试
客户端使用
iOS(快捷指令)
- 获取快捷指令,链接
- 修改Worker链接

- 在负一屏增加快捷指令
Android(Automate)
- 获取指令,链接
- 修改Worker链接


- 在下拉通知栏添加快捷菜单
借鉴
- Author:jcywong
- URL:http://preview.tangly1024.com/article/1f15d3f7-a206-80e2-a6d6-ed2bb790dde2
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!