(click to copy to clipboard)",tokenText=n,jsoneditor){const e=jsoneditor.getValue();e.token=n,jsoneditor.mySetValue(e)}const s=JSON.stringify({token:n}),r=JSON.stringify({customerId:e.customerId,token:n}),i=JSON.stringify({customerId:e.customerId,token:n,type:type}),c=JSON.stringify({token:n,placeName:"Nice",latitude:"43.7102",longitude:"7.262",chartWidth:"650",chartHeight:"350"}),a="test"==env?env+"/":"";let l=t?"You already had an existing subscription, with the above token already active.":"You did not have an existing subscription, so one has been created.";l+=' You can manage your subscription (and add or remove payment cards) by clicking on this link.',l+=' Check usage and charges incurred in the current period by clicking on this link.',l+=' You can cancel the subscription at any time by clicking on this link (warning: no confirmation will be requested after clicking the link).',l+=' An example request using your token is here. Also see the dynamic link in the Live Preview section.',document.getElementById("post-checkout-message").innerHTML=l,stripeButton.removeEventListener("click",buttonListenerBefore),stripeButton.addEventListener("click",buttonListenerAfter),stripeButton.addEventListener("mouseup",(function(){this.blur()}))},checkoutSessionHandlerApi=async function(e){if(e.sessionId){const t=await stripe.redirectToCheckout({sessionId:e.sessionId});t.error&&(stripeErrorDiv.textContent=t.error.message)}else e.sessionUrl?window.location.href=e.sessionUrl:e.token&&subscriptionInfoHandler(e,!0)},captchaFailedApi=function(e){stripeErrorDiv.textContent="Failed reCAPTCHA test"},captchaPassedApi=function(e){const t=document.getElementById("api_email").value;if(!t)return void(stripeErrorDiv.textContent="Please provide an email address to proceed");localStorage.setItem("email",t);const n=new XMLHttpRequest,o="https://"+tokensServer+"/createCheckoutSession";n.open("POST",o),n.setRequestHeader("Content-Type","text/plain"),n.onload=function(){if(200===n.status){const e=JSON.parse(n.responseText);e.error?stripeErrorDiv.textContent=e.error.message:checkoutSessionHandlerApi(e)}else console.log("Request failed. Returned status of "+n.status)};const s={env:env,mode:"subscription",type:type,currency:getCurrencyShort(),successUrl:success_url,cancelUrl:cancel_url,email:t};n.send(encodeURI(JSON.stringify(s))),e.preventDefault()},stripeButton=document.getElementById("stripe-button"),buttonListenerBefore=function(e){runCaptchaCheckThen(e,captchaPassedApi,captchaFailedApi)};let tokenText="token is not yet known";const buttonListenerAfter=function(e){const t=navigator.clipboard;null==t?console.log("clipboard is undefined"):t.writeText(tokenText).then((function(){console.log("Copied to clipboard successfully!")}),(function(){console.error("Unable to write to clipboard. :-(")})),e.preventDefault()};stripeButton.addEventListener("click",buttonListenerBefore),stripeButton.addEventListener("mouseup",(function(){this.blur()}));const paramsApi={sessionId:getFromUrl("sessionId"),checkoutType:getFromUrl("checkoutType")};if("subscription"==paramsApi.checkoutType&¶msApi.sessionId&&"cancel"!=paramsApi.sessionId){let e=0;const t=function(){const n=new XMLHttpRequest,o="test"==env?env+"/":"";n.open("GET","https://"+tokensServer+"/getSubscriptionInfo/"+o+paramsApi.sessionId),n.onload=function(){if(200===n.status){const o=JSON.parse(n.responseText);if("NOK"==o.status&&e<2)return e++,void setTimeout(t,2500);subscriptionInfoHandler(o,!1)}else console.log("Request failed. Returned status of "+n.status)},n.send()};setTimeout(t,2500)}
To manage your subscription, including adding or removing payment cards, please refer to the Subscription Management section.
Choose your preferred currency:
Based on the current set of options, the following is the expected maximum "cost" per call, noting that the actual cost would often be less if cached data is available for one or more sources (this does not yet apply when using an API key generated from within the Android app). Further explanation of call charges can be found here.
The customer portal allows you to review or cancel your subscription, view your billing history, and update your card details.
Note: the customer portal does not apply in respect of an API key (starting with "app_") obtained via the Android app, only to an API token (starting with "sub_") obtained via this page.
Enter your API token below and click the button to open the customer portal:
You can also check on your current and recent usage via the following button.
In the related Android app there is a feature which allows you to back up your meteogram settings to the server (in the Backup and Restore section of the settings). Now you can easily load those settings into this page, and even save them back to the server for use in the Android app!
Enter your API key from the app (look in the API Key section of the settings) and slot number (from the Backup and Restore section of the settings), then hit the Load Settings button.
Note that you can also just copy and paste your meteogram settings into the Direct Import section of this page.
api key:
slot number (0 to 15):
tag (used only for Save Settings):
To import options from the related Android app, you can also paste them below and hit the Load Settings button.
Or you can paste in the direct URL that you've been using to generate the meteogram (from the Direct Link section).
After editing your options on this page, you can use the options in the Generated Options section to import back into the Android app... or, even easier, save them to one of the server slots via the Android Import/Export section!
Use the direct link to re-open this page, preserving the schema, value, and options.
Click on the following button to save your settings for future use.
Use the direct link to see the full-size meteogram, and also use that as a basis for your own use in other contexts!
Or click on the following button to generate a shorter direct link, with the full set of options stored on a server and referred to using a unique hash key.
All available options are presented below (click on the arrow icon to expand). As you make changes, this will be reflected in the preview meteogram.
If you require an API token, see the separate panel on this page to obtain one. The demo API token only works for the default location.
Click here to open this page with a few settings changed from their default values, as an example of just how customisable the meteogram is... almost any design is achievable!
These options can be copied and pasted into the "custom options" field at meteograms.com to use the design there.
Or you can copy and paste the options into the related Android app so that you can have a meteogram with the same design as a widget directly on your home screen!
The encoded version of the options can be used directly in a URL without causing problems.
Rather than using the hierarchical editor, you can also make changes to the options by editing the values directly in the text editor below.
Or you can paste raw options here, for example as exported from the related Android app.
After making changes in the editor below, click on the following button to confirm the changes.
This will update whenever the form changes to show validation errors if there are any.
You might also be interested in the DWD API for fetching raw forecast data from the German Weather Service (Deutscher Wetterdienst or DWD).
Donations of any amount are gratefully received and help to support and encourage further development and improvement of the meteogram app and associated resources.
The preferred way of making a donation is to send the money directly to my account, because it involves the lowest bank charges, and there is also a wide choice of payment currencies.
Alternatively, you can donate using the form below, or via my buymeacoffee page. Change the currency (if required) in the separate Currency section further above. Thanks!
Your payment is processed by Stripe (for credit/debit cards) or PayPal. To use PayPal you must first have a PayPal account. Both payment processors use secure encryption to keep your details safe: none of your payment information goes through my server. If you donate I can access your email address but will only use it to send you a one-off personal email of thanks.
You can change the schema by pasting a new version below and then clicking
// Set default options
JSONEditor.defaults.options.theme = 'bootstrap2';
// Initialize the editor
const editor = new JSONEditor(document.getElementById('editor_holder'),{
schema: {
type: 'object',
properties: {
name: { 'type': 'string' }
}
}
});
// Set the value
editor.setValue({
name: 'John Smith'
});
// Get the value
const data = editor.getValue();
console.log(data.name); // 'John Smith'
// Validate
const errors = editor.validate();
if(errors.length) {
// Not valid
}
// Listen for changes
editor.on('change', function() {
// Do something...
});