{"action":"created","comment":{"url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/comments/22769165","id":22769165,"diff_hunk":"@@ -0,0 +1,35 @@\n+//\n+//  ReadMeViewModel.swift\n+//  BlargBucket\n+//\n+//  Created by Nick Smillie on 12/23/14.\n+//  Copyright (c) 2014 Luke Deniston. All rights reserved.\n+//\n+\n+import Foundation\n+\n+class ReadMeViewModel: NSObject {\n+\t\n+\tdynamic var readMeMarkDown: String?\n+\tvar readMeAttributed: NSAttributedString?\n+\tlet repo = AppDelegate.sharedInstance().activeRepo\n+\t\n+\t/**\n+\tStart fetching the readme as soon as the view model is created\n+\t*/\n+\toverride init(){\n+\t\tsuper.init()\n+\t\tDataFetcher.fetchReadMe(repo!) {self.readMeMarkDown = $0}\n+\t}\n+\t\n+\t/**\n+\tParse readme in markdown to HTML, then set it up as an attributed string\n+\t*/\n+\tfunc setAttributedString() {\n+\t\tlet readMeHTML = (MMMarkdown.HTMLStringWithMarkdown(self.readMeMarkDown, error: nil))\n+\t\tlet encodedData = readMeHTML.dataUsingEncoding(NSUTF8StringEncoding)\n+\t\tlet attributedOptions = [NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType]\n+\t\tself.readMeAttributed = NSAttributedString(data: encodedData!, options: attributedOptions, documentAttributes: nil, error: nil)","path":"BlargBucket/ViewModels/ReadMeViewModel.swift","position":32,"original_position":32,"commit_id":"a192426060a2accf2297f8acd3535b9d835eb52a","original_commit_id":"a192426060a2accf2297f8acd3535b9d835eb52a","user":{"login":"luketheobscure","id":1163812,"avatar_url":"https://avatars.githubusercontent.com/u/1163812?v=3","gravatar_id":"","url":"https://api.github.com/users/luketheobscure","html_url":"https://github.com/luketheobscure","followers_url":"https://api.github.com/users/luketheobscure/followers","following_url":"https://api.github.com/users/luketheobscure/following{/other_user}","gists_url":"https://api.github.com/users/luketheobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/luketheobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luketheobscure/subscriptions","organizations_url":"https://api.github.com/users/luketheobscure/orgs","repos_url":"https://api.github.com/users/luketheobscure/repos","events_url":"https://api.github.com/users/luketheobscure/events{/privacy}","received_events_url":"https://api.github.com/users/luketheobscure/received_events","type":"User","site_admin":false},"body":"Please add some error handling.","created_at":"2015-01-11T19:24:09Z","updated_at":"2015-01-11T19:24:09Z","html_url":"https://github.com/luketheobscure/BlargBucket/pull/20#discussion_r22769165","pull_request_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/comments/22769165"},"html":{"href":"https://github.com/luketheobscure/BlargBucket/pull/20#discussion_r22769165"},"pull_request":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20","id":27166459,"html_url":"https://github.com/luketheobscure/BlargBucket/pull/20","diff_url":"https://github.com/luketheobscure/BlargBucket/pull/20.diff","patch_url":"https://github.com/luketheobscure/BlargBucket/pull/20.patch","issue_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/20","number":20,"state":"open","locked":false,"title":"Add ability to view Read Me #5","user":{"login":"Maldron","id":9958219,"avatar_url":"https://avatars.githubusercontent.com/u/9958219?v=3","gravatar_id":"","url":"https://api.github.com/users/Maldron","html_url":"https://github.com/Maldron","followers_url":"https://api.github.com/users/Maldron/followers","following_url":"https://api.github.com/users/Maldron/following{/other_user}","gists_url":"https://api.github.com/users/Maldron/gists{/gist_id}","starred_url":"https://api.github.com/users/Maldron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maldron/subscriptions","organizations_url":"https://api.github.com/users/Maldron/orgs","repos_url":"https://api.github.com/users/Maldron/repos","events_url":"https://api.github.com/users/Maldron/events{/privacy}","received_events_url":"https://api.github.com/users/Maldron/received_events","type":"User","site_admin":false},"body":"Couple notes for trying out the ReadMes in some of our repos:\r\n* Alpaca's first section looks a little gross, but if you view the ReadMe online, you'll see that it's invalid markdown\r\n* Both mobile repositories have no ReadMe (their stuff is in the wiki for some reason), so you won't get anything back from them. There's some really basic error handling in place to let you know what happened right now; might be something we want to revisit and prettify.","created_at":"2015-01-11T18:48:18Z","updated_at":"2015-01-11T19:24:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aab01f797d1cbffcb95fa7fbc5fa2cfe850cf326","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20/commits","review_comments_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20/comments","review_comment_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/comments/{number}","comments_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/20/comments","statuses_url":"https://api.github.com/repos/luketheobscure/BlargBucket/statuses/a192426060a2accf2297f8acd3535b9d835eb52a","head":{"label":"luketheobscure:ability-to-view-readme","ref":"ability-to-view-readme","sha":"a192426060a2accf2297f8acd3535b9d835eb52a","user":{"login":"luketheobscure","id":1163812,"avatar_url":"https://avatars.githubusercontent.com/u/1163812?v=3","gravatar_id":"","url":"https://api.github.com/users/luketheobscure","html_url":"https://github.com/luketheobscure","followers_url":"https://api.github.com/users/luketheobscure/followers","following_url":"https://api.github.com/users/luketheobscure/following{/other_user}","gists_url":"https://api.github.com/users/luketheobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/luketheobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luketheobscure/subscriptions","organizations_url":"https://api.github.com/users/luketheobscure/orgs","repos_url":"https://api.github.com/users/luketheobscure/repos","events_url":"https://api.github.com/users/luketheobscure/events{/privacy}","received_events_url":"https://api.github.com/users/luketheobscure/received_events","type":"User","site_admin":false},"repo":{"id":27160850,"name":"BlargBucket","full_name":"luketheobscure/BlargBucket","owner":{"login":"luketheobscure","id":1163812,"avatar_url":"https://avatars.githubusercontent.com/u/1163812?v=3","gravatar_id":"","url":"https://api.github.com/users/luketheobscure","html_url":"https://github.com/luketheobscure","followers_url":"https://api.github.com/users/luketheobscure/followers","following_url":"https://api.github.com/users/luketheobscure/following{/other_user}","gists_url":"https://api.github.com/users/luketheobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/luketheobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luketheobscure/subscriptions","organizations_url":"https://api.github.com/users/luketheobscure/orgs","repos_url":"https://api.github.com/users/luketheobscure/repos","events_url":"https://api.github.com/users/luketheobscure/events{/privacy}","received_events_url":"https://api.github.com/users/luketheobscure/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luketheobscure/BlargBucket","description":"","fork":false,"url":"https://api.github.com/repos/luketheobscure/BlargBucket","forks_url":"https://api.github.com/repos/luketheobscure/BlargBucket/forks","keys_url":"https://api.github.com/repos/luketheobscure/BlargBucket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luketheobscure/BlargBucket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luketheobscure/BlargBucket/teams","hooks_url":"https://api.github.com/repos/luketheobscure/BlargBucket/hooks","issue_events_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/events{/number}","events_url":"https://api.github.com/repos/luketheobscure/BlargBucket/events","assignees_url":"https://api.github.com/repos/luketheobscure/BlargBucket/assignees{/user}","branches_url":"https://api.github.com/repos/luketheobscure/BlargBucket/branches{/branch}","tags_url":"https://api.github.com/repos/luketheobscure/BlargBucket/tags","blobs_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/refs{/sha}","trees_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luketheobscure/BlargBucket/statuses/{sha}","languages_url":"https://api.github.com/repos/luketheobscure/BlargBucket/languages","stargazers_url":"https://api.github.com/repos/luketheobscure/BlargBucket/stargazers","contributors_url":"https://api.github.com/repos/luketheobscure/BlargBucket/contributors","subscribers_url":"https://api.github.com/repos/luketheobscure/BlargBucket/subscribers","subscription_url":"https://api.github.com/repos/luketheobscure/BlargBucket/subscription","commits_url":"https://api.github.com/repos/luketheobscure/BlargBucket/commits{/sha}","git_commits_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/commits{/sha}","comments_url":"https://api.github.com/repos/luketheobscure/BlargBucket/comments{/number}","issue_comment_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/comments/{number}","contents_url":"https://api.github.com/repos/luketheobscure/BlargBucket/contents/{+path}","compare_url":"https://api.github.com/repos/luketheobscure/BlargBucket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luketheobscure/BlargBucket/merges","archive_url":"https://api.github.com/repos/luketheobscure/BlargBucket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luketheobscure/BlargBucket/downloads","issues_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues{/number}","pulls_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls{/number}","milestones_url":"https://api.github.com/repos/luketheobscure/BlargBucket/milestones{/number}","notifications_url":"https://api.github.com/repos/luketheobscure/BlargBucket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luketheobscure/BlargBucket/labels{/name}","releases_url":"https://api.github.com/repos/luketheobscure/BlargBucket/releases{/id}","created_at":"2014-11-26T05:20:51Z","updated_at":"2015-01-10T05:23:32Z","pushed_at":"2015-01-11T18:56:26Z","git_url":"git://github.com/luketheobscure/BlargBucket.git","ssh_url":"git@github.com:luketheobscure/BlargBucket.git","clone_url":"https://github.com/luketheobscure/BlargBucket.git","svn_url":"https://github.com/luketheobscure/BlargBucket","homepage":"http://luketheobscure.github.io/BlargBucket/","size":6480,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":2,"default_branch":"master"}},"base":{"label":"luketheobscure:master","ref":"master","sha":"c8b478918cda6f80b06e7e94027aabfb9d770704","user":{"login":"luketheobscure","id":1163812,"avatar_url":"https://avatars.githubusercontent.com/u/1163812?v=3","gravatar_id":"","url":"https://api.github.com/users/luketheobscure","html_url":"https://github.com/luketheobscure","followers_url":"https://api.github.com/users/luketheobscure/followers","following_url":"https://api.github.com/users/luketheobscure/following{/other_user}","gists_url":"https://api.github.com/users/luketheobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/luketheobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luketheobscure/subscriptions","organizations_url":"https://api.github.com/users/luketheobscure/orgs","repos_url":"https://api.github.com/users/luketheobscure/repos","events_url":"https://api.github.com/users/luketheobscure/events{/privacy}","received_events_url":"https://api.github.com/users/luketheobscure/received_events","type":"User","site_admin":false},"repo":{"id":27160850,"name":"BlargBucket","full_name":"luketheobscure/BlargBucket","owner":{"login":"luketheobscure","id":1163812,"avatar_url":"https://avatars.githubusercontent.com/u/1163812?v=3","gravatar_id":"","url":"https://api.github.com/users/luketheobscure","html_url":"https://github.com/luketheobscure","followers_url":"https://api.github.com/users/luketheobscure/followers","following_url":"https://api.github.com/users/luketheobscure/following{/other_user}","gists_url":"https://api.github.com/users/luketheobscure/gists{/gist_id}","starred_url":"https://api.github.com/users/luketheobscure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luketheobscure/subscriptions","organizations_url":"https://api.github.com/users/luketheobscure/orgs","repos_url":"https://api.github.com/users/luketheobscure/repos","events_url":"https://api.github.com/users/luketheobscure/events{/privacy}","received_events_url":"https://api.github.com/users/luketheobscure/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luketheobscure/BlargBucket","description":"","fork":false,"url":"https://api.github.com/repos/luketheobscure/BlargBucket","forks_url":"https://api.github.com/repos/luketheobscure/BlargBucket/forks","keys_url":"https://api.github.com/repos/luketheobscure/BlargBucket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luketheobscure/BlargBucket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luketheobscure/BlargBucket/teams","hooks_url":"https://api.github.com/repos/luketheobscure/BlargBucket/hooks","issue_events_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/events{/number}","events_url":"https://api.github.com/repos/luketheobscure/BlargBucket/events","assignees_url":"https://api.github.com/repos/luketheobscure/BlargBucket/assignees{/user}","branches_url":"https://api.github.com/repos/luketheobscure/BlargBucket/branches{/branch}","tags_url":"https://api.github.com/repos/luketheobscure/BlargBucket/tags","blobs_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/refs{/sha}","trees_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luketheobscure/BlargBucket/statuses/{sha}","languages_url":"https://api.github.com/repos/luketheobscure/BlargBucket/languages","stargazers_url":"https://api.github.com/repos/luketheobscure/BlargBucket/stargazers","contributors_url":"https://api.github.com/repos/luketheobscure/BlargBucket/contributors","subscribers_url":"https://api.github.com/repos/luketheobscure/BlargBucket/subscribers","subscription_url":"https://api.github.com/repos/luketheobscure/BlargBucket/subscription","commits_url":"https://api.github.com/repos/luketheobscure/BlargBucket/commits{/sha}","git_commits_url":"https://api.github.com/repos/luketheobscure/BlargBucket/git/commits{/sha}","comments_url":"https://api.github.com/repos/luketheobscure/BlargBucket/comments{/number}","issue_comment_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/comments/{number}","contents_url":"https://api.github.com/repos/luketheobscure/BlargBucket/contents/{+path}","compare_url":"https://api.github.com/repos/luketheobscure/BlargBucket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luketheobscure/BlargBucket/merges","archive_url":"https://api.github.com/repos/luketheobscure/BlargBucket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luketheobscure/BlargBucket/downloads","issues_url":"https://api.github.com/repos/luketheobscure/BlargBucket/issues{/number}","pulls_url":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls{/number}","milestones_url":"https://api.github.com/repos/luketheobscure/BlargBucket/milestones{/number}","notifications_url":"https://api.github.com/repos/luketheobscure/BlargBucket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luketheobscure/BlargBucket/labels{/name}","releases_url":"https://api.github.com/repos/luketheobscure/BlargBucket/releases{/id}","created_at":"2014-11-26T05:20:51Z","updated_at":"2015-01-10T05:23:32Z","pushed_at":"2015-01-11T18:56:26Z","git_url":"git://github.com/luketheobscure/BlargBucket.git","ssh_url":"git@github.com:luketheobscure/BlargBucket.git","clone_url":"https://github.com/luketheobscure/BlargBucket.git","svn_url":"https://github.com/luketheobscure/BlargBucket","homepage":"http://luketheobscure.github.io/BlargBucket/","size":6480,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20"},"html":{"href":"https://github.com/luketheobscure/BlargBucket/pull/20"},"issue":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/20"},"comments":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/luketheobscure/BlargBucket/statuses/a192426060a2accf2297f8acd3535b9d835eb52a"}}}}