Skip to content

Instantly share code, notes, and snippets.

View tigerwang202's full-sized avatar

Wang tigerwang202

  • Embedded development hobbyist
  • Madagascar
View GitHub Profile
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# https://gist.github.com/tigerwang202/ba16e5a31e0da3c307cc#file-m163api-py
import re
import os
import sys
import md5
import json
import random
@tigerwang202
tigerwang202 / fetch61eda.py
Last active August 29, 2015 14:24
Fetch ebooks on 61eda website. Need beautifulSoup4 wget
# -*- coding: utf-8 -*-
import sys
import requests
import urlparse
import os
import time
from bs4 import BeautifulSoup
agent_string = '''"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; \
Acoo Browser 1.98.744; .NET CLR 3.5.30729)"'''
@tigerwang202
tigerwang202 / addlrc.py
Last active November 7, 2015 13:47 — forked from scturtle/addlrc.py
import eyed3
import re
import glob
def get_lyric(lrc):
text = open(lrc).read()
text = re.sub(r'(?:\[.*\])+', '', text).strip()
text = map(lambda l: l.strip(), text.split('\n'))
ans = []
for l in text:
# -*- coding: utf-8 -*-
# 导入未被iTurns收录的MP3歌曲
# wmy 2014-4-30
import os
import re
import shutil
iturns_library_path = '/Users/wang/Music/iTunes/iTunes Media/Music'
target_library_path = '/Volumes/共享/我喜欢的音乐' # 需导入歌曲目录
@tigerwang202
tigerwang202 / fetch_voa_special_english_mp3.py
Created March 2, 2012 11:35
Fetch VOA Special English RSS feed & convert it to html file
# -*- coding: utf-8 -*-
# Fetch VOA Special English
# wangmengyin 2012-02-26
import urllib.request
import urllib.error
from xml.dom import minidom, Node
from os import system, path
import os
import re
import sys