Yahoo! search interface: Difference between revisions

(icon)
(→‎Icon and {{header|Unicon}}: tweaks and outpur)
Line 129:
==Icon and {{header|Unicon}}==
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
 
procedure main()
YS := YahooSearch("rosettacode")
every 1 to 2 do { ###### 2 pages
YS.readnext()
YS.showinfo()
Line 168 ⟶ 169:
end
initially(searchtext) #: initialize each instance
urlpat := sprintf("http://search.yahoo.com/search?p=%s&b=%%d",searchtext)
page := 0
Line 177 ⟶ 178:
[http://www.cs.arizona.edu/icon/library/src/procs/strings.icn strings.icn provides deletec]
 
Output:<pre></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 &quot;Roman_numerals&quot; (<b>R
osettaCode</b>) CALL transfers control to the first statement of a SUBROUTINE. C
ALL subroutine_name[argument1, ..."</pre>
 
=={{header|Java}}==
Anonymous user