Page 1 of 1

Google Docs Viewer 在线阅读

Posted: Dec 19 2009, 23:35
by phoenix
如下规则将给 Google Docs Viewer 支持的文档类型的链接增加一个在线阅读的链接。

Code: Select all

[Patterns]
Name = "Add Google Docs Viewer 2009.11.02 [phoenix]"
Active = TRUE
Bounds = "<a\s*</a>"
Limit = 256
Match = "\1&*href=$AV((http://(^docs.google.com)*.(pdf|ppt|tiff))\2)"
Replace = "\1 <a title="Google Docs Viewer" href="http://docs.google.com/viewer?url=$ESC(\2)"><img src="http://docs.google.com/favicon.ico"></a>"
示例页面: http://www.catonmat.net/projects/cheat-sheets

Re: Google Docs Viewer 在线阅读

Posted: Jan 06 2010, 15:35
by 不夜侯
像源代码中href地址没有给出 http://www.cninfo.com.cn/ 前缀的,能否自动补全?
代码:

Code: Select all

<a href='../../finalpage/2009-03-27/50630322.PDF' target=_top>上海建工:2008年年度报告摘要</a>
示例地址:
http://www.cninfo.com.cn/gszx/dqbg600170.html

Re: Google Docs Viewer 在线阅读

Posted: Jan 06 2010, 16:54
by ddbb
我觉得如果你真要做的话 还是用JS来写比较方便

PROX我只会写一种情况的...如果考虑别的情况 我就不会写了.... :cry:

Re: Google Docs Viewer 在线阅读

Posted: Jan 06 2010, 17:44
by 不夜侯
我用opera,对于那种情况修改右键更方便些。

Code: Select all

Copy link & Go to page, "http://docs.google.com/viewer?url=%c"

Re: Google Docs Viewer 在线阅读

Posted: Jan 07 2010, 11:36
by phoenix
不夜侯 wrote:像源代码中href地址没有给出 http://www.cninfo.com.cn/ 前缀的,能否自动补全?
代码:

Code: Select all

<a href='../../finalpage/2009-03-27/50630322.PDF' target=_top>上海建工:2008年年度报告摘要</a>
示例地址:
http://www.cninfo.com.cn/gszx/dqbg600170.html
jjoe 写过这种规则,见附件。

Re: Google Docs Viewer 在线阅读

Posted: Mar 01 2011, 16:44
by phoenix
Google Docs Viewer 支持更多格式了,更新一下。

Code: Select all

[Patterns]
Name = "Add Google Docs Viewer 2011.02.18 [phoenix]"
Active = TRUE
Bounds = "<a\s*</a>"
Limit = 256
Match = "\1&*href=$AV((http://(^docs.google.com)*"
        ".(ai|doc|docx|dxf|eps|pages|pdf|ppt|pptx|ps|psd|svg|tiff|ttf|xls|xlsx|xps))\2)"
Replace = "\1 <a title="Google Docs Viewer" href="http://docs.google.com/viewer?url=$ESC(\2)"><img src="http://docs.google.com/favicon.ico"></a>"