RSS の要素に対する条件指定

yql こと、Yahoo!Query Language の話

like と matches が使える。like は、SQL同等で、大文字小文字同一。
matches は、正規表現が指定出来る。user-time,service-timeを見た限りでは
どちらも大して変わらないかな。
ちなみにこれは、指定した RSS の title とか description でフィルタリングする
LOCAL Filters の話。query=... などのサーバへの queryでのフィルタリングは、REMOTE Filters となる。

select title,link,description,date from rss 
 where url="http://news.rkb.ne.jp/rkb_news/index.xml" and 
  description like "%北九州%"
-- description に「北九州」を含むもの
select title from rss 
 where url="http://mobiletsusin2.blog33.fc2.com/?xml" and 
  title matches ".*au.*"
-- title に「au」を含むもの

これの結果は、こう だ。

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="3" yahoo:created="2011-01-29T14:22:54Z" yahoo:lang="en-US">
    <diagnostics>
        <publiclyCallable>true</publiclyCallable>
        <redirect from="http://mobiletsusin2.blog33.fc2.com/?xml" status="302"><![CDATA[http://feeds.fc2.com/fc2/xml?host=mobiletsusin2.blog33]]></redirect>
        <url execution-time="199" proxy="DEFAULT"><![CDATA[http://mobiletsusin2.blog33.fc2.com/?xml]]></url>
        <user-time>201</user-time>
        <service-time>199</service-time>
        <build-version>10970</build-version>
    </diagnostics> 
    <results>
        <item xmlns="http://purl.org/rss/1.0/">
            <title>&#12304;&#26481;&#26085;&#26412;&#12305;au&#12471;&#12531;&#12503;&#12523;&#12467;&#12540;&#12473; &#19968;&#25324;&#23433;&#22770;&#12426;&#24773;&#22577; Part52</title>
        </item>
        <item xmlns="http://purl.org/rss/1.0/">
            <title>au Cyber-shot S006 by Sony Ericsson stage 5</title>
        </item>
        <item xmlns="http://purl.org/rss/1.0/">
            <title>au Cyber-shot&#25658;&#24111; S003 by Sony Ericsson stage4</title>
        </item>
    </results>
</query>
  1. 米 Yahoo! が SQL っぽく色んなデータを取ってこれるAPIを出した
  2. XSLTも使わないAmazon最速検索
  3. 「YQL: select * from internet」