GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — smallbasic.github.io/samples/node/1266.bas at master · smallbasic/smallbasic.github.io Expand file tree/ Copy path1266.basMore file actions 30 lines (28 loc) · 957 Bytes / Copy path1266.basFile metadata and controls30 lines (28 loc) · 957 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 print "DuckDuckGo Search" while 1 print '<=== when cycle around need to isolate input promt input "(Just enter quits) Term? ", queryTerm if trim(queryTerm)="" then ? "Cheers!":end '<=== need a way out url = "http://api.duckduckgo.com/?q=" + trim(queryTerm) + "&format=json" open url as #1 if (eof(1)) then throw "Connection failed: " + url fi dim results tload #1, results json = array(results) num_results = len(json.RelatedTopics) for i = 0 to num_results - 1 if (isarray(json.RelatedTopics(i).topics)) then num_topics = len(json.RelatedTopics(i).Topics) for t = 0 to num_topics - 1 print cat(1); " "; json.RelatedTopics(i).Topics(t).FirstURL; cat(0) print " "; json.RelatedTopics(i).Topics(t).text next t else print cat(1); " "; json.RelatedTopics(i).FirstURL; cat(0) print " "; json.RelatedTopics(i).Text endif next i Close #1 '<===== oh this helps! wend |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |