<commit_before>import * as React from 'react';
import './Runway.css';
import 'whatwg-fetch';

import * as jQuery from 'jquery';
import { fabric } from 'fabric';
import { isUndefined } from 'util';

function toRadians (angle) {
    return angle * (Math.PI / 180);
}

function parseOrThrow(value) {
    if (isUndefined(value)) {
        throw Error('API returned invalid response');
    } else {
        return parseInt(value, 10);
    }
}

class Runway extends React.Component {
    render() {
        return (
            <div>
                <canvas className="runway" id="runway" width="346" height="300" />
                <p id="weather">Weather information is loading. Provided by openweatherapi.com</p>
            </div>
        );
    }

    componentDidMount() {

        // TODO : Switch to https://api.darksky.net/forecast/ee9674fddecc28aa06243b405920c521/51.307862,-0.252657?exclude=minutely,hourly,daily,alerts,flags&units=uk2
        var url = 'https://api.openweathermap.org/data/2.5/weather?id=7290639&appid=f244df20990dd7f488afbd527b4803ca&mode=xml&units=imperial';

        fetch(url, {
            method: 'get'
        }).then(response =><commit_msg>Use co-ordinates to avoid bug in openweathermap<commit_after>import * as React from 'react';
import './Runway.css';
import 'whatwg-fetch';

import * as jQuery from 'jquery';
import { fabric } from 'fabric';
import { isUndefined } from 'util';

function toRadians (angle) {
    return angle * (Math.PI / 180);
}

function parseOrThrow(value) {
    if (isUndefined(value)) {
        throw Error('API returned invalid response');
    } else {
        return parseInt(value, 10);
    }
}

class Runway extends React.Component {
    render() {
        return (
            <div>
                <canvas className="runway" id="runway" width="346" height="300" />
                <p id="weather">Weather information is loading. Provided by openweatherapi.com</p>
            </div>
        );
    }

    componentDidMount() {

        var url = 'https://api.openweathermap.org/data/2.5/weather?lat=51.307875&lon=-0.252638&appid=f244df20990dd7f488afbd527b4803ca&mode=xml&units=imperial';

        fetch(url, {
            method: 'get'
        }).then(response =>
{'fraction_non_alphanumeric': 0.13611859838274934, 'fraction_numerical': 0.05480682839173405, 'mean_word_length': 2.7809847198641764, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2169239', 'n_tokens_mistral': 799, 'n_tokens_neox': 706, 'n_words': 152}