This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use utf8; | |
use Encode; | |
binmode STDOUT, ':utf8'; | |
for my $x (0xA4 .. 0xF9) { | |
for my $y (0x40 .. 0x7E, 0xA1 .. 0xFE) { | |
my $big5 = sprintf('%%%02X%%%02X', $x, $y); | |
my $char = Encode::decode(big5 => chr($x) . chr($y)); | |
print qq[curl -m 10 --retry 10 --retry-delay 10 'http://dict.revised.moe.edu.tw/cgi-bin/newDict/dict.sh?idx=dict.idx&cond=%5E$big5%24&pieceLen=100&fld=1&cat=&imgFont=1' | piconv -f big5 -t utf8 | perl -ne 'next unless m!^<table width="90%"! .. m!^</table!; s!<span class="key">(.+?)</span>!\$1!g; print' > "$char.html"\n]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* NEW BSD LICENSE {{{ | |
Copyright (c) 2009-2012, kozo2. | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
SRC=$PWD/data/ | |
DEST=$PWD/web.hotot.org/ | |
echo "\033[1;31;40m[i]Sync ...\033[0m" | |
# ignore .*.swp, .hgignore, etc | |
rsync -av --exclude '.*.*' --exclude '*.coffee' --exclude 'test*' $SRC $DEST | |
# replace conf.vars.platform, key and secret | |
echo "\033[1;31;40m[i] Replace platform, key and secret ...\033[0m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name douban_xiami | |
// @namespace org.kejun | |
// @include http://music.douban.com/* | |
// ==/UserScript== | |
//使用说明: | |
// 1. 安装本脚本到Greasemonkey | |
// 2. 到http://music.douban.com/recommended | |
// 3. 点击专辑封面会自动用虾米播放(如果窗口没弹出,检查是否被浏览器拦截) |