{"id":64244,"date":"2024-07-23T03:01:00","date_gmt":"2024-07-22T17:01:00","guid":{"rendered":"https:\/\/65.254.95.247\/ITblog\/?p=64244"},"modified":"2024-07-25T21:10:17","modified_gmt":"2024-07-25T11:10:17","slug":"english-word-association-game-revisit-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-association-game-revisit-tutorial\/","title":{"rendered":"English Word Association Game Revisit Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"English Word Association Game Revisit Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association_new.jpg\" title=\"English Word Association Game Revisit Tutorial\"  \/><\/a><p class=\"wp-caption-text\">English Word Association Game Revisit Tutorial<\/p><\/div>\n<p><i>One step forward, and steps back<\/i> is how we&#8217;d describe progress, onto the PHP Word Association web application game of <a title='Language Word Association Game Tutorial' href='#lwagt'>Language Word Association Game Tutorial<\/a> &#8230;<\/p>\n<ul>\n<li>the step forward being the replacing of obsolete Yahoo YQL Thesaurus sources of information with that of the newly introduced <a target=\"_blank\" title='Free Thesaurus' href='http:\/\/www.freethesaurus.com\/' rel=\"noopener\">Free Thesaurus<\/a> source, thanks &#8230; making the game not show error messages any more and &#8230;<\/li>\n<li>the steps back relate to our Word Association game being locked into &#8220;English modus operandi&#8221; only<\/li>\n<\/ul>\n<p>We add coding to make this happen, just in case Yahoo YQL is ever resurrected, and for &#8220;coding posterity purposes&#8221;, by introducing a new PHP variable called <font color=blue>$theone<\/font> as featuring in <font color=purple>changed<\/font> PHP code snippets below &#8230;<\/p>\n<table>\n<tr>\n<th>New variables<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code><br \/>\n <font color=blue>$theone=0;<\/font><br \/>\n <font color=purple>$rdonly=\"\";<\/font><br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<tr>\n<th>Read from thesaurus data source<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code style=font-size:8px;><br \/>\n <font color=purple>$pageContent = \"\";<br \/>\n if ((<\/font><font color=blue>$theone<\/font><font color=purple> % 2) == 0) {<\/font><br \/>\n $pageContent = @file_get_contents(\"ht<font color=black>tp<\/font>:\/\/query.yahooapis.com\/v1\/public\/yql?q=select%20*%20from%20thesaurus%20where%20key%3D%225r3uguAhHMoAQJIlShGL%22%20and%20word%3D%22\".urlencode($selname).\"%22%20and%20language%3D%22\" . $language . \"%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=\");<br \/>\n <font color=purple>}<br \/>\n if (<\/font><font color=blue>$theone<\/font><font color=purple> == 1 && $pageContent != '') {  <\/font><font color=blue>$theone<\/font><font color=purple>=2;  } else if ($pageContent == '') { <\/font><font color=blue>$theone<\/font><font color=purple>=1;  }<br \/>\n if (<\/font><font color=blue>$theone<\/font><font color=purple> == 1) {<br \/>\n $pageContent = @file_get_contents(\"ht<\/font><font color=purple>tp<\/font><font color=purple>:\/\/www.freethesaurus.com\/\".urlencode($selname)); \/\/.\"%22%20and%20language%3D%22\" . $language . \"%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=\");<br \/>\n $rdonly=\" disabled\";<br \/>\n if (strpos($pageContent, '&lt;div class=\"TCont\"&gt;') === false) {<br \/>\n    header('Location: .\/word_association.php');<br \/>\n    exit;<br \/>\n }<br \/>\n }<\/font><br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<tr>\n<th>Process thesaurus data<\/th>\n<\/tr>\n<tr>\n<td>\n&lt;?php<br \/>\n<code style=font-size:8px;><br \/>\n <font color=purple>if (<\/font><font color=blue>$theone<\/font><font color=purple> == 1) {<br \/>\n $mylist = explode('&lt;div class=\"TCont\"&gt;', $pageContent);<br \/>\n if (sizeof($mylist) &gt; 1) {<br \/>\n    $pageContent=explode('&lt;\/div&gt;', $mylist[1])[0];<br \/>\n  \/\/file_put_contents('xzz.xzz', $pageContent);<br \/>\n }<br \/>\n $mylist = explode('&lt;\/h4&gt;', $pageContent);<br \/>\n if (sizeof($mylist) &gt; 1) {<br \/>\n    $pageContent=$mylist[0] . '&lt;\/h4&gt;' . explode('&lt;\/ul&gt;', $mylist[1])[0] . '&lt;\/ul&gt;';<br \/>\n    $mylist = explode('&lt;\/h4&gt;', $pageContent);<br \/>\n }<br \/>\n } else {<\/font><br \/>\n $mylist = explode('\"synonyms\":\"', $pageContent);<br \/>\n <font color=purple>}<\/font><br \/>\n <br \/>\n if (sizeof($mylist) &gt; 1 || $persist == \"n\") {<br \/>\n for ($i=1; $i&lt;sizeof($mylist); $i++) {<br \/>\n   <font color=purple>if (<\/font><font color=blue>$theone<\/font><font color=purple> == 1) {<br \/>\n   $myline = explode('&lt;\/ul&gt;', $mylist[$i]);<br \/>\n   $mywords = explode(\"&lt;\/li&gt;\", $myline[0]);<br \/>\n   } else {<\/font><br \/>\n   $myline = explode('\"', $mylist[$i]);<br \/>\n   $mywords = explode(\"|\", $myline[0]);<br \/>\n   <font color=purple>}<\/font><br \/>\n   for ($ii=0; $ii&lt;sizeof($mywords); $ii++) {<br \/>\n    <font color=purple>if ($theone == 1) {<br \/>\n      $selname = \"\";<br \/>\n\/\/echo \"yes\" . $ii . \" ... \" . explode('&gt;', explode('&lt;\/a&gt;', $mywords[$ii])[0])[(-1 + sizeof(explode('&gt;', explode('&lt;\/a&gt;', $mywords[$ii])[0])))];<br \/>\n\/\/exit;<br \/>\n      $tra=trim(explode('&gt;', explode('&lt;\/a&gt;', $mywords[$ii])[0])[(-1 + sizeof(explode('&gt;', explode('&lt;\/a&gt;', $mywords[$ii])[0])))]);<br \/>\n      if ($tra != '') {<br \/>\n      $rest = str_replace(\"&lt;\/select&gt;\", \"&lt;option value=\\\"\" . $tra . \"\\\"&gt;\" . $tra . \"&lt;\/option&gt;&lt;\/select&gt;\", $rest);<br \/>\n      }<br \/>\n    } else {<\/font><br \/>\n    $preword = explode(\" (\", $mywords[$ii]);<br \/>\n    $proposed = str_replace(\" (umgangssprachlich)\", \"\", str_replace(\" (antonym)\", \"\", str_replace(\" (related term)\", \"\", str_replace(\" (similar term)\", \"\", $mywords[$ii]))));<br \/>\n    $huhs = explode(\" (\", $proposed);<br \/>\n    if (sizeof($huhs) &gt; 1) $proposed = $huhs[0];<br \/>\n    if (substr(($proposed . \" \"), 0, 1) == \"(\") {<br \/>\n     $huhs = explode(\") \", $proposed);<br \/>\n     if (sizeof($huhs) &gt; 1) $proposed = str_replace($huhs[0] . \") \", \"\", $proposed);<br \/>\n    }<br \/>\n    if (strlen(str_replace(\" -&gt; \" . $proposed . \" -&gt; \", \"\", \" -&gt; \" . $myp . \" -&gt; \")) == strlen(\" -&gt; \" . $myp . \" -&gt; \") && strlen(str_replace(\"&gt;\" . $proposed . \"&lt;\", \"\", \"&gt;\" . $rest . \"&lt;\")) == strlen(\"&gt;\" . $rest . \"&lt;\")) {<br \/>\n    if (strpos($mywords[$ii], \" (antonym)\") !== false) {<br \/>\n      $selname = \"\";<br \/>\n      $rest = str_replace(\"&lt;\/select&gt;\", \"&lt;option value=\\\"\" . $proposed . \"\\\"&gt;\" . $proposed . \"&lt;\/option&gt;&lt;\/select&gt;\", $rest);<br \/>\n\t  \/\/echo \"&lt;tr&gt;&lt;td style='background-color:white;'&gt;&lt;\/td&gt;&lt;td style='background-color:white;'&gt;&lt;a style='text-decoration:none;' target=_blank title='\" . str_replace(\" (antonym)\", \"\", $mywords[$ii]) . \"' href='\" . $dprefix . str_replace(\" (antonym)\", \"\", $preword[0]) . \"'&gt;\" . str_replace(\" (antonym)\", \"\", $mywords[$ii]) . \"&lt;\/a&gt;&lt;\/td&gt;&lt;\/tr&gt;\";<br \/>\n    } else {<br \/>\n      $selname = \"\";<br \/>\n      $rest = str_replace(\"&lt;\/select&gt;\", \"&lt;option value=\\\"\" . $proposed . \"\\\"&gt;\" . $proposed . \"&lt;\/option&gt;&lt;\/select&gt;\", $rest);<br \/>\n\t  \/\/echo \"&lt;tr&gt;&lt;td style='background-color:white;'&gt;&lt;a style='text-decoration:none;' target=_blank title='\" . str_replace(\" (antonym)\", \"\", $mywords[$ii]) . \"' href='\" . $dprefix . str_replace(\" (antonym)\", \"\", $preword[0]) . \"'&gt;\" . str_replace(\" (antonym)\", \"\", $mywords[$ii]) . \"&lt;\/a&gt;&lt;\/td&gt;&lt;td style='background-color:white;'&gt;&lt;\/td&gt;&lt;\/tr&gt;\";<br \/>\n\t}<br \/>\n\t}<br \/>\n   <font color=purple>}<\/font><br \/>\n        }<br \/>\n }<br \/>\n }<br \/>\n<\/code><br \/>\n?&gt;\n<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; and so, we&#8217;d recommend you (re-)try <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php---GETME\" rel=\"noopener\">the changed<\/a> <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php---GETME\" rel=\"noopener\">word_association.php<\/a> <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\" rel=\"noopener\">English Word Association Game<\/a>.<\/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\/new-language-word-association-game-tutorial\/' rel=\"noopener\">New Language Word Association Game Tutorial<\/a>.<\/p-->\n<hr>\n<p id='lwagt'>Previous relevant <a target=\"_blank\" title='Language Word Association Game Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/language-word-association-game-tutorial\/' rel=\"noopener\">Language Word Association 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\/YQL\/Thesaurus\/word_association.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Language Word Association Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/WordAssociations.jpg\" title=\"Language Word Association Game Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Language Word Association Game Tutorial<\/p><\/div>\n<p>Yesterday we created <a target=\"_blank\" href='#ewagpt' title='English Word Association Game Primer Tutorial' rel=\"noopener\">English Word Association Game Primer Tutorial<\/a> as shown below, to show a draft English only version of a Word Association game good for ESL purposes.<\/p>\n<p>Today we build on that functionality by allowing Word Associations in French or German or Spanish or Italian (the other languages offered with <a target=\"_blank\" title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/' rel=\"noopener\">altervista<\/a> thesaurus web service database with Yahoo YQL), in addition, as long as the user supplies the first &#8220;seed&#8221; word for these languages.  Everything about the English functionality stays as is &#8230; keeping backward compatibility, as you&#8217;d see by clicking the picture of the tutorial below, where you play the English (only) Word Association Game, as we had it yesterday.<\/p>\n<p>With yesterday&#8217;s yesterday&#8217;s <a target=\"_blank\" title='Yahoo YQL Web Service JSON Thesaurus Tutorial' href='#yywsjtt' rel=\"noopener\">Yahoo YQL Web Service JSON Thesaurus Tutorial<\/a>, using Yahoo Web Services called YQL, as shown below, building on previous ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>, we effectively signed off on the <span title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\">final<\/span> <i>(supplementing recent <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11513' title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\" rel=\"noopener\">PHP\/CSS Sentence Auxiliary Verb Game Tutorial<\/a> showing CSS #[elementID]:before { <a target=\"_blank\" title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/sel_before.asp' rel=\"noopener\">content: [prefixContent];<\/a> } and #[elementID]:after { <a target=\"_blank\" title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_gen_content.asp' rel=\"noopener\">content: [suffixContent];<\/a> } functionality presented on the day before yesterday)<\/i> impediment to writing an English Word Association game a teacher of <a target=\"_blank\" title='ESL information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/English_as_a_second_or_foreign_language' rel=\"noopener\">ESL<\/a> could use for the teaching of <a target=\"_blank\" title='Vocabulary information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Vocabulary' rel=\"noopener\">vocabulary<\/a> for an advanced student learning English as their second language (or maybe their first?!).   The YQL 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 builds on the logic of the thesaurus tutorial of yesterday to use a YQL web service into data emanating from its links to the <a target=\"_blank\" title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/' rel=\"noopener\">altervista<\/a> thesaurus web service database with Yahoo YQL website &#8230; thanks.  For the altervista thesaurus database usage it is best to request a key for your web service queries.  You fill in a word (or two, or three) of interest to search for like-minded words.<\/p>\n<p>And what is a thesaurus?   Recap on yesterday, perhaps, by reading what Wikipedia says <a target=\"_blank\" title='Thesaurus information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Thesaurus' rel=\"noopener\">here<\/a> but, basically, it can be thought of as a repository of a language&#8217;s list of words of a similar meaning to the word of your interest.   It is a great tool for people learning a language foreign to them, especially regarding their vocabulary.<\/p>\n<p>With word association, as you might imagine, a thesaurus comes in handy for the words associated with the original word and its chosen followers, but if we want a feature to be, in English execution runs, that we can supply that first English word programmatically, we need functionality like for <a target=\"_blank\" title='PHP\/Javascript Words Within Words Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=6490' rel=\"noopener\">PHP\/Javascript Words Within Words Game Tutorial<\/a> to get that initial English <i>&#8220;seed&#8221;<\/i> word chosen from a dictionary.  For the French or German or Spanish or Italian parts of the functionality the user supplies this first &#8220;seed&#8221; word, and then the thesaurus kicks in in a programmatical way from then on, as for the English functionality.<\/p>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php-GETME\" rel=\"noopener\">word_association.php<\/a> (and then there is a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\" title=\"Click picture\" rel=\"noopener\">PHP live run<\/a>).<\/p>\n<p>How we got there &#8230; <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php-GETME\" rel=\"noopener\">word_association.php<\/a><\/p>\n<hr class='hrhuh'>\n<p id='ewagpt'>Previous relevant <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11533' title='English Word Association Game Primer Tutorial' rel=\"noopener\">English Word Association Game 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\/PHP\/YQL\/Thesaurus\/index_older.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"English Word Association Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.jpg\" title=\"English Word Association Game Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">English Word Association Game Primer Tutorial<\/p><\/div>\n<p>With yesterday&#8217;s <a target=\"_blank\" title='Yahoo YQL Web Service JSON Thesaurus Tutorial' href='#yywsjtt' rel=\"noopener\">Yahoo YQL Web Service JSON Thesaurus Tutorial<\/a>, using Yahoo Web Services called YQL, as shown below, building on previous ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>, we effectively signed off on the <span title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\">final<\/span> <i>(supplementing recent <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11513' title=\" ... the other one is a 'nice to have' functionality as outlined yesterday with PHP\/CSS Sentence Auxiliary Verb Game Tutorial\" rel=\"noopener\">PHP\/CSS Sentence Auxiliary Verb Game Tutorial<\/a> showing CSS #[elementID]:before { <a target=\"_blank\" title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/sel_before.asp' rel=\"noopener\">content: [prefixContent];<\/a> } and #[elementID]:after { <a target=\"_blank\" title='CSS content information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_gen_content.asp' rel=\"noopener\">content: [suffixContent];<\/a> } functionality presented on the day before yesterday)<\/i> impediment to writing an English Word Association game a teacher of <a target=\"_blank\" title='ESL information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/English_as_a_second_or_foreign_language' rel=\"noopener\">ESL<\/a> could use for the teaching of <a target=\"_blank\" title='Vocabulary information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Vocabulary' rel=\"noopener\">vocabulary<\/a> for an advanced student learning English as their second language (or maybe their first?!).   The YQL 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 builds on the logic of the thesaurus tutorial of yesterday to use a YQL web service into data emanating from its links to the <a target=\"_blank\" title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/' rel=\"noopener\">altervista<\/a> thesaurus web service database with Yahoo YQL website &#8230; thanks.  For the altervista thesaurus database usage it is best to request a key for your web service queries.  You fill in a word (or two, or three) of interest to search for like-minded words.<\/p>\n<p>And what is a thesaurus?   Recap on yesterday, perhaps, by reading what Wikipedia says <a target=\"_blank\" title='Thesaurus information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Thesaurus' rel=\"noopener\">here<\/a> but, basically, it can be thought of as a repository of a language&#8217;s list of words of a similar meaning to the word of your interest.   It is a great tool for people learning a language foreign to them, especially regarding their vocabulary.<\/p>\n<p>With word association, as you might imagine, a thesaurus comes in handy for the words associated with the original word and its chosen followers, but we need functionality like for <a target=\"_blank\" title='PHP\/Javascript Words Within Words Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=6490' rel=\"noopener\">PHP\/Javascript Words Within Words Game Tutorial<\/a> to get that initial <i>&#8220;seed&#8221;<\/i> word chosen from a dictionary.<\/p>\n<p>Here is a link to some downloadable PHP programming source code which you may want to rename to <a target=\"_blank\" title='word_association.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php_GETME\" rel=\"noopener\">word_association.php<\/a> (and then there is a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/word_association.php\" title=\"Click picture\" rel=\"noopener\">PHP live run<\/a>).<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>Again we use PHP and we hope this is not frustrating those readers who have no PHP installed?  It is easy to install PHP web server language (and Apache web server with MySql database) locally for Windows or Mac and would recommend, respectively,   <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1078' title='EasyPHP Windows Framework for PHP\/MySql Tutorial' rel=\"noopener\">EasyPHP Windows Framework for PHP\/MySql Tutorial<\/a> and <a target=\"_blank\" href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=532' title='MAMP Mac Framework for PHP\/MySql Tutorial' rel=\"noopener\">MAMP Mac Framework for PHP\/MySql Tutorial<\/a> for (install) advice here.<\/p>\n<hr \/>\n<p id='yywsjtt'>Previous relevant <a target=\"_blank\" title='Yahoo YQL Web Service JSON Thesaurus Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11246' rel=\"noopener\">Yahoo YQL Web Service JSON Thesaurus 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\/Thesaurus\/Ajax_yql_thesaurus.html\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Yahoo YQL Web Service JSON Thesaurus Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Thesaurus.jpg\" title=\"Yahoo YQL Web Service JSON Thesaurus Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Yahoo YQL Web Service JSON Thesaurus 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 ones here at this <a href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=YQL' title='Yahoo YQL tutorials here'>blog<\/a>.   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 <a target=\"_blank\" title='altervista thesaurus ... thanks' href='http:\/\/thesaurus.altervista.org\/' rel=\"noopener\">altervista<\/a> thesaurus web service database with Yahoo YQL website &#8230; thanks.  For the altervista thesaurus database usage it is best to request a key for your web service queries.  You fill in a word (or two, or three) of interest to search for like-minded words.<\/p>\n<p>And what is a thesaurus?   Read what Wikipedia says <a target=\"_blank\" title='Thesaurus information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Thesaurus' rel=\"noopener\">here<\/a> but, basically, it can be thought of as a repository of a language&#8217;s list of words of a similar meaning to the word of your interest.   It is a great tool for people learning a language foreign to them, especially regarding their vocabulary.<\/p>\n<p>The two big PHP functions of use (as distinct from an Ajax approach, requiring no PHP &#8230; read on) for this are:<\/p>\n<ul>\n<li><a target=\"_blank\" title='file_get_contents' href='http:\/\/us1.php.net\/file_get_contents' rel=\"noopener\">file_get_contents<\/a><\/li>\n<li><a target=\"_blank\" title='json_decode' href='http:\/\/php.net\/manual\/en\/function.json-decode.php' rel=\"noopener\">json_decode<\/a> &#8230; when there is a data structure of any complexity, this function is highly recommended, but for today&#8217;s tutorial we do not use it, and take the opportunity to show you a solution using <a target=\"_blank\" title='Ajax information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Ajax_%28programming%29' rel=\"noopener\">Ajax<\/a> that requires no PHP &#8230;  link to some downloadable Ajax inspired HTML programming source code which you may want to rename to <a target=\"_blank\" title='yql_thesaurus.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html-GETME\" rel=\"noopener\">Ajax_yql_thesaurus.html<\/a> which changes from the HTML supervising PHP approach as per <a target=\"_blank\" title='Ajax_yql_thesaurus.html changes' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html-GETME\" rel=\"noopener\">Ajax_yql_thesaurus.html<\/a> (and then there is an <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/Ajax_yql_thesaurus.html\" title=\"Click picture\" rel=\"noopener\">Ajax live run<\/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' rel=\"noopener\">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' rel=\"noopener\">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' rel=\"noopener\">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+thesaurus+where+key%3D%22test_only%22+and+word%3D%22peace%22+and+language%3D%22en_US%22' title='YQL thesaurus help' rel=\"noopener\">YQL thesaurus 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' rel=\"noopener\">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\/' rel=\"noopener\">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='yql_thesaurus.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.html_GETME\" rel=\"noopener\">yql_thesaurus.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=\"_blank\" title='yql_thesaurus.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.php_GETME\" rel=\"noopener\">yql_thesaurus.php<\/a> (and then there is a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/YQL\/Thesaurus\/yql_thesaurus.html\" title=\"Click picture\" rel=\"noopener\">PHP live run<\/a>).<\/p>\n<p>We thank the following free online dictionaries &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/www.thefreedictionary.com\/\" rel=\"noopener\">English<\/a><\/li>\n<li><a target=\"_blank\" title=\"French\" href=\"http:\/\/www.systranet.com\/dictionary\/\" rel=\"noopener\">French<\/a><\/li>\n<li><a target=\"_blank\" title=\"German\" href=\"http:\/\/www.dict.cc\/\" rel=\"noopener\">German<\/a><\/li>\n<li><a target=\"_blank\" title=\"Italian\" href=\"http:\/\/www.wordreference.com\/iten\/\" rel=\"noopener\">Italian<\/a><\/li>\n<li><a target=\"_blank\" title=\"Spanish\" href=\"http:\/\/www.wordreference.com\/es\/en\/translation.asp\" rel=\"noopener\">Spanish<\/a><\/li>\n<\/ul>\n<p>Stay tuned for an interesting blog posting tomorrow which combines the new thesaurus functionality of today&#8217;s contribution, along with the functionality <i>&#8220;smarts&#8221;<\/i> of yesterday&#8217;s <a target=\"_blank\" title='PHP\/CSS Sentence Auxiliary Verb Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=11513' rel=\"noopener\">PHP\/CSS Sentence Auxiliary Verb Game Tutorial<\/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='#d11246' onclick='var dv=document.getElementById(\"d11246\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=dictionary\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11246' 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='#d11533' onclick='var dv=document.getElementById(\"d11533\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=thesaurus\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11533' 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='#d11641' onclick='var dv=document.getElementById(\"d11641\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=internationalization\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11641' 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='#d64244' onclick='var dv=document.getElementById(\"d64244\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/variable\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64244' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>One step forward, and steps back is how we&#8217;d describe progress, onto the PHP Word Association web application game of Language Word Association Game Tutorial &#8230; the step forward being the replacing of obsolete Yahoo YQL Thesaurus sources of information &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-association-game-revisit-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,15,37],"tags":[2462,290,388,429,476,3081,932,997,1269,1319,1721,1452,4844,1453],"class_list":["post-64244","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-tutorials","tag-association","tag-data","tag-english","tag-file_get_contents","tag-game","tag-global-variable","tag-php","tag-programming","tag-thesaurus","tag-tutorial","tag-variable","tag-word","tag-word-association","tag-word-game"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64244"}],"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=64244"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64244\/revisions"}],"predecessor-version":[{"id":64273,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64244\/revisions\/64273"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=64244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=64244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=64244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}