{"action":"created","issue":{"url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/30","labels_url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/30/comments","events_url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/30/events","html_url":"https://github.com/zacharyvoase/urlobject/pull/30","id":60276850,"number":30,"title":"Domains support.","user":{"login":"vartagg","id":3600787,"avatar_url":"https://avatars.githubusercontent.com/u/3600787?v=3","gravatar_id":"","url":"https://api.github.com/users/vartagg","html_url":"https://github.com/vartagg","followers_url":"https://api.github.com/users/vartagg/followers","following_url":"https://api.github.com/users/vartagg/following{/other_user}","gists_url":"https://api.github.com/users/vartagg/gists{/gist_id}","starred_url":"https://api.github.com/users/vartagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vartagg/subscriptions","organizations_url":"https://api.github.com/users/vartagg/orgs","repos_url":"https://api.github.com/users/vartagg/repos","events_url":"https://api.github.com/users/vartagg/events{/privacy}","received_events_url":"https://api.github.com/users/vartagg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-08T21:21:14Z","updated_at":"2015-03-09T08:59:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zacharyvoase/urlobject/pulls/30","html_url":"https://github.com/zacharyvoase/urlobject/pull/30","diff_url":"https://github.com/zacharyvoase/urlobject/pull/30.diff","patch_url":"https://github.com/zacharyvoase/urlobject/pull/30.patch"},"body":"Hello.\r\nI added domains support. And written tests for this functionality. I think it would be helpful - to manipulate domains/subdomains of URLs."},"comment":{"url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/comments/77819006","html_url":"https://github.com/zacharyvoase/urlobject/pull/30#issuecomment-77819006","issue_url":"https://api.github.com/repos/zacharyvoase/urlobject/issues/30","id":77819006,"user":{"login":"vartagg","id":3600787,"avatar_url":"https://avatars.githubusercontent.com/u/3600787?v=3","gravatar_id":"","url":"https://api.github.com/users/vartagg","html_url":"https://github.com/vartagg","followers_url":"https://api.github.com/users/vartagg/followers","following_url":"https://api.github.com/users/vartagg/following{/other_user}","gists_url":"https://api.github.com/users/vartagg/gists{/gist_id}","starred_url":"https://api.github.com/users/vartagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vartagg/subscriptions","organizations_url":"https://api.github.com/users/vartagg/orgs","repos_url":"https://api.github.com/users/vartagg/repos","events_url":"https://api.github.com/users/vartagg/events{/privacy}","received_events_url":"https://api.github.com/users/vartagg/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T08:59:37Z","updated_at":"2015-03-09T08:59:37Z","body":"@agriffis Of course :) Sometimes may be need to change domain or subdomain of the URL. For example, for creating a direct link to video/audio. Suppose we have a URL \"http://example.com/video/12345678\", and we need to transform this to the direct link to the video: \"http://video.example.com/file/12345678\". With domains support, we can get this by this way:\r\n`url = URLObject('http://example.com/video/12345678')`\r\n`direct_link = url.add_subdomain('video').with_path('file').add_path(url.path.segments[-1])`\r\nAnother use-cases: if we simply need to get subdomain of current url:\r\n`URLObject(url).subdomain`\r\nOr change high-level domain:\r\n`In: url.with_domain('org', -1)`\r\n`Out: URLObject(u'http://example.org/video/12345678')`"}}