echo.
(echo.^<?xml version="1.0" encoding="GB18030"?^>
echo.^<rss version="2.0"^>
echo.^<channel^>
echo.^<title^>CCF精品技术论坛^</title^>
echo.^<link^>http://bbs.et8.net/^</link^>
echo.^<description^>CCF ClassiClubForm forum^</description^>
echo.^<language^>zh-cn^</language^>) >rss2.xml
for /f "delims=" %%x in (tmp.xml) do (
if %%x==^<
完整的脚本
@echo off
setlocal ENABLEDELAYEDEXPANSION
curl -b cookie@et8.txt -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -e "http://bbs.et8.net/" -o tmp1.txt http://bbs.et8.net/bbs/forumdisplay.php?f=17^&page=1^&pp=200^&daysprune=-1
iconv -c -f UTF-8 -t GB2312 tmp1.txt >temp.txt
for /f "delims=" %%z in (last.txt) do (set last=%%z)
set lastcheck=!last!
for /f "tokens=2-5 delims==<" %%i in ('findstr "showthread.php?s" temp.txt') do (
set tmp=%%l
set post=!tmp:~0,6%!
set title=!tmp:~8!
set flag=0
set first=1
if "%%i"=="a href" if /i !post! GTR !last! if NOT "!post!"=="lastpo" (
if !post! GTR !lastcheck! set lastcheck=!post!
echo.
(echo.^<item^>
echo.^<title^>!title!^</title^>
echo.^<link^>http://bbs.et8.net/bbs/showthread.php?t=!post!^</link^>
echo.^<description^>
echo.^<
]^>
echo.^</description^>
echo.^<pubDate^>^</pubDate^>
echo.^<author^>^</author^>
echo.^</item^>)>>tmp.xml
)
)
@echo !lastcheck! >last.txt
endlocal
echo.
(echo.^<?xml version="1.0" encoding="GB18030"?^>
echo.^<rss version="2.0"^>
echo.^<channel^>
echo.^<title^>CCF精品技术论坛^</title^>
echo.^<link^>http://bbs.et8.net/^</link^>
echo.^<description^>CCF ClassiClubForm forum^</description^>
echo.^<language^>zh-cn^</language^>) >rss2.xml
for /f "delims=" %%x in (tmp.xml) do (
if %%x==^<
保存为et8-rss.cmd即可双击运行。
RSS的使用
每次想要阅读之前只要先运行一遍 et8-rss.cmd 就可以更新 RSS 列出新帖。
生成的 rss2.xml 可以添加到 RSS 阅读器中,比如用 Firefox 的 Sage 扩展来阅读:

本文为chenke_ikari原创,首发于豆腐的简陋小屋
本文采用Creative Commons 署名-非商业性使用-相同方式共享 2.5 China 许可协议 进行许可

Last edited by ikari on 2006-8-2 at 13:40 ]