Skip to content

Instantly share code, notes, and snippets.

@hlb
hlb / import_notion.py
Last active January 2, 2024 18:52
文章匯入 Notion,以及彙整 Notion AI 摘要的程式
import requests # 引入 requests 模組用於發送 HTTP 請求
import json # 引入 json 模組用於處理 JSON 資料
import sys # 引入 sys 模組用於處理系統相關的參數和功能
import configparser # 引入 configparser 模組用於讀取配置文件
# 檢查是否有提供必要的命令行參數
if len(sys.argv) < 2:
print("Usage: python import_notion.py path/to/json")
sys.exit(1)
@hlb
hlb / article_scraper.py
Created December 3, 2023 10:34
iThome 爬蟲程式
# 匯入所需的模組
from requests.exceptions import HTTPError
import requests
from bs4 import BeautifulSoup
import argparse
import json
import os
def extract_article_details(url):
"""
@hlb
hlb / Brewfile
Last active June 14, 2022 02:48 — forked from saetia/gist:1623487
Clean Install Script
cask_args appdir: '/Applications'
tap 'caskroom/cask'
tap "homebrew/cask-fonts"
tap 'caskroom/versions'
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/services"
tap "hsatac/toybox"
brew "coreutils"
brew "gnu-sed"