{"id":14122,"date":"2015-04-12T05:05:13","date_gmt":"2015-04-11T19:05:13","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=14122"},"modified":"2015-04-12T05:05:13","modified_gmt":"2015-04-11T19:05:13","slug":"acronyms-lookup-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/acronyms-lookup-primer-tutorial\/","title":{"rendered":"Acronyms Lookup Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Acronyms Lookup Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.jpg\" title=\"Acronyms Lookup Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Acronyms Lookup Primer Tutorial<\/p><\/div>\n<p>It&#8217;s good every now and then to see what is new in the world of data feeds on the internet, so that is how, via this <a target=_blank title='Great link for latest public feeds of interest' href='http:\/\/gearside.com\/public-json-feeds\/'>great link<\/a>, we got onto the wonderful Acronym lookup resource at <a target=_blank title='' href='http:\/\/www.nactem.ac.uk\/'>NaCTeM<\/a> (The National Centre for Text Mining) &#8230; thanks &#8230; <\/p>\n<blockquote><p>\nAcromine: Okazaki, N., Ananiadou, S. (2006) Building an abbreviation dictionary using a term recognition approach. Bioinformatics, Volume 22, Number 24, pp. 3089-3095, Oxford University Press\n<\/p><\/blockquote>\n<p>So this tutorial uses the data emanating from NaCTeM&#8217;s feed of Acronym data.  You fill in an Acronym of interest into an input text box and known results are sent back in JSON format.<\/p>\n<p>The two big PHP functions of use for JSON parsing 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><\/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='getacronymdata.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html_GETME\">getacronymdata.html<\/a> which calls some downloadable PHP programming source code which you may want to rename to <a target=_blank title='getacronymdata.php' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.php_GETME\">getacronymdata.php<\/a><\/p>\n<p>Here are a few things you may find interesting about the code &#8230;<\/p>\n<ul>\n<li>the HTML calls the PHP via <a target=_blank title='jQuery Ajax' href='http:\/\/api.jquery.com\/jquery.ajax\/'>jQuery Ajax<\/a> (and avoids cross-domain issues by using local PHP)<\/li>\n<li>the HTML will parse the JSON callback data if it is a totally capitalised entry (using <a target=_blank title='JSON.parse() and general JSON information from w3schools' href='http:\/\/www.w3schools.com\/json\/json_eval.asp'>JSON.parse()<\/a>), else the PHP will do the JSON parsing<\/li>\n<li>we found the raw callback data needed the outer [] stripped to be JSON parsable<\/li>\n<\/ul>\n<p>So maybe you will find something interesting with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/JSON\/Acronym\/getacronymdata.html\" title='Click picture'>live run<\/a>, and hope to see you tomorrow with improvements.<\/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='#d14122' onclick='var dv=document.getElementById(\"d14122\"); 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='d14122' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s good every now and then to see what is new in the world of data feeds on the internet, so that is how, via this great link, we got onto the wonderful Acronym lookup resource at NaCTeM (The National &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/acronyms-lookup-primer-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":[2,12,13,37],"tags":[56,69,277,294,396,412,429,576,652,663,664,666,932,997,1319,1357],"class_list":["post-14122","post","type-post","status-publish","format-standard","hentry","category-ajax","category-elearning","category-esl","category-tutorials","tag-acronym","tag-ajax","tag-cross-domain","tag-data-mining","tag-esl","tag-feed","tag-file_get_contents","tag-html","tag-javascript","tag-jquery","tag-json","tag-json_decode","tag-php","tag-programming","tag-tutorial","tag-validate"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14122"}],"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=14122"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/14122\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=14122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=14122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=14122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}