-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtwc-core.html
106 lines (103 loc) · 5.58 KB
/
twc-core.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<script type="text/javascript">
RED.nodes.registerType('twc-daily-forecast',{
category: 'Weather',
color: "#a2a9b0",
icon: "icons/wi-wu-partlycloudy.png",
inputs:1,
outputs:1,
defaults: {
name: { value:""},
range: { value:"daily",required:true},
locationtype: {value:"geocode",required: true},
location: {value:"",required: true},
lang: {value:"en-US"},
units: { value:"e"},
apikey: {value:"", type:"pwsapikey",required: true}
},
label: function() {
return this.name||"TWC Daily Forecast";
}
});
</script>
<script type="text/x-red" data-template-name="twc-daily-forecast">
<div class="form-row">
<label for="node-input-apikey"><i class="fa fa-key"></i> API Key</label>
<input type="text" id="node-input-apikey">
</div>
<div class="form-row">
<label for="node-input-range"><i class="fa fa-area-chart"></i> Forecast Range</label>
<select id="node-input-range">
<option value="3day">3 day</option>
<option value="5day">5 day</option>
<option value="7day">7 day</option>
<option value="10day">10 day</option>
<option value="15day">15 day</option>
</select>
</div>
<div class="form-row">
<label for="node-input-locationtype"><i class="fa fa-globe"></i> Location Type</label>
<select id="node-input-locationtype">
<option value="geocode">Request by Geocode</option>
<option value="iataCode">Request by IATA Airport Code</option>
<option value="icaoCode">Request by ICAO Airport Code</option>
<option value="placeid">Request by Place ID</option>
<option value="postalKey">Request by Postal Key</option>
</select>
</div>
<div class="form-row">
<label for="node-input-location"><i class="fa fa-map-marker"></i> Location</label>
<input type="text" id="node-input-location" placeholder="40.98,-74.1">
</div>
<div class="form-row">
<label for="node-input-lang"><i class="fa fa-language"></i> Language</label>
<input type="text" id="node-input-lang" placeholder="en-US">
</div>
<div class="form-row">
<label for="node-input-units"><i class="fa fa-thermometer-half"></i> Unit of Measure</label>
<select id="node-input-units">
<option value="e">English units</option>
<option value="m">Metric units</option>
<option value="h">Hybrid units (UK)</option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name">
</div>
</script>
<script type="text/x-red" data-help-name="twc-daily-forecast">
<p>The Daily Forecast API is sourced from the The Weather Company Forecast system. This TWC API returns weather forecasts starting from the current day.
Your TWC API Key determines the number of days returned in the API response. Subscribers to the TWC Core Package receive access to the 3,5,7,
and 10 Day Forecasts. Subscribers to the TWC Enhanced Forecast Package receive access to the 15 Day Forecast.
For example if your API key is authorized for only the 5 Day, and you attempt to request a 15 Day duration, you will get an error stating: ”Access Denied”.
<p>The TWC daily forecast product can contain multiple days of daily forecasts for each location. Each day of a forecast can contain up to (3) "temporal segments" meaning three separate forecasts. For any given forecast day we offer day, night, and a 24-hour forecast (daily summary). Implementing our forecasts requires your applications to perform basic processing in order to properly ingest the forecast data feeds.
The data values in this API are correctly populated into Day, Night, or 24-hour temporal segments. These segments are separate objects in the response.
<p>See the <a target="_blank" href="https://ibm.co/V3DFap">online documentation</a>
for more information about the <strong>The Weather Company APIs for Daily Forecast - (3, 5, 7, 10, 15 Day)</strong>.</p>
<h3>Inputs:</h3>
<dl class="message-properties">
<dt class="optional">msg.twcparams.locationtype <span class="property-type">string</span></dt>
<dd>If specified, override edit panel.</dd>
<dd>"geocode" - Request by Geocode</dd>
<dd>"iataCode" - Request by IATA Airport Code</dd>
<dd>"icaoCode" - Request by ICAO Airport Code</dd>
<dd>"placeid" - Request by Place ID</dd>
<dd>"postalKey" - Request by Postal Key</dd>
<dt class="optional">msg.twcparams.location <span class="property-type">string</span></dt>
<dd>If specified, override edit panel. See examples in the above documentation for geocodes, IATA/ICAO airport codes, Place ID and Postal Keys</dd>
<dt class="optional">msg.twcparams.lang <span class="property-type">string</span></dt>
<dd>If specified, override edit panel. ISO 639-1 standard language codes</dd>
<dt class="optional">msg.twcparams.units <span class="property-type">string</span></dt>
<dd>If specified, override edit panel. 'e' - English units, 'm' - Metric units, 'h' - Hybrid units</dd>
<dt class="optional">msg.twcparams.range <span class="property-type">string</span></dt>
<dd>If specified, override edit panel. '3day', '5day', '7day', '10day', '15day'</dd>
</dl>
<h3>Outputs:</h3>
<dl class="message-properties">
<dt class="optional">msg.payload <span class="property-type">object</span></dt>
<dd>Array of json objects containing weather data elements</dd>
<dd>Find details on the <a target="_blank" href="https://ibm.co/V3DFap">TWC Daily Forecast (3, 5, 7, 10, 15 Day)</a> data elements and definitions.</dd>
<dt class="optional">msg.twcparams <span class="property-type">object</span></dt>
<dd>Array of json objects containing request parameters</dd>
</dl>
</script>