|
126 | 126 | tags:"local storage high score"
|
127 | 127 | }
|
128 | 128 | ],
|
129 |
| - //CURRENCY FUNCTIONS STILL IN THE WORKS |
130 |
| - // "Currency Conversion":[ |
131 |
| - // { |
132 |
| - // integrationDescription:"Use the corrency conversion functions to convert with current conversion rates.", |
133 |
| - // html:"<a href='https://www.easymarkets.com/int/learn-centre/discover-trading/currency-acronyms-and-abbreviations/'>Click here for a list of currency abbreviations</a>", |
134 |
| - // integrationDescriptionClass:"alert-info" |
135 |
| - // }, |
136 |
| - // {html:"<hr style=\"height:7px;border:none;color:#e0e0e0;background-color:#e0e0e0;\"/>"}, |
137 |
| - // { |
138 |
| - // description:"Get the current conversion rate.", |
139 |
| - // code:'//From USD to EUR\ncurrencyConversionRate("USD","EUR")\n//From GBP to USD\ncurrencyConversionRate("GBP","USD")', |
140 |
| - // tags:"currency conversion" |
141 |
| - // } |
142 |
| - // ] |
| 129 | + "Get Requests": [ |
| 130 | + { |
| 131 | + integrationDescription:"Use the getData() function to pull data from various APIs. You can see specific examples for several APIs in the Integrations section of the WoofJS documentation.", |
| 132 | + integrationDescriptionClass:"alert-info" |
| 133 | + }, |
| 134 | + {html:"<hr style=\"height:7px;border:none;color:#e0e0e0;background-color:#e0e0e0;\"/>"}, |
| 135 | + { |
| 136 | + description:"getData() works by taking an url and a function to do with the returned data. This is an example using the Sunrise-Sunset API.", |
| 137 | + code:'//First set up temporary text that will be replaced\nvar temp = new Text({\n text: "...", \n size: 60, \n color: "white", \nfontFamily: "arial",\n})\n//Then set your variables for the request\nvar lat = 40.7128\nvar lng = -74.0059 \n//Then set the url for your request\nvar url = "https://api.sunrise-sunset.org/json?lat=" + lat + "&lng=" + lng\n//Finaly call the getData() function\ngetData(url, data => {\n //Replace the temporary text\n temp.text = data.results.sunset\n}) ', |
| 138 | + tags:"get request json http" |
| 139 | + }, |
| 140 | + { |
| 141 | + integrationDescription:"The data returned will in JSON format so it will need to be parsed to get the proper value you are looking for.", |
| 142 | + html:"<a target='_blank' href='https://joebeachjoebeach.github.io/json-path-finder/'>Use this JSON Path Finder to help you find the correct path for the data you are looking to retreive.</a>", |
| 143 | + integrationDescriptionClass:"alert-info" |
| 144 | + }, |
| 145 | + ], |
| 146 | + "Currency Conversion":[ |
| 147 | + { |
| 148 | + integrationDescription:"Use the Currency Conversion API to get current conversion rates.", |
| 149 | + html:"<a target='_blank' href='http://fixer.io/'>Click here for the Currency Conversion API documentation</a>", |
| 150 | + integrationDescriptionClass:"alert-info" |
| 151 | + }, |
| 152 | + {html:"<hr style=\"height:7px;border:none;color:#e0e0e0;background-color:#e0e0e0;\"/>"}, |
| 153 | + { |
| 154 | + description:"Here is a walk through of a program shows how much $5 is currently worth in EUR.", |
| 155 | + code:'//First set up temporary text that will be replaced\nvar temp = new Text({\n text: "...", \n size: 60, \n color: "white", \n fontFamily: "arial",\n})\n//Then set your variables for the request\nvar base = "USD"\n//Then set the url for your request\nvar url = "http://api.fixer.io/latest?base=" + base\n//Finaly call the getData() function\ngetData(url, data => {\n //Replace the temporary text with the converted amoung\n temp.text = Math.round( 5*data.rates.EUR * 100) /100 + " EUR"\n}) ', |
| 156 | + tags:"currency conversion" |
| 157 | + }, |
| 158 | + { |
| 159 | + description:"Here is a walk through of a program shows how much 10 GBP is currently worth in USD.", |
| 160 | + code:'//First set up temporary text that will be replaced\nvar temp = new Text({\n text: "...", \n size: 60, \n color: "white", \n fontFamily: "arial",\n})\n//Then set your variables for the request\nvar base = "GBP"\n//Then set the url for your request\nvar url = "http://api.fixer.io/latest?base=" + base\n//Finaly call the getData() function\ngetData(url, data => {\n //Replace the temporary text with the converted amoung\n temp.text = Math.round( 10*data.rates.USD * 100) /100 + " USD"\n}) ', |
| 161 | + tags:"currency conversion" |
| 162 | + }, |
| 163 | + {html:"<hr style=\"height:7px;border:none;color:#e0e0e0;background-color:#e0e0e0;\"/>"}, |
| 164 | + { |
| 165 | + integrationDescription:"For other currencies visit the API's documentation for help.", |
| 166 | + html:"<a target='_blank' href='http://fixer.io/'>Click here for the Currency Conversion API documentation</a>", |
| 167 | + integrationDescriptionClass:"alert-info" |
| 168 | + }, |
| 169 | + ], |
| 170 | + "Sunrise and Sunset Data":[ |
| 171 | + { |
| 172 | + integrationDescription:"Use the Sunrise-Sunset API to get data about upcoming or past sunrises and sunsets.", |
| 173 | + html:"<a target='_blank' href='https://sunrise-sunset.org/api'>Click here for Sunrise-Sunset API documentation</a><br><a target='_blank' href='http://www.latlong.net/'>Click here to find latitude and longitude values</a>", |
| 174 | + integrationDescriptionClass:"alert-info" |
| 175 | + }, |
| 176 | + {html:"<hr style=\"height:7px;border:none;color:#e0e0e0;background-color:#e0e0e0;\"/>"}, |
| 177 | + { |
| 178 | + description:"Here is a walk through of how to display today's sunrise time in NYC:", |
| 179 | + code:'//First set up temporary text that will be replaced\nvar temp = new Text({\n text: "...", \n size: 60, \n color: "white", \nfontFamily: "arial",\n})\n//Then set your variables for the request\nvar lat = 40.7128\nvar lng = -74.0059 \n//Then set the url for your request\nvar url = "https://api.sunrise-sunset.org/json?lat=" + lat + "&lng=" + lng\n//Finaly call the getData() function\ngetData(url, data => {\n //Replace the temporary text\n temp.text = data.results.sunset\n}) ', |
| 180 | + tags:"sunrise sunrise url" |
| 181 | + }, |
| 182 | + { |
| 183 | + description:"Here is a walk through of how to display today's sunset time in NYC:", |
| 184 | + code:'//First set up temporary text that will be replaced\nvar temp = new Text({\n text: "...", \n size: 60, \n color: "white", \nfontFamily: "arial",\n})\n//Then set your variables for the request\nvar lat = 40.7128\nvar lng = -74.0059 \n//Then set the url for your request\nvar url = "https://api.sunrise-sunset.org/json?lat=" + lat + "&lng=" + lng\n//Finaly call the getData() function\ngetData(url, data => {\n //Replace the temporary text\n temp.text = data.results.sunset\n}) ', |
| 185 | + tags:"sunrise sunset url" |
| 186 | + }, |
| 187 | + { |
| 188 | + description:"There is even more you can do with the Sunrise-Sunset API:", |
| 189 | + code:'//Instead of data.results.sunrise or data.results.sunset, try:\ndata.results.solar_noon\ndata.results.day_length\ndata.results.civil_twilight_begin\ndata.results.civil_twilight_end\ndata.results.nautical_twilight_begin\ndata.results.nautical_twilight_end\nata.results.astronomical_twilight_begin\nata.results.astronomical_twilight_begin', |
| 190 | + tags:"sunrise sunset url" |
| 191 | + } |
| 192 | + ] |
143 | 193 |
|
144 | 194 | },
|
145 | 195 | "Sprites & Backgrounds": {
|
|
0 commit comments