<snapdata remixID="7570682"><project name="weather" app="Snap! 7, https://snap.berkeley.edu" version="2"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAABnJJREFUeF7tmX9InHUcxz+HCstCEURPhDBCmN5CVDTS1InbnDL/8I8C07TpEjuF/ig8f8BkEuHMLEKY0vzHSX+JsDESk8CGDhVT8I9DBFErDdwk1PP3r/g+0OGhwrxOvr7P9wNDvef5fj/vHy+f57yZDg4ODoQHE9CUgIkAakqeY40ECCBB0JrAiQCOjo7K0NCQ7OzsaBXo6eEhISGSn5/v6W25n5sJHAFwY2ND5ubmxM/Pz80tz3ZZQECAfPflJ/LyxeKpBt0urZCQd953runp6ZGKiopT7cGLPZ/AEQAnJyc9P8WDOz76plqqg393a8eXnz2Tzc1N59rnz59LcXGxW3txkWcScAGwv79fgoODXXZ++vSp3Lp168g0VeSlS5eM18fHxyU2Ntb5dWZmRsLCwpznj5NaX18vd+/efSUXZWVl0traalz7lfVDefie49h1b9z/Qxy2N0/c80XZb7K2tuY8v7W1JfHx8a+kgRedTQIuACoocnJyXCbZ7XYpKCgwXlN3jKSkJMnMzJTe3l7p7OyU6OhoiYuLk8XFRVHvr9TR3d0tGRkZEhgYaPw8NjZmXHPlyhXjnMPhMH4+fK60tFTUL8DU1JTMzs5KRESEqLvx5cuXjevU9+vr63L/8/xjAXy9ZkTWvk6U1z79STZ+/OjYtP6+86sx+/ChfnF46EvABcB79+5Jdna2ixoFhAJQwfnfnairq0uioqKkublZ5ufnJTExUUZGRmR7e1tqamqkqqpKkpOTpbKyUsLDw+XatWtisVgMuNva2mR1dVXa29ud5xTU6oiMjJTHjx8br6u1at2NGzeMdQ8ePDDuXt9+UeQ2gH/d/sWYffhISEjQlz4nu34MMzw8LHt7ey6xqMepAlA9ZtVj1Ww2y8DAgKjX1T91p1NQVVdXy9LSkvFVwZOSkiI2m01CQ0PFarUa6xRMCtrl5WXp6OhwOaf2VFCWlJQYd86WlhYpLCw0QFZ33MbGRuPu9YPtjjxMcu8RPPvxz7KysuL0p4C+fv06MdCYwJE/Qp48eeJ8dHpS19WrV427aGpq6v/a9lFTjXwf/adbe0x+0O3yHnBhYUHy8vLc2ouLPJPAsZ8DqkdsUFCQZyacwS7vWt6W3X8WTrWzKfgtGZ2wO9f09fVJQ0PDqfbgxZ5P4MQPoqenp2ViYkLUX4redKi3BOnp6d5kCdoL/ysOuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoBwQQuj588QQQv0NoB+cewLq6OrHZbOLv7w8dNMUfn8C5B3BwcFCamppkf39fzGazxMTEiNVqZZ9eksC5B1DlrABUIB4+HA6HxMfHS3p6umRmZnpJHRfPBgSAdrtdamtrj7Szu7srFotF0tLSJCsr6+K15wWOIQDMzc01ojaZTOLj4yNFRUVy8+ZN8fX19YIKLraFcw+guruVl5cbd7nQ0NCL3ZYXuj/3AHph5rR0KAECSBy0JkAAtcbP4QSQDGhNgABqjZ/DCSAZ0JoAAdQaP4cTQDKgNQECqDV+DieAZEBrAgRQa/wcTgDJgNYECKDW+DmcAJIBrQkQQK3xczgBJANaEyCAWuPncAJIBrQmQAC1xs/hBJAMaE2AAGqNn8MJIBnQmgAB1Bo/hxNAMqA1AQKoNX4O/xcrCD3GtafSngAAAABJRU5ErkJggg==</thumbnail><scenes select="1"><scene name="weather"><notes></notes><hidden></hidden><headers></headers><code></code><blocks><block-definition s="Does %&apos;word&apos; begin with a capital letter?" type="reporter" category="other"><comment x="0" y="0" w="225.00000000000003" collapsed="false">Reports true if word starts with a capital letter between A and Z. May need to be modified for other languages.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><custom-block s="let %upvar be %s"><l>first letter</l><block s="reportLetter"><l>1</l><block var="word"/></block></custom-block><custom-block s="let %upvar be %s"><l>code for first letter</l><block s="reportUnicode"><block var="first letter"/></block></custom-block><block s="doReport"><block s="reportNot"><block s="reportOr"><block s="reportLessThan"><block var="code for first letter"/><block s="reportUnicode"><l>A</l></block></block><block s="reportGreaterThan"><block var="code for first letter"/><block s="reportUnicode"><l>Z</l></block></block></block></block></block></script></block-definition><block-definition s="speak weather %&apos;aspect&apos; of %&apos;weather data&apos;" type="command" category="sound"><comment x="0" y="0" w="382.8571428571429" collapsed="false">Speaks the response from Yahoo! weather. If the aspect is &apos;forecast&apos; then only the first forecast is spoken.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportEquals"><block var="aspect"/><l>description</l></block><script><custom-block s="Speak until done %txt"><block var="weather data"/></custom-block><block s="bubble"><block var="weather data"/></block></script><script><custom-block s="let %upvar be %s"><l>information</l><custom-block s="if %b then %anyUE else %anyUE"><block s="reportEquals"><block var="aspect"/><l>forecast</l></block><block s="reportListItem"><l>1</l><block var="weather data"/></block><block var="weather data"/><comment w="195" collapsed="true">Picks out only the first forecast.</comment></custom-block></custom-block><custom-block s="for each %upvar of %l %cs"><l>item</l><block var="information"/><script><custom-block s="Speak until done %txt"><block s="reportJoinWords"><list><l>The </l><block s="reportListItem"><l>1</l><block var="item"/></block><l> is </l><block s="reportListItem"><l>2</l><block var="item"/></block><l>.</l></list></block></custom-block></script></custom-block><block s="bubble"><block var="information"/></block></script></block></script></block-definition><block-definition s="Report the weather" type="command" category="sound"><comment x="0" y="0" w="586.4285714285714" collapsed="false">Listens for a proper noun and one of &apos;wind&apos;, &apos;condition&apos;, &apos;forecast&apos;, &apos;atmosphere&apos;, or &apos;description&apos;. And then speaks the response from Yahoo! weather.</comment><header></header><code></code><translations></translations><inputs></inputs><script><custom-block s="let %upvar be %s"><l>spoken</l><custom-block s="the next thing spoken"></custom-block></custom-block><block s="doThink"><block s="reportJoinWords"><list><l>I think I heard "</l><block var="spoken"/><l>".</l></list></block></block><custom-block s="let %upvar be %s"><l>words</l><block s="reportTextSplit"><block var="spoken"/><l><option>whitespace</option></l></block></custom-block><custom-block s="let %upvar be %s"><l>proper nouns</l><custom-block s="keep items such that %predRing from %l"><block s="reifyPredicate"><autolambda><custom-block s="Does %txt begin with a capital letter?"><block var="word"/></custom-block></autolambda><list><l>word</l></list></block><block var="words"/></custom-block></custom-block><block s="doIfElse"><block s="reportGreaterThan"><block s="reportListAttribute"><l><option>length</option></l><block var="proper nouns"/></block><l>0</l></block><script><custom-block s="let %upvar be %s"><l>place</l><custom-block s="list $arrowRight word %l"><custom-block s="map %repRing over %l"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l> </l></list></block></autolambda><list></list></block><block var="proper nouns"/></custom-block></custom-block><comment w="310.7142857142857" collapsed="true">This turns multiple word place names into a single word...</comment></custom-block><custom-block s="for each %upvar of %l %cs"><l>item</l><block s="reportNewList"><list><l>wind</l><l>forecast</l><l>condition</l><l>atmosphere</l><l>astronomy</l></list></block><script><block s="doIf"><block s="reportListContainsItem"><block var="words"/><block var="item"/></block><script><custom-block s="let %upvar be %s"><l>weather</l><custom-block s="weather in %txt select %txt in %txt units"><block var="place"/><block var="item"/><l>metric</l></custom-block></custom-block><custom-block s="speak weather %txt of %l"><block var="item"/><block var="weather"/></custom-block></script></block></script></custom-block></script><script></script></block></script></block-definition><block-definition s="Listen to the microphone $nl %&apos;handle response&apos; when recognition completes $nl but if error %&apos;handle error&apos; with error message" type="command" category="sensing"><comment x="0" y="0" w="300" collapsed="false">Listens to the microphone for speech. The first script is run with the recognized text unless an error is encountered then the second script is called with text describing the error.</comment><header></header><code></code><translations></translations><inputs><input type="%cmdRing"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>start_speech_recognition</l><list><block var="handle response"/><block var="handle error"/></list></custom-block></script></block-definition><block-definition s="keep items such that %&apos;pred&apos; from %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations>de:behalte Elemente, die _ aus _&#xD;</translations><inputs><input type="%predRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script></block><block s="doIfElse"><block s="evaluate"><block var="pred"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><script><block s="doReport"><block s="reportCONS"><block s="reportListItem"><l>1</l><block var="data"/></block><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script><script><block s="doReport"><custom-block s="keep items such that %predRing from %l"><block var="pred"/><block s="reportCDR"><block var="data"/></block></custom-block></block></script></block></script></block-definition><block-definition s="if %&apos;test&apos; then %&apos;true&apos; else %&apos;false&apos;" type="reporter" category="control"><header></header><code></code><translations>de:wenn _ dann _ sonst _&#xD;</translations><inputs><input type="%b"></input><input type="%anyUE"></input><input type="%anyUE"></input></inputs><script><block s="doIfElse"><block var="test"/><script><block s="doReport"><block s="evaluate"><block var="true"/><list></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="false"/><list></list></block></block></script></block></script></block-definition><block-definition s="list $arrowRight word %&apos;list&apos;" type="reporter" category="operators"><header></header><code></code><translations>de:Liste $arrowRight Wort _&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><block var="list"/></block></block></script></block-definition><block-definition s="map %&apos;func&apos; over %&apos;data&apos;" type="reporter" category="lists"><header></header><code></code><translations>de:wende _ an auf _&#xD;</translations><inputs><input type="%repRing"></input><input type="%l"></input></inputs><script><block s="doIf"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doReport"><block var="data"/></block></script></block><block s="doReport"><block s="reportCONS"><block s="evaluate"><block var="func"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><custom-block s="map %repRing over %l"><block var="func"/><block s="reportCDR"><block var="data"/></block></custom-block></block></block></script></block-definition><block-definition s="the next thing spoken" type="reporter" category="sensing"><comment x="0" y="0" w="281.42857142857144" collapsed="false">Reports the last thing spoken or if there was an error the error message. Note that &quot;no-speech&quot; is an error message while if spoken it will be &quot;no speech&quot;. NOTE that this waits for something to be spoken or enough time has passed.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>spoken or error messge</l></list></block><custom-block s="Listen to the microphone %br %cmdRing when recognition completes %br but if error %cmdRing with error message"><block s="reifyScript"><script><block s="doSetVar"><l>spoken or error messge</l><l></l></block></script><list></list></block><block s="reifyScript"><script><block s="doSetVar"><l>spoken or error messge</l><l></l></block></script><list></list></block></custom-block><block s="doWaitUntil"><block var="spoken or error messge"/></block><block s="doReport"><block var="spoken or error messge"/></block></script></block-definition><block-definition s="Speak %&apos;message&apos; then %&apos;to do when finished speaking&apos;" type="command" category="sound"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%cmdRing"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>speak_using_browser_voices_or_mary_tts</l><list><block var="message"/><block var="to do when finished speaking"/></list></custom-block></script></block-definition><block-definition s="Speak until done %&apos;message&apos;" type="command" category="sound"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doDeclareVariables"><list><l>response</l></list></block><block s="doSetVar"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><custom-block s="Speak %txt then %cmdRing"><block var="message"/><block s="reifyScript"><script><block s="doSetVar"><l>response</l><block var="r"/></block></script><list><l>r</l></list></block></custom-block><block s="doWaitUntil"><block s="reportNot"><block s="reportEquals"><block var="response"/><block s="reportBoolean"><l><bool>false</bool></l></block></block></block></block></script></block-definition><block-definition s="for each %&apos;item&apos; of %&apos;data&apos; %&apos;action&apos;" type="command" category="lists"><header></header><code></code><translations>de:für jedes _ von _ _&#xD;</translations><inputs><input type="%upvar"></input><input type="%l"></input><input type="%cs"></input></inputs><script><block s="doUntil"><custom-block s="empty? %l"><block var="data"/></custom-block><script><block s="doSetVar"><l>item</l><block s="reportListItem"><l>1</l><block var="data"/></block></block><block s="doRun"><block var="action"/><list><block s="reportListItem"><l>1</l><block var="data"/></block></list></block><block s="doSetVar"><l>data</l><block s="reportCDR"><block var="data"/></block></block></script></block></script></block-definition><block-definition s="Try to load ecraft2learn library" type="reporter" category="other"><comment x="0" y="0" w="323.5714285714286" collapsed="true">Should only be called by Load eCraft2Learn library</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list></list><l>if (typeof ecraft2learn === &apos;object&apos;) {&#xD;   return true;&#xD;}&#xD;if (window.waiting_for_ecraft2learn_library) {&#xD;   return false;&#xD;}&#xD;window.waiting_for_ecraft2learn_library = true;&#xD;let script = document.createElement("script");&#xD;script.type = "text/javascript";&#xD;if (window.location.hostname === &apos;localhost&apos;) {&#xD;    script.src = window.location.protocol + "//" + window.location.host + "/ai/ecraft2learn-beta.js"; // notice this the beta version&#xD;} else {&#xD;    script.src = "https://ecraft2learn.github.io/ai/ecraft2learn.js";&#xD;}&#xD;document.head.appendChild(script);&#xD;return false;</l></block><list></list></block></block></script></block-definition><block-definition s="empty? %&apos;data&apos;" type="predicate" category="lists"><header></header><code></code><translations>de:ist _ leer?&#xD;</translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportEquals"><block var="data"/><block s="reportNewList"><list></list></block></block></block></script></block-definition><block-definition s="weather in %&apos;place&apos; select %&apos;element&apos; in %&apos;units&apos; units" type="reporter" category="sensing"><comment x="0" y="0" w="251" collapsed="false">Reports an aspect of the weather at the &apos;place&apos;.&#xD;Brought to you by Yahoo! weather.&#xD;Documentation at https://developer.yahoo.com/weather/documentation.html</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%txt"><options>forecast&#xD;condition&#xD;atmosphere&#xD;wind&#xD;location&#xD;astronomy&#xD;latitude&#xD;longitude&#xD;everything</options></input><input type="%txt">metric<options>metric&#xD;imperial</options></input></inputs><script><custom-block s="let %upvar be %s"><l>response</l><block s="reportBoolean"><l><bool>false</bool></l></block></custom-block><custom-block s="weather in %txt select %txt in %txt units %br then receive response %cs %br or if an error %cs"><block var="place"/><block var="element"/><block var="units"/><script><block s="doSetVar"><l>response</l><l></l></block></script><script><block s="doSetVar"><l>response</l><block s="reportJoinWords"><list><l>Error from Yahoo! weather </l><l></l></list></block></block></script></custom-block><block s="doWaitUntil"><block var="response"/></block><block s="doReport"><block var="response"/></block></script></block-definition><block-definition s="weather in %&apos;place&apos; select %&apos;element&apos; in %&apos;units&apos; units $nl then receive response %&apos;do with response&apos; $nl or if an error %&apos;do if error&apos;" type="command" category="sensing"><comment x="0" y="0" w="289" collapsed="false">Passes the response from Yahoo! weather for the place and specified aspect and units to &apos;do with response&apos; unless there is an error then &apos;do if error&apos; is run with a description of the error.&#xD;Documentation at https://developer.yahoo.com/weather/documentation.html</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%txt"><options>forecast&#xD;condition&#xD;atmosphere&#xD;wind&#xD;location&#xD;description&#xD;astronomy&#xD;latitude&#xD;longitude&#xD;everything</options></input><input type="%txt">metric<options>metric&#xD;imperial</options></input><input type="%cs"></input><input type="%cs"></input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>weather</l><list><block var="place"/><block var="element"/><block var="units"/><block var="do with response"/><block var="do if error"/><l>dj0yJmk9aFhOSVcyQmtLNGZLJnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PTVh</l><block s="reportJoinWords"><list><l>8cf490709df99037de2d42651</l><l>c887935d05a879d</l></list></block></list></custom-block></script></block-definition><block-definition s="Open this in a new tab" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>re_open_full_window</l><list></list></custom-block></script></block-definition><block-definition s="label %&apos;text&apos; of size %&apos;size&apos;" type="command" category="pen"><comment x="0" y="0" w="90" collapsed="false">LABEL will stamp text on the stage at the given font size. The direction of the text is the direction the sprite is facing, and color will match the pen color.</comment><header></header><code></code><translations>de:drucke _ in Größe _&#xD;</translations><inputs><input type="%txt">Hello!</input><input type="%n">12</input></inputs><script><custom-block s="run eCraft2Learn command %txt with %mult%s"><l>label_of_size</l><list><block var="text"/><block var="size"/></list></custom-block></script><scripts><script x="152.14285714285714" y="80.59523809523814"><block s="doRun"><block s="reportJSFunction"><list><l>text</l><l>size</l></list><l>var stage = this.parentThatIsA(StageMorph),&#xD;    context = stage.penTrails().getContext(&apos;2d&apos;),&#xD;    rotation = radians(this.direction() - 90),&#xD;    trans = new Point(&#xD;      this.center().x - stage.left(),&#xD;      this.center().y - stage.top()&#xD;    ),&#xD;    isWarped = this.Warped,&#xD;    len,&#xD;    pos;&#xD;&#xD;if (isWarped) {endWarp(); }&#xD;context.save();&#xD;context.font = size + &apos;px monospace&apos;;&#xD;context.textAlign = &apos;left&apos;;&#xD;context.textBaseline = &apos;alphabetic&apos;;&#xD;context.fillStyle = this.color.toString();&#xD;len = context.measureText(text).width;&#xD;trans = trans.multiplyBy(1 / stage.scale);&#xD;context.translate(trans.x, trans.y);&#xD;context.rotate(rotation);&#xD;context.fillText(text, 0, 0);&#xD;context.translate(-trans.x, -trans.y);&#xD;context.restore();&#xD;pos = new Point(&#xD;  len * Math.sin(radians(this.direction())),&#xD;  len * Math.cos(radians(this.direction())));&#xD;pos = pos.add(new Point(this.xPosition(), this.yPosition()));&#xD;this.gotoXY(pos.x, pos.y, false);&#xD;this.changed();&#xD;if (isWarped) {this.startWarp(); }&#xD;stage.changed();</l></block><list><block var="text"/><block var="size"/></list></block></script></scripts></block-definition><block-definition s="load eCraft2Learn" type="command" category="other"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doApplyExtension"><l>src_load(url)</l><list><l>https://ecraft2learn.github.io/ai/ecraft2learn.js</l></list></block><block s="doApplyExtension"><l>src_load(url)</l><list><l>https://ecraft2learn.github.io/ai/js/ecraft2learn_snap_extension.js</l></list></block></script></block-definition><block-definition s="call eCraft2Learn reporter %&apos;reporter name&apos; with %&apos;inputs&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><custom-block s="load eCraft2Learn"></custom-block><block s="doReport"><block s="reportApplyExtension"><l>e2l_call(reporter_name, parameters)</l><list><block var="reporter name"/><block var="inputs"/></list></block></block></script></block-definition><block-definition s="run eCraft2Learn command %&apos;command name&apos; with %&apos;inputs&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><custom-block s="load eCraft2Learn"></custom-block><block s="doApplyExtension"><l>e2l_run(command_name, parameters)</l><list><block var="command name"/><block var="inputs"/></list></block></script></block-definition><block-definition s="Load eCraft2Learn library" type="command" category="other"><comment x="0" y="0" w="238.57142857142858" collapsed="false">No longer needed in Snap! 7+ but retained to avoid error from blocks that expect it.</comment><header></header><code></code><translations></translations><inputs></inputs></block-definition><block-definition s="lookup value of %&apos;key&apos; in %&apos;association list&apos;" type="reporter" category="lists"><comment x="0" y="0" w="218.57142857142858" collapsed="false">Reports the second item in a list whose first item is &apos;key&apos; where &apos;association list&apos; is a list of lists. Reports FALSE if no list matches.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%l"></input></inputs><script><custom-block s="let %upvar be %s"><l>entry</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><block var="key"/></block></autolambda><list></list></block><block var="association list"/></block></custom-block><block s="doIfElse"><block s="reportIsA"><block var="entry"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportListItem"><l>2</l><block var="entry"/></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="let %&apos;var&apos; be %&apos;value&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>var</l><block var="value"/></block></script></block-definition></blocks><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" id="556"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAADoVJREFUeF7t1cEJAAAIxDDdf2m3sJ+4wEEQuuMIECBAgACBd4F9XzRIgAABAgQIjAB7AgIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECByxcQFpoRMBzwAAAABJRU5ErkJggg==</pentrails><costumes><list struct="atomic" id="557"></list></costumes><sounds><list struct="atomic" id="558"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="-91" y="-96.32432432432438" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="563"><costumes><list struct="atomic" id="564"></list></costumes><sounds><list struct="atomic" id="565"></list></sounds><blocks></blocks><variables></variables><scripts><script x="24.000000000000018" y="59.85714285714287"><block s="receiveGo"></block><block s="doIf"><block s="reportEquals"><block var="key"/><l>0</l></block><script><block s="doAsk"><l>This program requires an API key. One can be obtained for free from weatherapi.com   Enter your key below. This program will not store or leak your key but we suggest you look at the script to confirm this.</l></block><block s="doSetVar"><l>key</l><block s="getLastAnswer"></block></block></script></block><custom-block s="let %upvar be %s"><l>message</l><block s="reportJoinWords"><list><l>Say the name of a city.</l></list></block></custom-block><block s="bubble"><block var="message"/></block><custom-block s="Speak until done %txt"><block var="message"/></custom-block><block s="doSetVar"><l>last thing heard</l><custom-block s="the next thing spoken"></custom-block></block><custom-block s="let %upvar be %s"><l>response</l><block s="reportTextSplit"><block s="reportURL"><block s="reportJoinWords"><list><l>https://api.weatherapi.com/v1/forecast.json?key=</l><block var="key"/><l>&amp;q=</l><block var="last thing heard"/></list></block></block><l><option>json</option></l></block><comment w="305.0000000000001" collapsed="false">See https://www.weatherapi.com/api-explorer.aspx#forecast&#xD;to see all the other current and forecast weather this API provides.</comment></custom-block><custom-block s="let %upvar be %s"><l>error</l><custom-block s="lookup value of %txt in %l"><l>error</l><block var="response"/></custom-block></custom-block><block s="doIf"><block s="reportIsA"><block var="error"/><l><option>list</option></l></block><script><block s="bubble"><custom-block s="lookup value of %txt in %l"><l>message</l><block var="error"/></custom-block></block><block s="doStopThis"><l><option>this script</option></l></block></script></block><custom-block s="let %upvar be %s"><l>current weather</l><custom-block s="lookup value of %txt in %l"><l>current</l><block var="response"/></custom-block></custom-block><custom-block s="let %upvar be %s"><l>forecast</l><block s="reportListItem"><l>1</l><custom-block s="lookup value of %txt in %l"><l>forecastday</l><custom-block s="lookup value of %txt in %l"><l>forecast</l><block var="response"/></custom-block></custom-block></block></custom-block><custom-block s="let %upvar be %s"><l>to say</l><block s="reportJoinWords"><list><l>The temperature in </l><block var="last thing heard"/><l> is </l><custom-block s="lookup value of %txt in %l"><l>temp_c</l><block var="current weather"/></custom-block><l>. The forecasted maximum temperature for </l><custom-block s="lookup value of %txt in %l"><l>date</l><block var="forecast"/></custom-block><l> is </l><custom-block s="lookup value of %txt in %l"><l>maxtemp_c</l><block s="reportListItem"><l>2</l><block s="reportListItem"><l>3</l><block var="forecast"/></block></block><comment w="239.2857142857144" collapsed="false">Tommorow&apos;s forecast is deep inside lists of lists.</comment></custom-block></list></block></custom-block><block s="bubble"><block var="to say"/></block><custom-block s="Speak until done %txt"><block var="to say"/></custom-block></script><script x="366.42857142857144" y="225.66666666666652"><custom-block s="Open this in a new tab"></custom-block></script><comment x="24.42857142857144" y="7.142857142857143" w="422.14285714285717" collapsed="false">This is a simple demonstration of a speech interface to a weather service. Try improving it!</comment><comment x="537" y="196" w="398.99999999999994" collapsed="false">There are many weather APIs. See, for example, https://rapidapi.com/blog/access-global-weather-data-with-these-weather-apis/&#xD;Note that while all have free registration some allow only 100 free queries a month&#xD;while others allow one million. Here we use weatherapi.com</comment></scripts></sprite><watcher var="last thing heard" style="normal" x="10" y="10" color="243,118,29"/><watcher var="key" style="normal" x="10" y="37.800002000000006" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="last thing heard" transient="true"/><variable name="key" transient="true"/></variables></scene></scenes></project><media name="weather" app="Snap! 7, https://snap.berkeley.edu" version="2"></media></snapdata>