Beispiel #1
0
        public IsGd(string url)
        {
            Validation.IsUrl(url, Message.MessageUrlIsInvalid);
            Url = new Uri(url);

            Client  = WebClientFactory.Create();
            Address = string.Format(address, url);

            Provider = new Provider("is.gd", new Uri("http://is.gd/"));
        }
Beispiel #2
0
        public MigreMe(string url)
        {
            Validation.IsUrl(url, Message.MessageUrlIsInvalid);
            Url = new Uri(url);

            Client  = WebClientFactory.Create();
            Address = string.Format(address, url);

            Provider = new Provider("migre.me", new Uri("http://migre.me/"));
        }
Beispiel #3
0
        public TinyUrl(string url)
        {
            Validation.IsUrl(url, Message.MessageUrlIsInvalid);
            Url = new Uri(url);

            Client  = WebClientFactory.Create();
            Address = string.Format(address, url);

            Provider = new Provider("tinyurl", new Uri("http://tinyurl.com"));
        }
Beispiel #4
0
        private void loadVariable(string key, string url)
        {
            Url = new Uri(url, UriKind.RelativeOrAbsolute);
            Key = key;

            WebHeaderCollection Headers = new WebHeaderCollection();

            Headers.Add(HttpRequestHeader.ContentType, "application/json");
            Headers.Add("x-api-key", Key);
            Client = WebClientFactory.Create(Headers);

            Address  = address;
            Provider = new Provider("tr.im", new Uri("https://tr.im/"));
        }
Beispiel #5
0
        public Bitly(string token, string url)
        {
            Validation.IsNotNull(token, Message.MessageKeyIsEmpty);
            Validation.IsUrl(url, Message.MessageUrlIsInvalid);

            Url   = new Uri(url);
            Token = token;

            WebHeaderCollection Headers = new WebHeaderCollection();

            Headers.Add("token", token);
            Client = WebClientFactory.Create(Headers);

            Address  = string.Format(address, token, url);
            Provider = new Provider("bitly", new Uri("https://bitly.com/"));
        }
Beispiel #6
0
        public Googl(string key, string url)
        {
            Validation.IsUrl(url, Message.MessageUrlIsInvalid);
            Validation.IsNullOrEmpty(key, Message.MessageKeyIsEmpty);

            Send   = new ShortUrlSendGoogl(url);
            Url    = new Uri(url, UriKind.RelativeOrAbsolute);
            ApiKey = key;

            WebHeaderCollection Headers = new WebHeaderCollection();

            Headers.Add(HttpRequestHeader.ContentType, "application/json");
            Headers.Add("key", ApiKey);
            Client = WebClientFactory.Create(Headers);

            Address  = string.Format(address, ApiKey);
            Provider = new Provider("goo.gl", new Uri("https://www.googleapis.com/"));
        }