{"id":164,"date":"2022-12-25T18:07:31","date_gmt":"2022-12-25T10:07:31","guid":{"rendered":"https:\/\/parng.com\/lctc\/?p=164"},"modified":"2022-12-30T13:39:51","modified_gmt":"2022-12-30T05:39:51","slug":"livecode-for-web3-development","status":"publish","type":"post","link":"https:\/\/parng.com\/lctc\/2022\/12\/25\/livecode-for-web3-development\/","title":{"rendered":"LiveCode for Web3 Development"},"content":{"rendered":"\n<p>I have been using LiveCode to develop numerous desktop and mobile APPs over the years. LiveCode has never failed me and always gets the job done with less time and effort.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"209\" src=\"https:\/\/parng.com\/lctc\/wp-content\/uploads\/2017\/12\/lclogo600.png\" alt=\"\" class=\"wp-image-36\" srcset=\"https:\/\/parng.com\/lctc\/wp-content\/uploads\/2017\/12\/lclogo600.png 600w, https:\/\/parng.com\/lctc\/wp-content\/uploads\/2017\/12\/lclogo600-300x105.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n<\/div>\n\n\n<p>In 2022, I started Web3, blockchain, crypto currency, and NFT related development work. On top of many new things to learn, I am using LiveCode in a different way to develop over a dozen Web3 services delivered via web pages. This is a big challenge for me since I am not using &#8220;LiveCode Web&#8221; deployment (which may change when LiveCode 10 is released). I am only using LiveCode for the backend server side and use CSS\/Javascript for the frontend client side. Still,  I find LiveCode can help me get the job done as before.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/hhott.com\/tc\/wp-content\/uploads\/2022\/06\/web3hhott.jpg\" alt=\"\" class=\"wp-image-4186\"\/><figcaption class=\"wp-element-caption\"><center>Web3 services are built with blockchain, crypto currency, and NFT<\/center><\/figcaption><\/figure>\n\n\n\n<p>Below are what I&#8217;ve learned from this new development experience:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Using LiveCode to interface with any 3rd party APIs including blockchain, crypto currency, and NFT APIs is a breeze no matter if they are GET, POST, or PUT. The only drawback I found is I can&#8217;t find the sample code for LiveCode to use the APIs from these 3rd party sites. Sample code is needed for programming languages that are difficult to learn and use. It is not a problem for LiveCode since it can get the job done more straightforward with less code (normally 1 to 10 lines of code) than other languages so there is really no need for sample code.<br>\ud83d\udccd<em>Example Code: 5 lines of code to get Bitcoin to USD exchange data<\/em><pre>   set the HTTPHeaders to \"CB-VERSION\", \"2018-01-01\" <br>   put url (\"https:\/\/api.coinbase.com\/v2\/exchange-rates?currency=BTC\") into tdata <br>   put jsonToArray(tdata) into tdataA <br>   put tdataA[\"data\"][\"rates\"][\"USD\"] into tusd <br>   set the HTTPHeaders to \"\" <\/pre> <\/li>\n\n\n\n<li>Using LiveCode on the server side can fill all my needs without resorting to other languages such as PHP, JSP, ASP, Perl, Python, Ruby, JAVA\u2026 I can even set up CRON jobs to run LiveCode scripts (e.g., making API calls to gather specific data) to handle routine work at any given time intervals!<br>\ud83d\udccd<em>Example Code: 1 line of code to set up news crawler CRON job<\/em> <pre>   curl https:\/\/hhott.com\/news\/crawler.lc<\/pre><\/li>\n\n\n\n<li>Embedding LiveCode in web pages mixed with HTML, CSS, and Javascript to provide backend data and support for these pages is not a problem. There are simple ways to exchange data between LiveCode and Javascript so there is no limit on what I can do to integrate backend and frontend data.<br>\ud83d\udccd<em>Example Code: 1 line of code to save a LiveCode variable value in a document object to use in Javascript <\/em><pre>   put \"&lt;span id='mid'&gt;\" &amp; tmid &amp; \"&lt;\/span&gt;\"<\/pre><\/li>\n\n\n\n<li>I can create my own backend APIs in LiveCode and call these APIs from Javascript in the frontend web pages. This seamless integration between backend LiveCode and frontend Javascript helps me realize any features I need and I can imagine. <br>\ud83d\udccd<em>Example Code: 19-line LiveCode AddFavNews API to add\/remove a favored news <\/em><pre>   put $_POST_RAW into tRequest<br>   put jsonToArray(tRequest) into tRequestA<br>   put tRequestA[\"tid\"] into tfid <br>   put tRequestA[\"mid\"] into tmid <br>   put revOpenDatabase(\"MySQL\", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult<br>   if tResult is a number then<br>      put tResult into gConnectionID<br>      put \"SELECT tid FROM favnews WHERE memid=\" &amp; tmid &amp; \" and fid=\" &amp; tfid into tSQL<br>      put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tdata<br>      if tdata = \"\" then<br>         put \"memid, fid\" into tFields<br>         put \"INSERT INTO favnews (\" &amp; tFields &amp; \") VALUES (:1, :2)\" into tSQL<br>         revExecuteSQL gConnectionID, tSQL, \"tmid\", \"tfid\"<br>      else<br>         put \"delete from favnews WHERE memid=\" &amp; tmid &amp; \" and fid=\" &amp; tfid into tSQL<br>         revExecuteSQL gConnectionID, tSQL<br>      end if<br>      revCloseDatabase gConnectionID<br>   end if<\/pre> <br>\ud83d\udccd<em>Example Code: 15 lines of Javascript code to call LiveCode AddFavNews API (LiveCode variable values stored in document objects are used in Javascript)<\/em><pre>async function addfavnews() {<br>  var x=document.getElementById(\"tid\").innerHTML;<br>  var y=document.getElementById(\"mid\").innerHTML;<br>  let url = 'https:\/\/hhott.com\/addfavnews.lc';<br>  let res = await fetch(url, {<br>            method: 'POST',<br>            headers: {<br>                'Content-Type': 'application\/json',<br>            },<br>  body: JSON.stringify({<br>    tid:x,<br>    mid:y,<br>  }),<br>          });<br>}<\/pre><\/li>\n<\/ol>\n\n\n\n<p>To complete my Web3 services, I did spend a lot of time learning CSS and Javascript for the frontend web pages. I hope I can leave HTML, CSS, and Javascript all behind and leapfrog to LiveCode 10 Web deployment when it becomes available. I can&#8217;t wait for that to happen since I can get a lot more work done with a lot less effort. More importantly, a lot of work I&#8217;ve done in LiveCode in the past can be put directly on the web! Whenever I think about this, I got really excited!<\/p>\n\n\n\n<p>OK. Don&#8217;t just take my words for it. You can check out the work I&#8217;ve done from the links below to experience it yourself. Everything you see is all done by myself. YES, one person does all the coding and even the (not too professional) graphic work! I don&#8217;t think it is possible  for me to do all these work alone with any other languages.<\/p>\n\n\n\n<p>The following is to share the insights and thoughts I have gathered in the past year from developing Web3 services, and my plan for 2023. You can also find out what makes up a Web3 service.<\/p>\n\n\n\n<p>\ud83d\udccd Reflecting on 2022, Anticipating 2023 (inspired by Heather)<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/en\/reflecting-on-2022-anticipating-2023\/\">https:\/\/hhott.com\/en\/reflecting-on-2022-anticipating-2023\/<\/a><\/p>\n\n\n\n<p>Also, my first Web3 news reader game &#8220;<a href=\"https:\/\/hhott.com\/newsen.lc\">HHOTT News<\/a>&#8221; has been completed and I would like to invite everyone to test and experience it. <a href=\"https:\/\/hhott.com\/newsen.lc\">HHOTT News<\/a> is one of the first 10 Web3 services I plan to release in 2023. It is the easiest one so it got released first. The coding part of all other services is mostly done. I just need to do more testing and complete the documentation. (And I would appreciate very much if someone can help.)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/hhott.com\/freenewsen.lc\"><img decoding=\"async\" src=\"https:\/\/hhott.com\/en\/wp-content\/uploads\/2022\/12\/newsen9-0-2.jpg\" alt=\"\" class=\"wp-image-1085\"\/><\/a><figcaption class=\"wp-element-caption\"><center><a href=\"https:\/\/hhott.com\/freenewsen.lc\">Click to read the free HHOTT News<\/a><\/center><\/figcaption><\/figure>\n\n\n\n<p>\ud83d\udccd Promote HHOTT News to the world<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/freenewsen.lc\">https:\/\/hhott.com\/freenewsen.lc<\/a> (mainly US news)<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/en\/promote-hhott-news-to-the-world\/\">https:\/\/hhott.com\/en\/promote-hhott-news-to-the-world\/<\/a> (more info)<\/p>\n\n\n\n<p>\ud83d\udccd First 10 Web3 services to release in 2023<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/en\/introduction\/\">https:\/\/hhott.com\/en\/introduction\/<\/a><\/p>\n\n\n\n<p>Last but not least, LiveCode&#8217;s unicode support works really great for i18n (internationalization) development. Below is <a href=\"https:\/\/hhott.com\/newstc.lc\">HHOTT News in traditional Chinese<\/a>. The news sources I collected can support more than 50 countries and languages.&nbsp;Let me know if you are interested in developing a version for your country and language. It could be as simple as changing the two-letter country code.<\/p>\n\n\n\n<p>\ud83d\udccd \u5411\u5168\u4e16\u754c\u63a8\u5ee3\u71b1\u900f\u982d\u689d (\u7e41\u9ad4\u4e2d\u6587\u7248)<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/freenewstc.lc\">https:\/\/hhott.com\/freenewstc.lc<\/a> (mainly Taiwan news)<br>\ud83d\udd17 <a href=\"https:\/\/hhott.com\/tc\/\u5411\u5168\u4e16\u754c\u63a8\u5ee3\u71b1\u900f\u982d\u689d\/\">https:\/\/hhott.com\/tc\/\u5411\u5168\u4e16\u754c\u63a8\u5ee3\u71b1\u900f\u982d\u689d\/<\/a> (more info)<\/p>\n\n\n\n<p>By combining creativity and the latest blockchain and NFT technology, I am very confident I can build outstanding Web3 services using LiveCode. And I truly believe LiveCode is the best tool to build world-class Web3 services. <\/p>\n\n\n\n<p>Finally, I would like to conclude this blog with an invitation to like-minded friends to join me and work as a team for the better future of Web3 and LiveCode in 2023 and beyond. You can be a developer, a marketer, a promoter, an evangelist, or whatever role you would like to play. Please hit me up if you are interested. Maybe we can all be part of &#8220;LiveCode DAO&#8221;. I am looking forward to hearing from you.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"908\" src=\"https:\/\/parng.com\/lctc\/wp-content\/uploads\/2022\/12\/disrupt2023-lc.jpg\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/parng.com\/lctc\/wp-content\/uploads\/2022\/12\/disrupt2023-lc.jpg 720w, https:\/\/parng.com\/lctc\/wp-content\/uploads\/2022\/12\/disrupt2023-lc-238x300.jpg 238w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption class=\"wp-element-caption\"><center>Join us for the better future of Web3<center><\/center><\/center><\/figcaption><\/figure>\n\n\n\n<p>HHOTT Founder<br>Andy Parng<\/p>\n\n\n\n<p>#LiveCode #Web3 #Blockchain #NFT<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been using LiveCode to develop numerous desktop  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/parng.com\/lctc\/2022\/12\/25\/livecode-for-web3-development\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008LiveCode for Web3 Development\u3009<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-164","post","type-post","status-publish","format-standard","hentry","category-3"],"_links":{"self":[{"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/posts\/164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/comments?post=164"}],"version-history":[{"count":53,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/posts\/164\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/posts\/164\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/media?parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/categories?post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/parng.com\/lctc\/wp-json\/wp\/v2\/tags?post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}