Skip to content

Instantly share code, notes, and snippets.

import requests
from bs4 import BeautifulSoup
import os
def get_episode(url):
res = requests.get(url).text
soup = BeautifulSoup(res, 'lxml')
mp3_href = soup.find(string='Herunterladen').parent['href']
mp3_url = base_url + mp3_href
import os
def change_dir(dir):
for root, dirs, files in os.walk(dir):
for f in files:
file_path = os.path.join(root, f)
change_file(file_path)
import requests
from bs4 import BeautifulSoup
with open("bank.html") as source:
soup = BeautifulSoup(source, "lxml")
sum = 0
for item in soup.div(class_="offscreen"):
try:
item = item.text.split(" ")[0]
integer, fraction = item.split(",")
@hengstchon
hengstchon / .vimrc
Last active March 12, 2020 09:40
My vimrc
"=======================================================================
" Plugin
"=======================================================================
call plug#begin('~/.vim/plugged')
" colorscheme
Plug 'morhetz/gruvbox'
Plug 'sainnhe/gruvbox-material'
" statusline
Plug 'itchyny/lightline.vim'
import os
from bs4 import BeautifulSoup, Comment, Tag, NavigableString
import requests
import unicodedata
result = './result.txt'
result_body = './body.txt'
md_dir = '/Users/yh/Documents/myblog/content/blog/'
url_file = 'url.txt'
import sys
from bs4 import BeautifulSoup
if len(sys.argv) < 2:
print("Need file name!")
sys.exit(2)
with open(sys.argv[1]) as f:
s = f.read()
@hengstchon
hengstchon / .Xresources
Created September 30, 2019 17:04
dotfiles
Xft.dpi:96
URxvt.font: xft:Inconsolata Nerd Font Mono:size=14
! scrollbar
Rxvt.scrollBar:False
Rxvt.saveLines:10000
! input method
URxvt.inputMethod:fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
# set key delay and repeat
xset r rate 250 25
# urxvt config
xrdb ~/.Xresources
[ -f ~/.xprofile ] && . ~/.xprofile
@hengstchon
hengstchon / i3 config
Created September 30, 2019 17:13
~/.config/i3/config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!