{"id":55954,"date":"2022-10-08T03:01:59","date_gmt":"2022-10-07T17:01:59","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=55954"},"modified":"2022-10-01T13:30:13","modified_gmt":"2022-10-01T03:30:13","slug":"html-morse-code-makeover-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-morse-code-makeover-tutorial\/","title":{"rendered":"HTML Morse Code Makeover Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML Morse Code Makeover Tutoriall\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode_better.jpg\" title=\"HTML Morse Code Makeover Tutorial\" id='mci' onmouseover=\" this.src=this.src.replace('e.jpg','e.p~ng').replace('e.png','e.g~if').replace('e.gif','e2.jp~g').replace('e2.jpg','e2.pn~g').replace('e2.png','e.j~pg').replace('~','');    \"  \/><\/a><p class=\"wp-caption-text\">HTML Morse Code Makeover Tutorial<\/p><\/div>\n<p>We&#8217;re revisiting <a title='HTML Morse Code Primer Tutorial' href='#htmlmcpt'>HTML Morse Code Primer Tutorial<\/a>&#8216;s Morse Code sharing web application today, realizing it could be improved in two major ways &#8230;<\/p>\n<ol>\n<li>add Hints for Morse Code message creators (ie. on non-mobile, you see the letter associated with Morse Code when hovering over that Morse Code after optionally clicking Hints link) &#8230;<br \/>\n<code><br \/>\n<font color=purple>&lt;a style='text-decoration:underline;cursor:pointer;' id='hints' data-href='.\/morsecode.html' onclick='titleit();' title='hint'&gt;Hint&lt;\/a&gt;<\/font><br \/>\n<\/code><\/p>\n<p> &#8230; HTML helped out by Javascript &#8230;<\/p>\n<p><code><br \/>\nfunction titleit() {<br \/>\n  var opts=document.getElementsByTagName('option');<br \/>\n  for (var iopts=0; iopts&lt;opts.length; iopts++) {<br \/>\n    if (('' + opts[iopts].title).trim() == '') {<br \/>\n      opts[iopts].title=opts[iopts].value.replace(' ', 'Space');<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n<\/code>\n<\/li>\n<li>add SMS communication conduit to the existant email one <font color=blue>with changes<\/font> &#8230;<br \/>\n<code><br \/>\n&lt;span id='myspan'&gt;To: &lt;input <font color=blue>placeholder='Enter email address or SMS number'<\/font> <font color=blue>title='Enter email address or SMS number'<\/font> id='to' size=30 type='text' value='' onblur=\" <font color=blue>aem='asms'; if (this.value.indexOf('@') == -1) { sendsms(); } else if (this.value.indexOf('@') != -1) { aem='aemail';<\/font>   document.getElementById('iemail').src='morsecode.php?set=' + this.value; document.getElementById(aem).href=document.getElementById(aem).href.replace('o:' + wasemailee,'o:' + this.value).replace(encodeURIComponent('o:' + wasemailee),encodeURIComponent('o:' + this.value)); <font color=blue>}<\/font> wasemailee=this.value;  \"&gt;&lt;\/input&gt;&lt;input type='button' onclick=\" <font color=blue>aem='asms'; if (document.getElementById('to').value.indexOf('@') == -1) { sendsms(); } else if (document.getElementById('to').value.indexOf('@') != -1) {  aem='aemail';<\/font>  if (documentURL.indexOf('?isMobile=y') != -1) { startagain='y'; document.getElementById('iemail').src='.\/morsecode.php?mt=' + encodeURIComponent(document.getElementById(aem).href); document.getElementById('myspan').innerHTML=document.getElementById('myspan').innerHTML.replace('Email' + ' Sent To: ','To: ').replace('SMS' + ' Sent To: ','To: ').replace('To:','Email' + ' Sent To:').replace('o:' + wasemailee, 'o:' + document.getElementById('to').value).replace(encodeURIComponent(':' + wasemailee), encodeURIComponent(':' + document.getElementById('to').value).replace('to=&', 'to=' + encodeURIComponent(document.getElementById('to').value) + '&')); document.getElementById('myh1').innerHTML = document.getElementById('myh1').innerHTML + ' sent';  } else { <font color=blue>document.getElementById(aem).href='mailto:' + document.getElementById('to').value + '?subject=' + document.getElementById(aem).href.replace('to%3D%26', 'to%3D' + encodeURIComponent(document.getElementById('to').value) + '%26').split('?subject=')[1];<\/font>  document.getElementById(aem).click(); <font color=blue>}<\/font> }\" value='Send email\/SMS of Morse Code below'&gt;&lt;\/input&gt;&amp;nbsp;&lt;a id='reset' href='.\/morsecode.html' title='reset'&gt;Reset&lt;\/a&gt;&amp;nbsp;<font color=purple>&lt;a style='text-decoration:underline;cursor:pointer;' id='hints' data-href='.\/morsecode.html' onclick='titleit();' title='hint'&gt;Hint&lt;\/a&gt;<\/font>&lt;\/span&gt;&lt;br&gt;<br \/>\n<font color=blue>&lt;a style='display:none;' id='asms' href='sms:&body='&gt;sms&lt;\/a&gt;<\/font><br \/>\n<\/code><\/p>\n<p> &#8230; HTML helped out by Javascript &#8230;<\/p>\n<p><code><br \/>\nfunction sendsms() {<br \/>\nif (document.getElementById(\"to\").value.trim() != '' && document.getElementById(\"to\").value.trim().replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {<br \/>\n   document.getElementById(\"asms\").href=\"sm\" + \"s:\" + document.getElementById(\"to\").value.trim() + \"&body=\" + encodeURIComponent(document.URL.split('#')[0].split('?')[0] + '?to=' + document.getElementById(\"to\").value.trim() + '&mc=' + encodeURIComponent(document.getElementById(\"mymc\").innerHTML));<br \/>\n   document.getElementById(\"asms\").click();<br \/>\n}<br \/>\n}<br \/>\n<\/code>\n<\/li>\n<\/ol>\n<p> &#8230; in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html--GETME\" title='morsecode.html'>the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html--GETME\" title='morsecode.html'>morsecode.html<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html\" title='Click picture'>Morse Code creator and sharer<\/a>.<\/p>\n<p>We hope you find it&#8217;s easier and more useful to use!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/html-morse-code-makeover-tutorial\/'>HTML Morse Code Makeover Tutorial<\/a>.<\/p-->\n<hr>\n<p id='htmlmcpt'>Previous relevant <a target=_blank title='HTML Morse Code Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html-morse-code-primer-tutorial\/'>HTML Morse Code Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"HTML Morse Code Primer Tutoriall\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.jpg\" title=\"HTML Morse Code Primer Tutorial\" id='mci' onmouseover=\" this.src=this.src.replace('e.jpg','e.p~ng').replace('e.png','e.g~if').replace('e.gif','e2.jp~g').replace('e2.jpg','e2.pn~g').replace('e2.png','e.j~pg').replace('~','');    \"  \/><\/a><p class=\"wp-caption-text\">HTML Morse Code Primer Tutorial<\/p><\/div>\n<p>Recently, with <a target=_blank title='Yahoo YQL Web Service JSON Worldbank Datasets Tutorial' href='#yywsjwdt'>Yahoo YQL Web Service JSON Worldbank Datasets Tutorial<\/a> as shown below, we found time for HTML multiple mode <a target=_blank title='select tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_select.asp'>select<\/a> tags &#8230; <\/p>\n<blockquote><p>\n<b>How do you do, Hmmst?<\/b><br \/>\nI&#8217;m not exactly sure &#8230; (pointing to right of screen) &#8230; ask that pixel over there.<br \/>\n<b>Hey Hmmst, did you find your watch the other day?<\/b><br \/>\nI&#8217;m not exactly sure &#8230; (pointing to top of screen) &#8230; ask that pixel over there.<br \/>\n<b>Over here Hmmst.   It&#8217;s on the table.<\/b><br \/>\nI&#8217;m not exactly sure what exactly you&#8217;re getting at with the term &#8220;table&#8221; &#8230; (pointing to bottom of screen) &#8230; but suggest you ask that pixel over there.<br \/>\n<b>(Aside, to you guys.)   You find the time for someone, and what thanks do you get?<\/b><br \/>\nBy the way &#8230; (pointing to the left of screen) &#8230; that pixel over there, the one next to that one (pointing to the left of screen) appreciates you finding the time.\n<\/p><\/blockquote>\n<p>The thing about today&#8217;s <a target=_blank title='Morse Code information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Morse_code'>Morse Code<\/a> game in HTML and Javascript is that it does make use of an HTML multiple mode select tag &#8220;onclick&#8221; event, because was wondering what would happen with it, and realized it could be used a bit like a keyboard (or a button for that matter &#8230; and we actually use a button for mobile platforms, because multiple select tags do not suit so well here) for entries that might repeat for instance.<\/p>\n<p>So today we use this event to create a Morse Code emailer, which is a bit funny, in that, of course, when Morse Code was invented, there was no email, and a bit funny in that Morse Code (sort of) was an (early) alternative to email, and is locked up with the days of <a target=_blank title='Sherlock and telegrams' href='http:\/\/www.youtube.com\/watch?v=9JfDRiV_Mkc'>telegrams<\/a>.  Last holidays, at <a target=_blank title='Beechworth, Victoria, Australia' href='https:\/\/www.google.com.au\/maps\/place\/Beechworth+VIC+3747\/@-36.3339168,146.6599968,12z\/data=!3m1!4b1!4m2!3m1!1s0x6b26ac599f7be39b:0x40579a430a04be0'>Beechworth<\/a>, at its historic <a target=_blank title='Beechworth Telegraph Station' href='http:\/\/www.beechworthonline.com.au\/pages\/beechworth-telegraph-station\/'>Telegraph Station<\/a> found out that you could send a real Morse Code message (with all the real equipment) as a telegram, to someone.<\/p>\n<p>Hope you enjoy the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html\" title='click picture'>live run<\/a> and have a go using and downloading the HTML programming source code <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/morsecode.html_GETME\" title='morsecode.html'>morsecode.html<\/a> &#8230; and thanks to this useful <a target=_blank title='useful link' href='http:\/\/stackoverflow.com\/questions\/1352587\/convert-a-string-into-morse-code'>link<\/a>.<\/p>\n<hr \/>\n<p id='yywsjwdt'><a target=_blank title='Yahoo YQL Web Service JSON Worldbank Datasets Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11484'>Yahoo YQL Web Service JSON Worldbank Datasets Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Worldbank Data Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/WorldbankMultiple.jpg\" title=\"Yahoo YQL Web Service JSON Worldbank Datasets Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Worldbank Datasets Tutorial<\/p><\/div>\n<p>Here is a tutorial that (just) might be re-introducing you to the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog, building on previous <a target=_blank title='Yahoo YQL Web Service JSON Worldbank Data Tutorial' href='#yywsjwdt'>Yahoo YQL Web Service JSON Worldbank Data Tutorial<\/a> as shown below, but today we use the YQL worldbank.data database queries to start the ball rolling with the idea of <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\n'>Google Chart<\/a> (software integrated) reports being mixed with latitude, longitude <a target=_blank title='GeoData information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Geographic_information_system'>GeoData<\/a> (as we began two days ago).   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really (top) supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about Yahoo&#8217;s YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Worldbank Data worldbank.data database with Yahoo YQL website &#8230; thanks.  You select report types of interest from dropdown list allowing multiple selection and then set the ball rolling by selecting a country name from the dropdown list (derived from Worldbank country codes at <a target=_blank title='Worldbank country codes' href='http:\/\/www.irows.ucr.edu\/research\/tsmstudy\/wbcountrycodes.htm'>Worldbank country codes<\/a> &#8230; thanks) and see a detailed map and world context map all using Google Charts functionality.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended &#8230; today we mix its use with an alternative PHP <a target=_blank title='PHP explode method' href='http:\/\/php.net\/manual\/en\/function.explode.php'>explode<\/a> (into arrays) approach as well, for the two passes of YQL data used<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=SELECT+*+FROM+worldbank.indicators+WHERE+indicator_id+%3D+%27NY.GNP.PCAP.CD%27' title='YQL worldbank.data help'>YQL worldbank.data help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='worldbank_country.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html--GETME\">worldbank_country.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='worldbank_country.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.php--GETME\">worldbank_country.php<\/a><\/p>\n<p>How we got there &#8230; <a target=_blank title='worldbank_country.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html--GETME\">worldbank_country.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='worldbank_country.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.php--GETME\">worldbank_country.php<\/a><\/p>\n<p>In the way the code changed above you may be interested in the way the (now) multiple selection dropdown event logic has been transferred to when the (single selection) country dropdown value changes, so that this country dropdown acts a bit like a button as far as event logic goes, because there is no point checking an individual value change for a multiple selection dropdown, rather it is nearly always best to arrange it to have an accompanying button or other HTML element whose functionality follows along after the multiple selection dropdown&#8217;s actions and can be used to oversee all the event logic, for best results.  You may want to see more of this type of logic with <a target=_blank title='HTML\/Javascript Canvas Rummy Card Game Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=8122'>HTML\/Javascript Canvas Rummy Card Game Primer Tutorial<\/a> from some time back.<\/p>\n<p>Will leave you with our link to a <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html\">live run<\/a> &#8230; and it is now, perhaps, of interest to retrace what the supervisors used to look like <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/indexnewer.html\">yesterday<\/a> and <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/indexold.html\">the day before yesterday<\/a> to see where we have come from, and highlight a concept you may want to adopt with code, which happens to be PHP today, that is being supervised, to say that it can be good practice to make that supervised code backward and forward compatible if possible &#8230; hope you get some Google Chart software integration ideas from today&#8217;s tutorial, where we randomize Column Charts, Bar Charts and Area Charts as the means of displaying your Worldbank YQL data findings &#8230; chow for the meantime &#8230; but don&#8217;t be mean &#8230; chortle, chortle.<\/p>\n<hr \/>\n<p id='yywsjwdt'>Previous relevant <a target=_blank title='Yahoo YQL Web Service JSON Worldbank Data Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11472'>Yahoo YQL Web Service JSON Worldbank Data Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/indexnewer.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Worldbank Data Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/WorldbankData.jpg\" title=\"Yahoo YQL Web Service JSON Worldbank Data Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Worldbank Data Tutorial<\/p><\/div>\n<p>Here is a tutorial that (just) might be re-introducing you to the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog, building on previous <a target=_blank title='Yahoo YQL Web Service JSON Worldbank Country Tutorial' href='#yywsjwct'>Yahoo YQL Web Service JSON Worldbank Country Tutorial<\/a> as shown below, but today we use the YQL worldbank.data database queries to start the ball rolling with the idea of <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.\n'>Google Chart<\/a> (software integrated) reports being mixed with latitude, longitude <a target=_blank title='GeoData information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Geographic_information_system'>GeoData<\/a> (as we began yesterday).   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Worldbank Data worldbank.data database with Yahoo YQL website &#8230; thanks.  You select a report type from a dropdown list and then set the ball rolling by selecting a country name from the dropdown list (derived from Worldbank country codes at <a target=_blank title='Worldbank country codes' href='http:\/\/www.irows.ucr.edu\/research\/tsmstudy\/wbcountrycodes.htm'>Worldbank country codes<\/a> &#8230; thanks) and see a detailed map and world context map all using Google Charts functionality.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended &#8230; today we mix its use with an alternative PHP <a target=_blank title='PHP explode method' href='http:\/\/php.net\/manual\/en\/function.explode.php'>explode<\/a> (into arrays) approach as well, for the two passes of YQL data used<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=SELECT+*+FROM+worldbank.data+WHERE+country_id+%3D+%27TUR%27+AND+indicator_id+%3D+%27BAR.PRM.SCHL.3539%27' title='YQL worldbank.data help'>YQL worldbank.data help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='worldbank_country.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html-GETME\">worldbank_country.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='worldbank_country.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.php-GETME\">worldbank_country.php<\/a><\/p>\n<p>How we got there &#8230; <a target=_blank title='worldbank_country.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html-GETME\">worldbank_country.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='worldbank_country.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.php-GETME\">worldbank_country.php<\/a><\/p>\n<p>Will leave you with our link to a <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html\">live run<\/a> &#8230; hope you get some Google Chart software integration ideas from today&#8217;s tutorial &#8230; chow for now.<\/p>\n<hr \/>\n<p id='yywsjwct'>Previous relevant <a target=_blank title='Yahoo YQL Web Service JSON Worldbank Country Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11460'>Yahoo YQL Web Service JSON Worldbank Country Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/indexold.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Worldbank Country Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/WorldbankCountries.png\" title=\"Yahoo YQL Web Service JSON Worldbank Country Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Worldbank Country Tutorial<\/p><\/div>\n<p>Here is a tutorial that might be re-introducing you to the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog, building on previous <a target=_blank href='#yywsjsmt' title='Yahoo YQL Web Service JSON Social Mention Tutorial'>Yahoo YQL Web Service JSON Social Mention Tutorial<\/a> as shown below.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Worldbank Country worldbank.countries database with Yahoo YQL website &#8230; thanks.  You select a country name from the dropdown list (derived from Worldbank country codes at <a target=_blank title='Worldbank country codes' href='http:\/\/www.irows.ucr.edu\/research\/tsmstudy\/wbcountrycodes.htm'>Worldbank country codes<\/a> &#8230; thanks) and see a detailed map and world context map all using Google Charts functionality.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended &#8230; just not with <a target=_blank title='Just like Mrs Cropley' href='http:\/\/www.nigella.com\/recipes\/view\/chocolate-banana-muffins-5158'>chocolate banana muffins<\/a><\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=SELECT+*+FROM+worldbank.countries+WHERE+country_id+%3D+%27GHA%27' title='YQL worldbank.country help'>YQL worldbank.country help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='worldbank_country.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html_GETME\">worldbank_country.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='worldbank_country.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.php_GETME\">worldbank_country.php<\/a><\/p>\n<p>Will leave you with our link to a <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Worldbank\/worldbank_country.html\">live run<\/a> &#8230; enjoy the new dose of &#8220;where&#8221; in your life.<\/p>\n<hr \/>\n<p id='yywsjsmt'>Previous relevant <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=10624' title='Yahoo YQL Web Service JSON Social Mention Tutorial'>Yahoo YQL Web Service JSON Social Mention Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/social_mention.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Social Mention Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/social_mention.jpg\" title=\"Yahoo YQL Web Service JSON Social Mention Tutorial\" id='aghtre' onmouseover=' this.src=this.src.replace(\".jpg\",\".PNG\").replace(\".png\",\".jpg\").replace(\".PNG\",\".png\");  ' \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Social Mention Tutorial<\/p><\/div>\n<p>Here is a tutorial that might be re-introducing you to the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog, building on yesterday&#8217;s <a target=_blank href='#yywswogt' title='Yahoo YQL Web Service Winter Olympics Game Tutorial'>Yahoo YQL Web Service Winter Olympics Game Tutorial<\/a> as shown below.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the Social Mentions socialmention.search database with Yahoo YQL website &#8230; thanks.  You fill in a word (or two, or three) of interest to search for recent microblog data recently posted regarding those words.<\/p>\n<p>The two big PHP functions of use for this are:<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended &#8230; just not with <a target=_blank title='Just like Mrs Cropley' href='http:\/\/www.nigella.com\/recipes\/view\/chocolate-banana-muffins-5158'>chocolate banana muffins<\/a><\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+socialmention.search+where+q%3D%27wrep%27+and+t%3D%27microblogs%27' title='YQL socialmention.search help'>YQL socialmention.search help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='social_mention.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/social_mention.html_GETME\">social_mention.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='social_mention.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/social_mention.php_GETME\">social_mention.php<\/a><\/p>\n<p>Will leave you with our sincerest <i>to-da-loos<\/i> and a link to a <a target=_blank title='Live Run' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/social_mention.html\">live run<\/a> &#8230; do yourself a favour and see you on the flip side &#8230; whatever all that means?! &#8230; think we need a dose of <a target=_blank title='Countdown' href='https:\/\/www.youtube.com\/watch?v=a78mzQZPDAQ'>Countdown<\/a> to find out.<\/p>\n<hr \/>\n<p id='yywswogt'>Previous relevant <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=10613' title='Yahoo YQL Web Service Winter Olympics Game Tutorial'>Yahoo YQL Web Service Winter Olympics Game Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service Winter Olympics Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.png\" title=\"Yahoo YQL Web Service Winter Olympics Game Tutorial\" id='ghtre' onmouseover=' this.src=this.src.replace(\".jpg\",\".PNG\").replace(\".png\",\".jpg\").replace(\".PNG\",\".png\");  ' \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service Winter Olympics Game Tutorial<\/p><\/div>\n<p>Here is a tutorial that reminds you again about the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog, building on yesterday&#8217;s <a target=_blank href='#yywsjfnt' title='Yahoo YQL Web Service JSON First Name Tutorial'>Yahoo YQL Web Service JSON First Name Tutorial<\/a> as shown below.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to a Winter Olympics database of the http:\/\/isithackday.com website (where they have a useful CSV file called medals.csv) &#8230; thanks.  You fill in a Medal Presentation (secret) number of interest to get presented with 5\/8 of the information required to score a point &#8230; your job, should you decide to take it on, <a target=_blank title='Mission What?' href='http:\/\/www.youtube.com\/watch?v=ZGInRtQo4S4'><i>Jim<\/i><\/a>, is to pick those other 3\/8 of the information.<\/p>\n<p>The two big PHP functions of use for this are (normally):<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; but today we prefer to read the medals.csv file as mentioned above to derive information required to run the game &#8230; it&#8217;s the same information as you&#8217;d need to walk the game actually &#8230; this approach to the Winter Olympics game came about as a result of perusing the arrangements for <a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+wintermedals+where+country%3D%22GBR%22+and+type%3D%22Gold%22%3B' title='YQL wintermedals help'>wintermedals<\/a> and saw that this was a good pared down arrangement &#8230; data can be handled in a large variety of ways<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=select+*+from+wintermedals+where+country%3D%22GBR%22+and+type%3D%22Gold%22%3B' title='YQL wintermedals help'>YQL wintermedals help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>There are three live run ideas &#8230;<\/p>\n<ul>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.php\" title=\"Winter Olympics Game Live Run\">Winter Olympics Game Live Run<\/a> &#8230; where you pick a Medals Presentation (secret) number &#8230; though Firebug afficianados may laugh heartily here<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.php?pickone=\" title=\"Winter Olympics Game Random Live Run\">Winter Olympics Game Random Live Run<\/a> &#8230; where you have a random Medals Presentation (secret) number picked for you<\/li>\n<li><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.php?pickone=2313\" title=\"Winter Olympics Game Random Live Run\">Winter Olympics Game Particular Live Run<\/a> &#8230; where you have a Medals Presentation (secret) number specified by you (eg. 2313)<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=_blank title='winter_olympics.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/winter_olympics.php_GETME\">winter_olympics.php<\/a><\/p>\n<p>Thanks to Google for the research link access to search engine queries accessed via <a target=_blank title='window.open information from w3schools ... thanks' href='http:\/\/www.w3schools.com\/jsref\/met_win_open.asp'>window.open<\/a> Javascript calls.<\/p>\n<hr \/>\n<p id='yywsjfnt'>Previous relevant <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=10607' title='Yahoo YQL Web Service JSON First Name Tutorial'>Yahoo YQL Web Service JSON First Name Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/first_name.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON First Name Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/first_name.jpg\" title=\"Yahoo YQL Web Service JSON Frst Name Tutorial\" \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON First Name Tutorial<\/p><\/div>\n<p>Here is a tutorial that re-introduces you to the Yahoo Web Services called YQL, building on previous YQL <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>tutorials<\/a> on this blog.   The name is the way it is because it simplified the API aspects of its functionality for the developer to concentrate on SQL, and I&#8217;m really supportive of this concept.  You don&#8217;t have to output in JSON, as other data forms like XML are acceptable.  Let&#8217;s see what Wikipedia says about YQL below. <\/p>\n<blockquote>\n<p>Yahoo! Query Language (YQL) is an SQL-like query language created by Yahoo! as part of their Developer Network. YQL is designed to retrieve and manipulate data from APIs through a single Web interface, thus allowing mashups that enable developers to create their own applications.[1]<\/p>\n<p>Initially launched in October 2008 with access to Yahoo APIs,[2] February 2009 saw the addition of open data tables from third parties such as Google Reader, the Guardian, and The New York Times.[3] Some of these APIs still require an API key to access them. On April 29th of 2009, Yahoo introduced the capability to execute the tables of data built through YQL using JavaScript run on the company&#8217;s servers for free.[3]<\/p>\n<\/blockquote>\n<p>So this tutorial uses a YQL web service into the data emanating from its links to the First Names (firstnames) database of the www.thomas-bayer.com website &#8230; thanks.  You fill in a First Name of interest to search for contributary country data regarding that name&#8217;s usage at the Yahoo YQL firstname www.thomas-bayer.com database tables.<\/p>\n<p>The two big PHP functions of use for this are (normally):<\/p>\n<ul>\n<li><a target=_blank title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents'>file_get_contents<\/a><\/li>\n<li><a target=_blank title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php'>json_decode<\/a> &#8230; but today we prefer to get the raw data and use PHP <a target=_blank title='PHP explode function' href='http:\/\/php.net\/manual\/en\/function.explode.php'>explode<\/a> function to extract arrays we can use as a means to present the data<\/li>\n<\/ul>\n<p>Good links for information regarding this tutorial (thanks) are:<\/p>\n<ul>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/guide\/two-minute-tutorial.html' title='YQL Two Minute Tutorial'>YQL Two Minute Tutorial<\/a> from Yahoo<\/li>\n<li><a target=_blank href='http:\/\/en.wikipedia.org\/wiki\/Yahoo!_Query_Language' title='Yahoo! Query Language'>Yahoo! Query Language<\/a> from Wikipedia, as per quote above<\/li>\n<li><a target=_blank href='http:\/\/developer.yahoo.com\/yql\/' title='YQL Home Page'>YQL Home Page<\/a> from Yahoo<\/li>\n<li><a target=_blank href='https:\/\/developer.yahoo.com\/yql\/console\/?q=select%20*%20from%20flickr.photos.interestingness%2820%29&#038;env=store:\/\/datatables.org\/alltableswithkeys#h=SELECT+*+FROM+firstnames.lookup+WHERE+name%3D%22Sebastian%22' title='YQL firstnames help'>YQL firstnames help<\/a> from Yahoo<\/li>\n<li><a target=_blank title='YQL JSON Parsing Help' href='http:\/\/developer.yahoo.com\/forum\/YQL\/yql-query-intermittently-returns-no-results\/1374521623593-fa4a3519-10ae-4a17-8fd4-6de45a159d6f'>YQL JSON Parsing Help<\/a> from YQL forum<\/li>\n<\/ul>\n<p>Another tool you should have in your armoury for jobs like this is the online JSON validator <a target=_blank title='JSON validator online' href='http:\/\/jsonlint.com\/'>here<\/a>.  A generic JSON approach to issues could be:<\/p>\n<ol>\n<li>Type the URL you were given into a web browser address bar and have a look at it<\/li>\n<li>Type the URL you were given into http:\/\/jsonlint.com\/ and have it validated<\/li>\n<li>Understand in your own mind what would be different about 1. to make it suitable<\/li>\n<li>Incorporate findings of 3. into massaging of data between file_get_contents and json_decode<\/li>\n<\/ol>\n<p>Here is a link to some downloadable HTML programming source code which you may want to rename to <a target=_blank title='first_name.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/first_name.html_GETME\">first_name.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='first_name.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/YQL\/first_name.php_GETME\">first_name.php<\/a><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7529' onclick='var dv=document.getElementById(\"d7529\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=JSON\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7529' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d10607' onclick='var dv=document.getElementById(\"d10607\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d10607' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d10613' onclick='var dv=document.getElementById(\"d10613\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=CSV\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d10613' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d10624' onclick='var dv=document.getElementById(\"d10624\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=json_decode\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d10624' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11460' onclick='var dv=document.getElementById(\"d11460\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=geographicals\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11460' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11472' onclick='var dv=document.getElementById(\"d11472\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=HTML\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11472' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11484' onclick='var dv=document.getElementById(\"d11484\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=PHP\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11484' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d11901' onclick='var dv=document.getElementById(\"d11901\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11901' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55954' onclick='var dv=document.getElementById(\"d55954\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/title\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55954' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re revisiting HTML Morse Code Primer Tutorial&#8216;s Morse Code sharing web application today, realizing it could be improved in two major ways &#8230; add Hints for Morse Code message creators (ie. on non-mobile, you see the letter associated with Morse &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-morse-code-makeover-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[367,380,476,576,652,3872,811,997,1866,1159,2167,1319],"class_list":["post-55954","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-dropdown","tag-email","tag-game","tag-html","tag-javascript","tag-makeover","tag-morse-code","tag-programming","tag-select","tag-sms","tag-title","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55954"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=55954"}],"version-history":[{"count":2,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55954\/revisions"}],"predecessor-version":[{"id":55956,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55954\/revisions\/55956"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=55954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=55954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=55954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}