banner
烤肉肉

烤肉肉

2024#01 | From Douban Sauce to Sanwei Bookstore

The cover is a small scene made with UE5 last year, playing with building blocks is quite fun.

I used to write blogs, but I have never persisted for a year. This time, unexpectedly, I created a new folder for 2024. I hope I can continue in the future.

The first article of the new year. Actually, this week didn't go so well. It seems that my luck hasn't been on my side lately. On New Year's Eve, I watched Taiwan's New Year's Eve on YouTube. Chen Qi Zhen sang for more than half an hour. The people of Taiwan still eat well, and netizens from southern mainland China expressed their envy.

From Douban to Notion#

During the home quarantine in 2020, when I wasn't working, I read a lot of books. At that time, I used Notion to build a book database. I felt a sense of accomplishment personally, but I didn't maintain it much after I started working. Recently, when I was browsing other people's blogs, I found that many people are using Notion to build their own databases. This reminded me of the database I built back then. It just so happens that I have always wanted a "Book, Movie, Game" database, so I decided to build one.

At that time, I manually recorded everything, one by one. If I want to build a relatively complete "Book, Movie, Game" database, my data volume should be quite large (actually not that big). I searched online and found that there are many strategies for "escaping from Douban", such as the Douban backup and sync tool for books, movies, music, games, and stage plays recommended by many bloggers. When I opened it, it showed a 404 status (probably warned), and NeoDB recommended Doufen (Doufen), which is still quite useful. However, I saw a blogger saying that Doufen may lead to account suspension, but it's not a big problem (life is a gamble).

Actually, I encountered some difficulties and took some detours in the middle. The initial idea was to convert the exported .xlsx data from Douban into CSV format. If I want functions like "Read", "To Read", "Watched", "To Watch", I just need to manually modify the exported file from Doufen. Then I can directly import the exported CSV file into Notion, which can satisfy most of the requirements.

But I want book covers! Because the exported file contains Douban links, I initially wanted to use Python to directly crawl the images from Douban. At first, it was all fine. I crawled more than a hundred images and triggered the anti-crawling mechanism. I was too lazy to study how to bypass it.

Here comes the key point. I want to give a big thumbs up to Douban's alternative platform NeoDB. As mentioned before, after exporting, you can import it into NeoDB. Unlike Douban, this is an open platform and it can call APIs!

After importing the data from Douban, I exported a backup from NeoDB. Referring to their Developer Console, I crawled all the books and movies.

import requests

import json

import pandas as pd

import time

df = pd.read_csv("movie.csv")

df['NeoDB链接']=df['NeoDB链接'].astype(str)

header={'Authorization':'Bearer xhUlIQDgfb11mokXBsZAmjvwO5r2Qm',}#You can directly get a Test Access Token from the link above. I don't know why the application registration they mentioned didn't work for me. Anyway, crawling a few thousand data will be done in a moment.

for x,i in enumerate(df['NeoDB链接']):

    url = i

    content = url.split('https://neodb.social/')[1]

    print(content)

    response = requests.get('https://neodb.social/api/'+content,headers=header)

    data=json.loads(response.text)

    df.loc[df['NeoDB链接'] == i, '封面'] = data['cover_image_url']

    df.loc[df['NeoDB链接'] == i, 'type'] = data['type']

    df.loc[df['NeoDB链接'] == i, 'brief'] = data['brief']

    actors = ','.join(data['actor'])

    df.loc[df['NeoDB链接'] == i, '演员'] = actors

    genre = ','.join(data['genre'])

    df.loc[df['NeoDB链接'] == i, '类型'] = genre

    df.loc[df['NeoDB链接'] == i, '年份'] = data['year']

    area=','.join(data['area'])

    df.loc[df['NeoDB链接'] == i, '地区'] = area

    df.loc[df['NeoDB链接'] == i, 'NeoDB评分'] = data['rating']

    print(f'Processing {x + 1}, Total {len(df)}')

    time.sleep(0.5)



df.to_csv('NeoDB备份.csv',index=False)

I'm not a programmer, so I don't know if the code is well written or not, but as long as it works, it's fine. Import the exported CSV into Notion and make some attribute changes, then it will be perfect.

Recently, I want to read

It is said that Notion can be used as a database. Just think about its possibilities, it's cool.

TO DO#

  • Now that it's built, the next step is to see how to mark on one website and update on three websites at the same time (after all, I'm not saying goodbye to Douban).
  • The "Game" section is currently empty.
  • Writing code is a bit enjoyable, I want to continue writing something else.

Interesting Things#

image

Monster Hunter World#

Although the Great Sword is cool, it's too easy to get hit. I've been stuck for a week. I've been farming for a long time to make the Great Sword, but it doesn't feel that good to use... I'm planning to switch to another weapon. It's really frustrating that you can't capture Elder Dragons. People say that the good-looking armor sets are in Iceborne, but it took me several hours to defeat the Steel Dragon. After defeating the Steel Dragon, I learned the Iai Slash (even though the New Year Swordsmanship was already good to use), and now I can do Iai Slash, Big Spin, Mount, and Cat Carve all in one combo. The cat is so clear.

And I've been catching cacti all over the Coral Highlands. The cacti in the neighboring Eorzea are played by Lalafell, and I caught a bunch of Lalafell.


There's nothing special to record this week. The air is bad and my mood is not good.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.