Yahoo! search interface: Difference between revisions
Content added Content deleted
(icon) |
(→Icon and {{header|Unicon}}: tweaks and outpur) |
||
Line 129: | Line 129: | ||
==Icon and {{header|Unicon}}== |
==Icon and {{header|Unicon}}== |
||
The following uses the Unicon pre-processor and messaging extensions and won't run under Icon without significant modification. |
The following uses the Unicon pre-processor and messaging extensions and won't run under Icon without significant modification. |
||
The code provides a suitable demonstration; however, could be made more robust by things such as URL escaping the search string |
|||
<lang Icon>link printf,strings |
<lang Icon>link printf,strings |
||
procedure main() |
procedure main() |
||
YS := YahooSearch("rosettacode") |
YS := YahooSearch("rosettacode") |
||
every 1 to 2 do { # |
every 1 to 2 do { # 2 pages |
||
YS.readnext() |
YS.readnext() |
||
YS.showinfo() |
YS.showinfo() |
||
Line 168: | Line 169: | ||
end |
end |
||
initially(searchtext) |
initially(searchtext) #: initialize each instance |
||
urlpat := sprintf("http://search.yahoo.com/search?p=%s&b=%%d",searchtext) |
urlpat := sprintf("http://search.yahoo.com/search?p=%s&b=%%d",searchtext) |
||
page := 0 |
page := 0 |
||
Line 177: | Line 178: | ||
[http://www.cs.arizona.edu/icon/library/src/procs/strings.icn strings.icn provides deletec] |
[http://www.cs.arizona.edu/icon/library/src/procs/strings.icn strings.icn provides deletec] |
||
Output:< |
Output:<pre> |
||
Title : "<b>Rosetta Code</b> - <b>Rosetta Code</b>" |
|||
URL : "http://rosettacode.org/" |
|||
Abstr : "<b>Rosetta Code</b> is a programming chrestomathy site. The idea is to |
|||
present solutions to the same task in as many different languages as possible, t |
|||
o demonstrate how ..." |
|||
Title : "<b>Rosetta Code</b> - Wikipedia, the free <wbr />encyclopedia" |
|||
URL : "http://en.wikipedia.org/wiki/Rosetta_Code" |
|||
Abstr : " <b>Rosetta Code</b> is a wiki -based programming chrestomathy website |
|||
with solutions to various programming problems in many different programming lan |
|||
guages. It was created ..." |
|||
Title : "Category:AutoHotkey - <b>Rosetta Code</b>" |
|||
URL : "http://rosettacode.org/wiki/Category:AutoHotkey" |
|||
Abstr : "Listed below are all of the tasks on <b>Rosetta Code</b> which have bee |
|||
n solved using AutoHotkey." |
|||
... |
|||
Title : "RosettaCON2011 Tutorials Collection | <wbr />RosettaCommons" |
|||
URL : "http://www.rosettacommons.org/" |
|||
Abstr : "Foldit in the news. Cooper et al. 2010 Predicting protein structures wi |
|||
th a multiplayer online game, Nature 466 , 756 see also video. Rosetta-3.3 is no |
|||
w available!" |
|||
Title : "CALL: call a SUBROUTINE - HicEst: <wbr />Windows IDE programming ..." |
|||
URL : "http://www.hicest.com/CALL.htm" |
|||
Abstr : "\xe2\x87\x92 Example of a CALL call in "Roman_numerals" (<b>R |
|||
osettaCode</b>) CALL transfers control to the first statement of a SUBROUTINE. C |
|||
ALL subroutine_name[argument1, ..."</pre> |
|||
=={{header|Java}}== |
=={{header|Java}}== |