RosettaCodeData/Task/Yahoo-search-interface/TXR/yahoo-search-interface.txr
2023-07-01 13:44:08 -04:00

22 lines
454 B
Text

#!/usr/bin/txr -f
@(next :args)
@(cases)
@ QUERY
@ PAGE
@(or)
@ (throw error "specify query and page# (from zero)")
@(end)
@(next (open-command "!wget -O - http://search.yahoo.com/search?p=@QUERY\&b=@{PAGE}1 2> /dev/null"))
@(all)
@ (coll)<a class="yschttl spt" href="@URL" @/[^>]+/>@TITLE</a>@(end)
@(and)
@ (coll)<div class="@/abstr|sm-abs/">@ABSTR</div>@(end)
@(end)
@(output)
@ (repeat)
TITLE: @TITLE
URL: @URL
TEXT: @ABSTR
---
@ (end)
@(end)