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 in Taiwan are still eating well, and netizens from southern mainland China are jealous.

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 starting work. Recently, when 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 happened that I always wanted a "Book, Movie, Game" database, so I decided to build one.

At that time, I manually entered the data 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 large). I searched online and found many strategies for "escaping Douban," such as the Douban backup and sync tool for books, movies, music, games, and stage plays recommended by many bloggers. However, when I opened it, it showed a 404 error (probably because it was warned). NeoDB recommended Doufen (Doufen), which is still quite useful, but I saw some bloggers 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 a few detours in the middle. My initial idea was to convert the exported .xlsx data from Douban into CSV format. If I want functions like "read," "want to read," "watched," "want to watch," etc., I just need to manually modify the file exported by Doufen. Then, I directly import the exported CSV file into Notion. In fact, this step can meet most of the requirements.

But I want a cover! Because the exported file contains Douban links, I initially wanted to use Python to directly crawl the images from Douban. At first, everything went well, but after crawling about a hundred images, I triggered the anti-crawling mechanism, and I was too lazy to study how to bypass it.

The key point is to praise Douban's alternative platform NeoDB. As mentioned earlier, after exporting, you can import it into NeoDB. Unlike Douban, this is an open platform that 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, movies, and games.

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',}#Here, you can just 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 while.

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'正在处理{x + 1},共{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 written well or not, but as long as it works, it's fine. Import the exported CSV into Notion and make some attribute changes, and it will be perfect.

Recently, I want to read a lot

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. Not being able to capture Elder Dragons is really frustrating. People say that the good-looking armor is in Iceborne, but it took me several hours to defeat the Steel Dragon. After defeating the Steel Dragon, I learned the Helm Breaker move (even though the Falling Shadow move was already good before), and now it's all about Helm Breaker, Big Spin, Mounting, and Palico's assistance.

And in the Ancient Forest, I caught a lot of Cactuars. The Cactuars in the neighboring Eorzea are played by Lalafells. I caught a bunch of Lalafells, more or less.


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

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