<commit_before>﻿using System.Text.RegularExpressions;

using CwIRC;

using Bitly;

namespace MoronBot.Functions.GitHub
{
    class LastCommit : Function
    {
        public LastCommit(MoronBot moronBot)
        {
            Name = GetName();
            Help = "(last)commit/(last)change <url>\t\t- Gives you a shortened version of a url, via bit.ly";
            Type = Types.Command;
            AccessLevel = AccessLevels.Anyone;
        }
        
        public override void GetResponse(BotMessage message, MoronBot moronBot)
        {
            if (Regex.IsMatch(message.Command, "^((last)?(commit|change))$", RegexOptions.IgnoreCase))
            {
                Utilities.URL.WebPage commitFeed = Utilities.URL.FetchURL("https://github.com/Tyranic-Moron/MoronBot/commits/master.atom");

                MatchCollection commitMessages = Regex.Matches(commitFeed.Page, @"width:81ex'>(.+)?\&lt;/pre>", RegexOptions.IgnoreCase);
                moronBot.MessageQueue.Add(new IRCResponse(ResponseType.Say, "Last Commit: " + commitMessages[0].Groups[1].Value.Replace("\n", " | "), message.ReplyTo));

            }
            else
            {
                return;
            }
        }

        public void FetchCommit(string url)
        {
        }
    }
}<commit_msg>Edited channel message slightly.<commit_after>﻿using System.Text.RegularExpressions;

using CwIRC;

using Bitly;

namespace MoronBot.Functions.GitHub
{
    class LastCommit : Function
    {
        public LastCommit(MoronBot moronBot)
        {
            Name = GetName();
            Help = "(last)commit/(last)change <url>\t\t- Gives you a shortened version of a url, via bit.ly";
            Type = Types.Command;
            AccessLevel = AccessLevels.Anyone;
        }
        
        public override void GetResponse(BotMessage message, MoronBot moronBot)
        {
            if (Regex.IsMatch(message.Command, "^((last)?(commit|change))$", RegexOptions.IgnoreCase))
            {
                Utilities.URL.WebPage commitFeed = Utilities.URL.FetchURL("https://github.com/Tyranic-Moron/MoronBot/commits/master.atom");

                MatchCollection commitMessages = Regex.Matches(commitFeed.Page, @"width:81ex'>(.+)?\&lt;/pre>", RegexOptions.IgnoreCase);
                moronBot.MessageQueue.Add(new IRCResponse(ResponseType.Say, "Last Commit Message: " + commitMessages[0].Groups[1].Value.Replace("\n", " | "), message.ReplyTo));

            }
            else
            {
                return;
            }
        }

        public void FetchCommit(string url)
        {
        }
    }
}
{'fraction_non_alphanumeric': 0.12110726643598616, 'fraction_numerical': 0.0030757400999615533, 'mean_word_length': 2.1274038461538463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '5275144', 'n_tokens_mistral': 784, 'n_tokens_neox': 746, 'n_words': 132}