YouTube playlist exporter

 

The point here is about how simple is in our days to make a simple script as a programmer.

I wanted to export my playlists ( 5 minutes .NET , Export Word Exce l PDF  , EF 6 , Traceability ) videos into a simple HTML file that I could put into my website.

I searched first on internet – however, I found just you tube google api .

So I read the documentation (e.g. https://developers.google.com/youtube/v3/docs/videos/list)  , grab a developer key from https://console.developers.google.com/ and made a simple project.

Used also a NuGet package for JSON( Newtonsoft.Json) and one for export in Excel /Word /HTML / PDF /ODS (ExporterWordExcelPDF).

Total time : 2 hours. You can find the project here https://github.com/ignatandrei/YouTube . It has only console application  – but it will have soon a GUI .

The point is that in our days it is easy to use third party application – and , for a programmer, easy as pie( eating, not making ; – ) )

Javascript patterns

In our days Javascript appears to conquer all . So I have decided to read a book about patterns in Javascript. And I definitely recommend this book: it is good written and full of practical details. It is a must read for anyone to unleash their javascript programming potential.

Non (Coding Standards)

 

What do you say when you see this code?

 
Console.WriteLine(((ThirdEnum)(new Task<string>(() => 
{ 
    return ((FirstEnum)((Func<string>)(() => 
    { 
        return "Hello World"; 
    })).Invoke().Invoke()).Invoke(); 
})).Await().ContinueWith((@string) => 
{ 
    return ((SecondEnum)(@string.ContinueWith((@return) => 
    { 
        return ((FirstEnum)(@return.Result.Invoke() + 3)).Invoke(); 
    }).Result.Invoke())).Invoke(); 
}).GetAwaiter().GetResult().Invoke()));

Console.ReadKey();
 
namespace ConfusingCode
{
    public static class Things
    {
        public static int Invoke(this string invokedItem)
        {
            lock (Program.key)
            {
                Console.Write(invokedItem.Length == 1 ? invokedItem + (invokedItem == ((SecondEnum)invokedItem.Length - 1).Invoke() ? invokedItem : "") : "");
            }
            return invokedItem.Length > 0 ? 0 : 0;
        }
        public static Task<string> Await(this Task<string> taskToAwait)
        {
            taskToAwait.Start();
            return taskToAwait;
        }
        public static string Invoke(this FirstEnum val)
        {
            return ((Enum)val).Invoke();
        }
        public static string Invoke(this SecondEnum val)
        {
            return ((Enum)val).Invoke();
        }
        public static string Invoke(this ThirdEnum val)
        {
            return ((Enum)val).Invoke();
        }
        public static string Invoke(this Enum @enum)
        {
            return @enum.ToString();
        }
    }
    public enum FirstEnum
    {
        P = 0,
        I = 3,
    }
    public enum SecondEnum
    {
        Z = 0,        
    }
    public enum ThirdEnum
    {
        A = 0
    }
}

And what should be added to the coding standards in order to not permit this … code ?
( Credits to Stefan Petrini for the code )