Windows RSS Platform を使ってWeb Feedsからタイトルを検索する

| コメント(0) | トラックバック(0)

Internet Explorer 7と共に使用可能になる、Windows RSS Platformを使うと、Internet Explorerで購読したフィードをスクリプトから参照できます。サンプルとして、フィードのタイトルから指定文字列を検索するものを示します。なお、このスクリプトはsearcharticle.zipとして取得可能です。

<?xml version="1.0" encoding="Shift_JIS" standalone="yes" ?>
<package>
<job id="SearchArticle">
<?job error="True" debug="True" ?>
<object id="objManager" progid="Microsoft.FeedsManager" />
<runtime>
<description>Web Feeds から指定された文字列をタイトルに含むアーティクルを検索する</description>
<unnamed name="searchString" helpstring="検索文字列" many="False" required="1" />
<example>SearchArticle.wsf</example>
</runtime>
<script language="VBScript">
<![CDATA[
Sub DumpItems(feed)
Dim item

For Each item in feed.Items
If searchString <> "" Then
If Instr(item.Title, searchString) Then
WScript.StdOut.WriteLine "Title: " & item.Title
WScript.StdOut.WriteLine "Link: " & item.Link
End If
Else
WScript.StdOut.WriteLine item.Title
End If
Next
End Sub

Sub Cruise(folder)
Dim feed, subfolder
For Each feed In folder.Feeds
DumpItems(feed)
Next
For Each subfolder in folder.Subfolders
Cruise(subfolder)
Next
End Sub

Dim rootFolder, searchString

Set rootFolder = objManager.RootFolder
If WScript.Arguments.Length < 1 Then
searchString = ""
Cruise(rootFolder)
Else
searchString = WScript.Arguments.Item(0)
Cruise(rootFolder)
End If

Cruise(rootFolder)
]]>
</script>
</job>
</package>

トラックバック(0)

トラックバックURL: http://www.cworld2000.com/cgi-bin/mt/mt-tb.cgi/219

コメントする

Recent Tracks

gorn708's Profile Page

このブログ記事について

このページは、gornが2006年10月31日 15:02に書いたブログ記事です。

ひとつ前のブログ記事は「Poser 入手」です。

次のブログ記事は「Web Feedsからのアーティクルの検索」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

Adwords