<commit_before>﻿using Newtonsoft.Json;
using Pegelalarm.Core.Network.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.Geolocation;
using Windows.Foundation;

namespace Pegelalarm.Core.Network
{
    public class WebService
    {
        private const string SERVER = "http://api.pegelalarm.at/api/";
        private const string LIST_ENDPOINT = "station/1.0/list?";
        private const string HISTORY_ENDPOINT = "";

        public async Task<Response<Station[]>> GetStationsBy(GeoboundingBox boundingBox = null, string nameFilter = null)
        {
            var uri = SERVER + LIST_ENDPOINT;

            if (boundingBox != null) uri += string.Format("bBoxLon1={0}&bBoxLat1={1}&bBoxLon2={2}&bBoxLat2={3}&", boundingBox.NorthwestCorner.Longitude, boundingBox.NorthwestCorner.Latitude, boundingBox.SoutheastCorner.Longitude, boundingBox.SoutheastCorner.Latitude);
            if (!string.IsNullOrWhiteSpace(nameFilter)) uri += string.Format("q={0}", nameFilter);

            var obj = await GetJsonUri<ListResponse>(uri);

            return new Response<Station[]>
            {
                Payload = obj.Item1.payload.stations,
                StatusCode = obj.Item2
            };
        }

        private async Task<Tuple<T,HttpStatusCode>> GetJsonUri<T>(string uri)
        {
            var res = await (new HttpClient().GetAsync(uri));
            Debug.WriteLine("API > Request " + uri);
            var str = await res.Content.ReadAsStringAsync();
            var obj = JsonConvert.DeserializeObject<T>(str);
            Debug.WriteLine("API > Response: " + res.StatusCode);
            return new Tuple<T, HttpStatusCode>(obj, res.StatusCode);
        }

    }
}
<commit_msg>MOD rem URL<commit_after>﻿using Newtonsoft.Json;
using Pegelalarm.Core.Network.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.Geolocation;
using Windows.Foundation;

namespace Pegelalarm.Core.Network
{
    public class WebService
    {

        /// <summary>
        /// Please visit pegelalarm.at to get this url
        /// </summary>
        private const string SERVER = "...";
        private const string LIST_ENDPOINT = "station/1.0/list?";
        private const string HISTORY_ENDPOINT = "";

        public async Task<Response<Station[]>> GetStationsBy(GeoboundingBox boundingBox = null, string nameFilter = null)
        {
            var uri = SERVER + LIST_ENDPOINT;

            if (boundingBox != null) uri += string.Format("bBoxLon1={0}&bBoxLat1={1}&bBoxLon2={2}&bBoxLat2={3}&", boundingBox.NorthwestCorner.Longitude, boundingBox.NorthwestCorner.Latitude, boundingBox.SoutheastCorner.Longitude, boundingBox.SoutheastCorner.Latitude);
            if (!string.IsNullOrWhiteSpace(nameFilter)) uri += string.Format("q={0}", nameFilter);

            var obj = await GetJsonUri<ListResponse>(uri);

            return new Response<Station[]>
            {
                Payload = obj.Item1.payload.stations,
                StatusCode = obj.Item2
            };
        }

        private async Task<Tuple<T,HttpStatusCode>> GetJsonUri<T>(string uri)
        {
            var res = await (new HttpClient().GetAsync(uri));
            Debug.WriteLine("API > Request " + uri);
            var str = await res.Content.ReadAsStringAsync();
            var obj = JsonConvert.DeserializeObject<T>(str);
            Debug.WriteLine("API > Response: " + res.StatusCode);
            return new Tuple<T, HttpStatusCode>(obj, res.StatusCode);
        }

    }
}

{'fraction_non_alphanumeric': 0.11651254953764861, 'fraction_numerical': 0.006869220607661823, 'mean_word_length': 2.816532258064516, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6098357', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1085, 'n_words': 228}