Archives

Archive for July, 2007

Fanfou Logo

Fanfou Tools 更新到 v1.0b6,修改的地方不多,只增加一个特性。

激活该选项后,Notify Post 时,该插件将会把冗长的 Permalink URL 转换为长度较短的 Tiny URL。

由于需要连接到 tinyurl.com 来转换 URL,所以对发贴的速度将会有所影响。

详细信息、下载,请访问:
WordPress Plugin – Fanfou Tools

Comments Off
Jul 5th, 2007 | Filed under WordPress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * transform
 *
 * @param mixed $url
 * @access public
 * @return void
 */
function transform($url) {
    if (empty($url) or !preg_match('|^(?:http://)?([^/]+)|i', $url)) {
        return;
    }
 
    $url     = "http://tinyurl.com/create.php?url=$url";
    $content = file_get_contents($url);
    $pattern = '|<blockquote><b>(http://tinyurl\.com/([^<]+))</b><br><small>|i';
    preg_match($pattern, $content, $matches);
    return $matches[1];
}
 
// }}}
 
 
// {{{ revert($tinyurl)
 
/**
 * revert
 *
 * @param mixed $tinyurl
 * @access public
 * @return void
 */
function revert($tinyurl) {
    $url     = explode('.com/', $tinyurl);
    $url     = 'http://preview.tinyurl.com/' . $url[1];
    $preview = file_get_contents($url);
    $pattern = '/redirecturl" href="(.*)">/i';
    preg_match($pattern, $preview, $matches);
    return $matches[1];
}
 
// }}}
 
/* vim: set expandtab tabstop=4 shiftwidth=4: */

无法使用中文URL,官方转换的 URL 如果其中还有中文似乎也有问题。 :grin:

Comments Off
Jul 4th, 2007 | Filed under PHP
Tags: ,

Build from:
Cygwin with GCC

Patches:
Included patches: 1-32

Interfaces supported:

  1. ActivePerl 5.8
  2. ActiveTcl 8.4
  3. MzScheme 370
  4. Python 2.5
  5. Ruby 1.8.6

Download:
http://www.phpvim.net/files/vim/vim71-latest.7z

Jul 2nd, 2007 | Filed under Vim
Tags: ,