给含有mp3链接的网页添加在线播放功能

普遍适用的规则分享、讨论

Moderator: phoenix

Post Reply
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

给含有mp3链接的网页添加在线播放功能

Post by phoenix » Aug 25 2008, 22:24

原理很简单,就是检测到mp3链接后,插入 Yahoo! Media Player 的js代码。

Code: Select all

[Patterns]
Name = "Embed Yahoo! Media Player for Each Audio Link 2008.08.25 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<a[^>]+>*</a>"
Limit = 256
Match = "(<a*href=$AV(*.mp3)*>*</a>)\0$STOP()"
Replace = "\0\r\n"
          "<script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>"

imsheng
Posts: 37
Joined: Jan 08 2008, 13:24

Re: 给含有mp3链接的网页添加在线播放功能

Post by imsheng » Sep 14 2008, 20:04

代码写的很简练嘛。大家多学习!phoenix多发这样的通用规则呀。呵呵

Post Reply