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); }
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); }
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)); }