Exemple #1
0
        public MainWindowViewModel()
        {
            baseUrl     = "https://pt.potawe.com/api/video-promotion/v1/list";
            ApiHelper   = new ApiHelper(baseUrl);
            FileHandler = new FileHandler();
            IPGetter    = new IPGetter();
            DataToShow  = new ObservableCollection <Display>();
            var url = GetUrl();

            VideoProcessor = new VideoProcessor(ApiHelper, url);
        }
Exemple #2
0
        private string GetUrl()
        {
            try
            {
                textData = FileHandler.ReadFromFile();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(baseUrl);
            }
            UserName  = textData[0];
            API_KEY   = textData[1];
            IPAddress = IPGetter.GetIpOfHost();
            var url = $"{baseUrl}?psid={UserName}&accessKey={API_KEY}&clientIp={IPAddress}&limit=25";

            return(url);
        }
Exemple #3
0
        static int Main(string[] args)
        {
            var rootApp = new CommandLineApplication()
            {
                Name = "IP getter"
            };

            rootApp.Command("ip", app =>
            {
                app.OnExecute(() =>
                {
                    IPGetter ipget = new IPGetter("https://ifconfig.me");
                    Console.WriteLine($"your public ip : {ipget.GetPublicIP()}");
                });
            });

            return(rootApp.Execute(args));
        }