<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Net;
using System.IO.Ports;

namespace CricketScores
{
    class Program
    {
        static void Main(string[] args)
        {
            Regex country = new Regex("<title>.*Australia.*</title>");
            Regex wickets = new Regex("/(?<wickets>[0-9]{1,2})");

            using (SerialPort serial = new SerialPort("COM5", 38400))
            {
                serial.Open();

                string prevWickets = string.Empty;

                using (WebClient wc = new WebClient())
                {
                    string html = wc.DownloadString("http://static.cricinfo.com/rss/livescores.xml");

                    var countryMatch = country.Match(html);
                    if (countryMatch.Success)
                    {
                        var wicketsMatch = wickets.Matches(countryMatch.Value);
                        string wicketsStr = string.Join(",", wicketsMatch.Cast<Match>().Select(m => m.Groups[1].Value));
                        Console.WriteLine(wicketsStr);

                        if (serial.IsOpen && wicketsStr != prevWickets)
                        {
                            prevWickets = wicketsStr;
                            serial.Write(new byte[] { 0x77 }, 0, 1);
                        }
                    }
                }
            }
        }
    }
}<commit_msg>Add loop<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Net;
using System.IO.Ports;

namespace CricketScores
{
    class Program
    {
        static void Main(string[] args)
        {
            Regex country = new Regex("<title>.*Australia.*</title>");
            Regex wickets = new Regex("/(?<wickets>[0-9]{1,2})");

            using (SerialPort serial = new SerialPort("COM5", 38400))
            {
                serial.Open();

                string prevWickets = string.Empty;

                using (WebClient wc = new WebClient())
                {
                    while (true)
                    {
                        string html = wc.DownloadString("http://static.cricinfo.com/rss/livescores.xml");

                        var countryMatch = country.Match(html);
                        if (countryMatch.Success)
                        {
                            var wicketsMatch = wickets.Matches(countryMatch.Value);
                            string wicketsStr = string.Join(",", wicketsMatch.Cast<Match>().Select(m => m.Groups[1].Value));
                            Console.WriteLine(wicketsStr);

                            if (serial.IsOpen && wicketsStr != prevWickets)
                            {
                                prevWickets = wicketsStr;
                                serial.Write(new byte[] { 0x77 }, 0, 1);
                            }
                        }

                        System.Threading.Thread.Sleep(60 * 1000);
                    }
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.10875662200062325, 'fraction_numerical': 0.011841695232159551, 'mean_word_length': 1.3010752688172043, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5653833', 'n_tokens_mistral': 863, 'n_tokens_neox': 787, 'n_words': 155}