<commit_before>﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="<NAME>">
//   Copyright 2014 <NAME>
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//   
//       http://www.apache.org/licenses/LICENSE-2.0
//   
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Messenger.Console
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Threading.Tasks;

    using Messenger.Models;

    internal class Program
    {
        private static void Main(string[] args)
        {
            DefineMy();

            var fromFile = File.ReadAllLines("input.inp").Where(_ => !_.StartsWith("#"));
            var enumerable = fromFile as IList<string> ?? fromFile.ToList();

            var phoneNumbers = enumerable.Where(_ => _.StartsWith("+")).ToList();
            var emailRecipients = enumerable.Where(_ => _.Contains("@")).Where(_ => !string.IsNullOrWhiteSpace(_));

            var emails =
                emailRecipients.Select(
                    _ =>
                    new TransferRequest
                    {
                        FinalProtocol = TransferRequestProtocol.Email, 
                        FinalTo = _, 
                        Payload = @"This is my ap for the 2014 fall Jackobshack hackathon. 
                        I think azure is cool and to think I can send messages in the cloud for free is amazing. 
                        I highly recommend http://azure.microsoft.com/. 
                        All the code for my project is released under the apache2 license(http://www.apache.org/licenses/LICENSE-2.0.html) and can be found at https://github.com/oziegamma. 
                        If you are ever interested in a project / creating a company contact me at <EMAIL>, I'm always up for a geeky adventure. 
                        I hope you all had a nice day. I had a lot of fun playing with VM-farms", 
                        RedPill = MyRandom.RedPill(100, 5000), 
                        ShouldStamp = true, 
                        Trace = new List<string>()
                    });
            var smses =
                phoneNumbers.Select(
                    _ =>
                    new TransferRequest
                    {
                        FinalProtocol = TransferRequestProtocol.Sms, 
                        FinalTo = _, 
                        Payload =
                            @"OzieGamma's App for Jackobshack 2014. Let's keep in touch at <EMAIL>", 
                        RedPill = MyRandom.RedPill(2, 2), 
                        ShouldStamp = false, 
                        Trace = new List<string>()
                    });

            var phoneCalls =
                phoneNumbers.Select(
                    _ =>
                    new TransferRequest
                    {
                        FinalProtocol = TransferRequestProtocol.Call, 
                        FinalTo = _, 
                        Payload =
                            @"Hey there, this is oswald maskens, I'm calling to tell you this is my App for Jackobshack 2014. 
                            I hope you had a good time, I certainly did. Don't hesitate to contact me if you have a cool project ! 
                            The easiest way to reach me is email: <EMAIL>. 
                            You can also find me on Facebook, GitHub, Stackoverflow and LinkedIn.", 
                        RedPill = MyRandom.RedPill(2, 2), 
                        ShouldStamp = false, 
                        Trace = new List<string>()
                    });

            var transfers = new List<TransferRequest>(emails.ToList());
            transfers.AddRange(smses);
            transfers.AddRange(phoneCalls);

            Parallel.ForEach(transfers, _ => new TransferClient().Transfer(_));

            Console.Read();
        }

        private static void DefineMy()
        {
            My.Name = "LOCAL";<commit_msg>modified program to sign off this project !<commit_after>﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="<NAME>">
//   Copyright 2014 <NAME>
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//   
//       http://www.apache.org/licenses/LICENSE-2.0
//   
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Messenger.Console
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;

    using Messenger.Models;

    internal class Program
    {
        private static void Main(string[] args)
        {
            DefineMy();

            var recipients = new string[0]; // define who will recieve your message

            var transfers =
                recipients.Select(
                    _ =>
                    new TransferRequest
                    {
                        FinalProtocol = TransferRequestProtocol.Email, 
                        FinalTo = _, 
                        Payload = @"Lorem ipsum", // define your message 
                        RedPill = MyRandom.RedPill(100, 5000), 
                        ShouldStamp = true, 
                        Trace = new List<string>()
                    });

            // Run it !!!
            Parallel.ForEach(transfers, SendRequest);

            Console.Read();
        }

        private static void DefineMy()
        {
            My.Name = "LOCAL";
{'fraction_non_alphanumeric': 0.14756061059563005, 'fraction_numerical': 0.0074827895839568994, 'mean_word_length': 1.2388609715242882, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 29, 'https://': 1, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7030320', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1413, 'n_words': 511}