{"action":"created","comment":{"url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/comments/30996294","id":30996294,"diff_hunk":"@@ -74,5 +75,38 @@ public TimeSpan TimeSinceFetch\n                 return DateTime.Now - FetchedAt;\n             }\n         }\n+\n+        public static async Task<Thing> ParseAsync(Reddit reddit, JToken json, IWebAgent webAgent)\n+        {\n+            var kind = json[\"kind\"].ValueOrDefault<string>();\n+            switch (kind)\n+            {\n+                case \"t1\":\n+                    return  await new Comment().InitAsync(reddit, json, webAgent, null);\n+                case \"t2\":\n+                    return  await new RedditUser().InitAsync(reddit, json, webAgent);\n+                case \"t3\":\n+                    return  await new Post().InitAsync(reddit, json, webAgent);\n+                case \"t4\":\n+                    return  await new PrivateMessage().InitAsync(reddit, json, webAgent);\n+                case \"t5\":\n+                    return await new Subreddit().InitAsync(reddit, json, webAgent);\n+                default:\n+                    return null;\n+            }\n+        }\n+\n+        // if we can't determine the type of thing by \"kind\", try by type\n+        public static async Task<Thing> ParseAsync<T>(Reddit reddit, JToken json, IWebAgent webAgent) where T : Thing\n+        {\n+            Thing result = await ParseAsync(reddit, json, webAgent);\n+            if (result == null)\n+            {\n+                if (typeof(T) == typeof(WikiPageRevision))\n+                {\n+                }\n+            }\n+            return result;\n+        }\n     }","path":"RedditSharp/Things/Thing.cs","position":44,"original_position":44,"commit_id":"6a62af1749255ef5aac422b423979383db57a585","original_commit_id":"6a62af1749255ef5aac422b423979383db57a585","user":{"login":"Aniel","id":4410553,"avatar_url":"https://avatars.githubusercontent.com/u/4410553?v=3","gravatar_id":"","url":"https://api.github.com/users/Aniel","html_url":"https://github.com/Aniel","followers_url":"https://api.github.com/users/Aniel/followers","following_url":"https://api.github.com/users/Aniel/following{/other_user}","gists_url":"https://api.github.com/users/Aniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Aniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aniel/subscriptions","organizations_url":"https://api.github.com/users/Aniel/orgs","repos_url":"https://api.github.com/users/Aniel/repos","events_url":"https://api.github.com/users/Aniel/events{/privacy}","received_events_url":"https://api.github.com/users/Aniel/received_events","type":"User","site_admin":false},"body":"I think. GetSubredditAsync works for me great so far.","created_at":"2015-05-25T22:17:27Z","updated_at":"2015-05-25T22:17:27Z","html_url":"https://github.com/SirCmpwn/RedditSharp/pull/154#discussion_r30996294","pull_request_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154","_links":{"self":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/comments/30996294"},"html":{"href":"https://github.com/SirCmpwn/RedditSharp/pull/154#discussion_r30996294"},"pull_request":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154"}}},"pull_request":{"url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154","id":36107645,"html_url":"https://github.com/SirCmpwn/RedditSharp/pull/154","diff_url":"https://github.com/SirCmpwn/RedditSharp/pull/154.diff","patch_url":"https://github.com/SirCmpwn/RedditSharp/pull/154.patch","issue_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/154","number":154,"state":"open","locked":false,"title":"Added a little Async Magic","user":{"login":"Aniel","id":4410553,"avatar_url":"https://avatars.githubusercontent.com/u/4410553?v=3","gravatar_id":"","url":"https://api.github.com/users/Aniel","html_url":"https://github.com/Aniel","followers_url":"https://api.github.com/users/Aniel/followers","following_url":"https://api.github.com/users/Aniel/following{/other_user}","gists_url":"https://api.github.com/users/Aniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Aniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aniel/subscriptions","organizations_url":"https://api.github.com/users/Aniel/orgs","repos_url":"https://api.github.com/users/Aniel/repos","events_url":"https://api.github.com/users/Aniel/events{/privacy}","received_events_url":"https://api.github.com/users/Aniel/received_events","type":"User","site_admin":false},"body":"GetSubreddit Async","created_at":"2015-05-24T20:05:20Z","updated_at":"2015-05-25T22:17:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d38bae121527d485139d9418e870c64a051302c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154/commits","review_comments_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154/comments","review_comment_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/154/comments","statuses_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/statuses/6a62af1749255ef5aac422b423979383db57a585","head":{"label":"Aniel:master","ref":"master","sha":"6a62af1749255ef5aac422b423979383db57a585","user":{"login":"Aniel","id":4410553,"avatar_url":"https://avatars.githubusercontent.com/u/4410553?v=3","gravatar_id":"","url":"https://api.github.com/users/Aniel","html_url":"https://github.com/Aniel","followers_url":"https://api.github.com/users/Aniel/followers","following_url":"https://api.github.com/users/Aniel/following{/other_user}","gists_url":"https://api.github.com/users/Aniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Aniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aniel/subscriptions","organizations_url":"https://api.github.com/users/Aniel/orgs","repos_url":"https://api.github.com/users/Aniel/repos","events_url":"https://api.github.com/users/Aniel/events{/privacy}","received_events_url":"https://api.github.com/users/Aniel/received_events","type":"User","site_admin":false},"repo":{"id":36173780,"name":"RedditSharp","full_name":"Aniel/RedditSharp","owner":{"login":"Aniel","id":4410553,"avatar_url":"https://avatars.githubusercontent.com/u/4410553?v=3","gravatar_id":"","url":"https://api.github.com/users/Aniel","html_url":"https://github.com/Aniel","followers_url":"https://api.github.com/users/Aniel/followers","following_url":"https://api.github.com/users/Aniel/following{/other_user}","gists_url":"https://api.github.com/users/Aniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Aniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aniel/subscriptions","organizations_url":"https://api.github.com/users/Aniel/orgs","repos_url":"https://api.github.com/users/Aniel/repos","events_url":"https://api.github.com/users/Aniel/events{/privacy}","received_events_url":"https://api.github.com/users/Aniel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aniel/RedditSharp","description":"Reddit API for .NET","fork":true,"url":"https://api.github.com/repos/Aniel/RedditSharp","forks_url":"https://api.github.com/repos/Aniel/RedditSharp/forks","keys_url":"https://api.github.com/repos/Aniel/RedditSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aniel/RedditSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aniel/RedditSharp/teams","hooks_url":"https://api.github.com/repos/Aniel/RedditSharp/hooks","issue_events_url":"https://api.github.com/repos/Aniel/RedditSharp/issues/events{/number}","events_url":"https://api.github.com/repos/Aniel/RedditSharp/events","assignees_url":"https://api.github.com/repos/Aniel/RedditSharp/assignees{/user}","branches_url":"https://api.github.com/repos/Aniel/RedditSharp/branches{/branch}","tags_url":"https://api.github.com/repos/Aniel/RedditSharp/tags","blobs_url":"https://api.github.com/repos/Aniel/RedditSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aniel/RedditSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aniel/RedditSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aniel/RedditSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aniel/RedditSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/Aniel/RedditSharp/languages","stargazers_url":"https://api.github.com/repos/Aniel/RedditSharp/stargazers","contributors_url":"https://api.github.com/repos/Aniel/RedditSharp/contributors","subscribers_url":"https://api.github.com/repos/Aniel/RedditSharp/subscribers","subscription_url":"https://api.github.com/repos/Aniel/RedditSharp/subscription","commits_url":"https://api.github.com/repos/Aniel/RedditSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aniel/RedditSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aniel/RedditSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aniel/RedditSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aniel/RedditSharp/contents/{+path}","compare_url":"https://api.github.com/repos/Aniel/RedditSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aniel/RedditSharp/merges","archive_url":"https://api.github.com/repos/Aniel/RedditSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aniel/RedditSharp/downloads","issues_url":"https://api.github.com/repos/Aniel/RedditSharp/issues{/number}","pulls_url":"https://api.github.com/repos/Aniel/RedditSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/Aniel/RedditSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/Aniel/RedditSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aniel/RedditSharp/labels{/name}","releases_url":"https://api.github.com/repos/Aniel/RedditSharp/releases{/id}","created_at":"2015-05-24T13:34:45Z","updated_at":"2015-05-24T13:34:47Z","pushed_at":"2015-05-24T13:43:05Z","git_url":"git://github.com/Aniel/RedditSharp.git","ssh_url":"git@github.com:Aniel/RedditSharp.git","clone_url":"https://github.com/Aniel/RedditSharp.git","svn_url":"https://github.com/Aniel/RedditSharp","homepage":"","size":2173,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SirCmpwn:master","ref":"master","sha":"3546f43087f7e666f74f6bdb7cf6b4c67db598e5","user":{"login":"SirCmpwn","id":1310872,"avatar_url":"https://avatars.githubusercontent.com/u/1310872?v=3","gravatar_id":"","url":"https://api.github.com/users/SirCmpwn","html_url":"https://github.com/SirCmpwn","followers_url":"https://api.github.com/users/SirCmpwn/followers","following_url":"https://api.github.com/users/SirCmpwn/following{/other_user}","gists_url":"https://api.github.com/users/SirCmpwn/gists{/gist_id}","starred_url":"https://api.github.com/users/SirCmpwn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirCmpwn/subscriptions","organizations_url":"https://api.github.com/users/SirCmpwn/orgs","repos_url":"https://api.github.com/users/SirCmpwn/repos","events_url":"https://api.github.com/users/SirCmpwn/events{/privacy}","received_events_url":"https://api.github.com/users/SirCmpwn/received_events","type":"User","site_admin":false},"repo":{"id":6785228,"name":"RedditSharp","full_name":"SirCmpwn/RedditSharp","owner":{"login":"SirCmpwn","id":1310872,"avatar_url":"https://avatars.githubusercontent.com/u/1310872?v=3","gravatar_id":"","url":"https://api.github.com/users/SirCmpwn","html_url":"https://github.com/SirCmpwn","followers_url":"https://api.github.com/users/SirCmpwn/followers","following_url":"https://api.github.com/users/SirCmpwn/following{/other_user}","gists_url":"https://api.github.com/users/SirCmpwn/gists{/gist_id}","starred_url":"https://api.github.com/users/SirCmpwn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirCmpwn/subscriptions","organizations_url":"https://api.github.com/users/SirCmpwn/orgs","repos_url":"https://api.github.com/users/SirCmpwn/repos","events_url":"https://api.github.com/users/SirCmpwn/events{/privacy}","received_events_url":"https://api.github.com/users/SirCmpwn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SirCmpwn/RedditSharp","description":"Reddit API for .NET","fork":false,"url":"https://api.github.com/repos/SirCmpwn/RedditSharp","forks_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/forks","keys_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/teams","hooks_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/hooks","issue_events_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/events{/number}","events_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/events","assignees_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/assignees{/user}","branches_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/branches{/branch}","tags_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/tags","blobs_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/statuses/{sha}","languages_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/languages","stargazers_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/stargazers","contributors_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/contributors","subscribers_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/subscribers","subscription_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/subscription","commits_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/contents/{+path}","compare_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/merges","archive_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/downloads","issues_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues{/number}","pulls_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls{/number}","milestones_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/milestones{/number}","notifications_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/labels{/name}","releases_url":"https://api.github.com/repos/SirCmpwn/RedditSharp/releases{/id}","created_at":"2012-11-20T21:10:07Z","updated_at":"2015-05-25T03:21:36Z","pushed_at":"2015-05-24T20:05:20Z","git_url":"git://github.com/SirCmpwn/RedditSharp.git","ssh_url":"git@github.com:SirCmpwn/RedditSharp.git","clone_url":"https://github.com/SirCmpwn/RedditSharp.git","svn_url":"https://github.com/SirCmpwn/RedditSharp","homepage":"","size":2173,"stargazers_count":192,"watchers_count":192,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":12,"forks":107,"open_issues":12,"watchers":192,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154"},"html":{"href":"https://github.com/SirCmpwn/RedditSharp/pull/154"},"issue":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/154"},"comments":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/issues/154/comments"},"review_comments":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154/comments"},"review_comment":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/pulls/154/commits"},"statuses":{"href":"https://api.github.com/repos/SirCmpwn/RedditSharp/statuses/6a62af1749255ef5aac422b423979383db57a585"}}}}