Last week, I made an interesting toy for entering my existing physical books into Notion, which is convenient for me to manage.
- First of all, there are some books that I will read from time to time, such as “Siddhartha” given to me by Shaonan;
- I will also sell the books to return blood. After all, some books are a bit heavy when renting out, and data recording is also required here.
- In actual use, I will also associate books with my diary. After the association, I will write ideas directly under the diary, and then use the synchronization block to synchronize.
Combined with the above, this toy reduces the entry cost for people like me who have a lot of physical data. With the content I posted on social media before, I have to fulfill my promise, so this article will come out along the way~
If you are interested in this tool, here I provide two versions: the geek version is used by students who like tossing, and the speed version is used by students who are not interested in tossing.
hint
If you just want to use it, please swipe directly to the lazy package section and download the corresponding shortcuts and templates directly.
Geek version
Process analysis
In fact, Mayne made this idea a few years ago, and it seems that it has not been released. As for why I do it, it’s largely because I’m learning programming recently and want to put what I’ve learned into practice.
Closer to home, the book is scanned and entered into Notion. The actual implementation idea is very simple:
- Find a tool that provides the ability to scan code, and the shortcut command supports scan code analysis;
- Pass the parameter to the corresponding API, and let the API return the data after parsing the value;
- Import the returned parsed data into Notion to implement the import.
Tool preparation
So about the above process implementation, you need to prepare the following things:
- a Notion account;
- Prepare an iPhone with a shortcut function for scanning codes. Android is also possible in theory, but it needs to have the support of similar shortcuts;
- Prepare a server for transit analysis, of course, you can also try to use the API provided by Google;
- To prepare a computer, some coding work is required;
API configuration
Then start our operation, the first is to get the data we want. At present, there are not many free APIs supported by ISBN. I found Google, but most students may not be able to access them.
-
https : //www.googleapis.com/books/v1/volumes?q=isbn:0771595158
In addition, I want to see the Douban score of the book. It can only be achieved by using the Douban API. Unfortunately, the Douban API has been shut down.
-
https : //api.douban.com/v2/book/isbn/9787543632608
Unfortunately, the original interface is no longer provided, so you can only build it yourself. For details, please refer to this document: Douban ISBN Query API Interface Creation Tutorial .
The specific logic is to directly parse the Douban web page and generate a custom API. The code is easier to understand. After all, it is written in the best programming language in the world.
Notion configuration
create database
Create a database page, and then name the attributes respectively. Here I directly use the book name, author, introduction, Douban score, etc. For details, you can refer to this picture to customize.
Create a robot and get Token
Go to https://www.notion.so/my-integrations , click “New integration” to create a robot, enter the name, logo, space to be used, and select all the supported capabilities (read, update, write content) ), basically adjust the first three, and the default is fine.
After the creation is complete, copy the created robot Token, which we will need later.
Then go to the created database to invite the bot.
At this point, the Notion configuration part is complete.
Shortcut configuration
The next step is the editing process of our shortcuts. It is recommended that you do it in steps.
Scan code function
The first is to determine the scan code function, search for “scan code” in the shortcut, here you can parse the barcode and QR code;
Link resolution
Then search for “get URL content” to parse the link, and get the dictionary from the URL content, that is, the data we need to import into Notion.
Write Notion
The next step is to write data to Notion, that is, with the help of the Notion API function. For the specific API usage, please refer to: Notion API documentation .
First, copy the link of the database. The Express version is made configurable, and you can configure it according to your personal habits.
-
https : //www.notion.so/linmi/a8aec43384f447ed84390e8e42c2e089?v=...
|--------- Database ID --------|
Here I get JSON directly to match the data, otherwise adding dictionaries and arrays one by one is really annoying, and occasionally crashes. Paste your Token and database_id.
The JSON data format code is placed below, please be careful to replace the data I marked, otherwise the operation will report an error.
-
{
"parent" : {
"database_id" : "f7c827199f58479b9349c690eee2965f" //数据库的ID
},
"icon" : {
"type" : "external" ,
"external" : {
"url" : "词典值" // 图标
}
},
"cover" : {
"type" : "external" ,
"external" : {
"url" : "词典值" // 封面
}
},
"properties" : {
"书籍" : {
"title" : [
{
"text" : {
"content" : "词典值" // 书籍的名字
}
}
]
},
"描述" : {
"rich_text" : [
{
"text" : {
"content" : "词典值" //描述
}
}
]
},
"价格" : {
"rich_text" : [
{
"text" : {
"content" : "词典值" //价格
}
}
]
},
"页数" : {
"rich_text" : [
{
"text" : {
"content" : "词典值" // 页数
}
}
]
},
"评分" : {
"rich_text" : [
{
"text" : {
"content" : "词典值" // 豆瓣评分
}
}
]
}
}
}
function test
Let’s try to pull out a book and test it out. Well, I succeeded here.
Express version
Considering that some students do not have the time or relevant knowledge background to toss this matter, I have prepared a corresponding simple version, just click and copy and paste.
Copy template
Copy template: scan and enter the book , then copy the link id of the database.
-
https : //www.notion.so/linmi/a8aec43384f447ed84390e8e42c2e089?v=...
|--------- Database ID --------|
Create a bot
To create a robot, please refer to the “Notion Configuration” section of the geek version for details. After the creation is complete, copy the robot’s Token for backup;
Save and configure shortcuts
Save the shortcut to the device, click the shortcut link , then click Edit Shortcut, and fill in the Token and Database ID to the specified location;
Add a bot
Add a robot to the template you just created;
enjoy typing
Start the shortcut and start using it with confidence.
At last
If there is any problem, please comment. If it is a program error, please record the screen or describe your operation steps in detail. By the way, this API is provided by my own server, and it may be unavailable in the future. At that time, I will update the links of shortcut instructions in this article.
There are other chat words, it is the iteration of functions, such as adding scanning and deduplication.
This article is reprinted from: https://www.chinagfw.org/2022/03/notion.html
For personal collection only, the copyright belongs to the original author
The physical book scanned and imported into Notion practice · Douban score version first appeared in Haowen Collection .
This article is reproduced from: https://shoucang.zyzhang.com/%E5%AE%9E%E4%BD%93%E5%9B%BE%E4%B9%A6%E6%89%AB%E6%8F%8F% E5%AF%BC%E5%85%A5-notion-%E5%AE%9E%E8%B7%B5-%C2%B7-%E8%B1%86%E7%93%A3%E8%AF%84 %E5%88%86%E7%89%88/
This site is for inclusion only, and the copyright belongs to the original author.