{"id":13498,"date":"2017-05-19T23:40:07","date_gmt":"2017-05-20T03:40:07","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=13498"},"modified":"2017-05-19T23:40:07","modified_gmt":"2017-05-20T03:40:07","slug":"forex-compact-desktop-widget-foreign-exchange-rates-display","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/forex-compact-desktop-widget-foreign-exchange-rates-display\/","title":{"rendered":"ForEx: A compact desktop widget for foreign exchange rates display"},"content":{"rendered":"<p class=\"description\"><strong>ForEx<\/strong> is a <a href=\"https:\/\/hackaday.io\/project\/11081-forex-display\" target=\"_blank\">cute little desktop widget<\/a> designed by <em>Stefan<\/em> for displaying major\u00a0foreign exchange rates and the time of different locations using ESP8266.<\/p>\n<div id=\"attachment_13499\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2017\/05\/forex.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-13499\" class=\"size-full wp-image-13499\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2017\/05\/forex.jpg\" alt=\"ESP8266 displays foreign exchange rates on your desk\" width=\"800\" height=\"516\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2017\/05\/forex.jpg 800w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2017\/05\/forex-580x374.jpg 580w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-13499\" class=\"wp-caption-text\">ESP8266 displays foreign exchange rates on your desk<\/p><\/div>\n<blockquote><p>The time zone references are fetched a bit complicated but this method works and deliver accurate results. Further it allows using the effective name of the city which makes easier to use. In a first step the coordinates of the desired city are evaluated using the API of <a href=\"http:\/\/openweathermap.org\/\" target=\"_blank\">openweathermap.org<\/a>. This works by sending the name of the city in a format like \u201cSydney,au\u201d to the API which will response with its coordinates. In the second step the momentary offset to UTC of this coordinates is calculated. This can be done by sending those coordinates to the <a href=\"http:\/\/worldweatheronline.com\/\" target=\"_blank\">worldweatheronline.com<\/a> API.<\/p>\n<p>With this UTC offset information the time at the current location and the time on the defined cities is calculated and displayed. The advantage of this slightly complicated method is the always respected day light saving state at any place including the actual location.<\/p>\n<p>For the evaluation of the currency exchange rate the <a href=\"http:\/\/fixer.io\/\" target=\"_blank\">fixer.io<\/a> API is used. There are forex API\u2019s offering much more currencies with a shorter update cycle. But this API is simple to use, doesn\u2019t require an API Key and can easily provide the exchange rate to a chosen reference currency.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ForEx is a cute little desktop widget designed by Stefan for displaying major\u00a0foreign exchange rates and the time of different locations using ESP8266. The time zone references are fetched a bit complicated but this method works and deliver accurate results. Further it allows using the effective name of the city which makes easier to use. In a first step the coordinates of the desired city are evaluated using the API of openweathermap.org. This works by sending the name of the city in a format like \u201cSydney,au\u201d to the API which will response with its coordinates. In the second step the<\/p>\n","protected":false},"author":1,"featured_media":13499,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1044,958],"tags":[1046,1652],"class_list":["post-13498","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp8266","category-internet-of-things","tag-esp8266-project","tag-forex"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/13498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=13498"}],"version-history":[{"count":1,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/13498\/revisions"}],"predecessor-version":[{"id":13500,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/13498\/revisions\/13500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/13499"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=13498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=13498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=13498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}