{"action":"created","comment":{"url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/comments/25049605","id":25049605,"diff_hunk":"@@ -0,0 +1,44 @@\n+require 'sinatra'\n+require 'pry'\n+require 'csv'\n+\n+configure do\n+  enable :sessions\n+end\n+\n+articles_array = []\n+\n+get '/articles' do\n+  # binding.pry\n+  articles_array = CSV.read(\"./articles.csv\")","path":"server.rb","position":13,"original_position":13,"commit_id":"d58eda9b1846ffa4663e5ac59cda45e75914c02e","original_commit_id":"d58eda9b1846ffa4663e5ac59cda45e75914c02e","user":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"body":"you might want to refactor this to be a method call to not over load that path and allow it to be reused in multiple place with out duplicating your code. DRY it up as they say\r\n\r\n```ruby\r\ndef load_articlesv(path = \"./articles.csv\")\r\n   CSV.read(path)\r\nend\r\n```\r\n\r\nthen you can do \r\n```ruby\r\narticles_array = load_articles\r\n```\r\n\r\nor per the earlier comment on the html you could do something like\r\n```ruby\r\ndef parsed_articles\r\n  raw_articles = load_articles\r\n  articles = []\r\n  raw_articles.each do |raw|\r\n    article = Hash.new\r\n    article[:url] = raw[0]\r\n    article[:description] = raw[1]\r\n    articles << article\r\n  end\r\n  return articles\r\nend\r\n```","created_at":"2015-02-20T05:06:55Z","updated_at":"2015-02-20T05:06:55Z","html_url":"https://github.com/townie/news_aggrigrator/pull/1#discussion_r25049605","pull_request_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/comments/25049605"},"html":{"href":"https://github.com/townie/news_aggrigrator/pull/1#discussion_r25049605"},"pull_request":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1","id":29672675,"html_url":"https://github.com/townie/news_aggrigrator/pull/1","diff_url":"https://github.com/townie/news_aggrigrator/pull/1.diff","patch_url":"https://github.com/townie/news_aggrigrator/pull/1.patch","issue_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/1","number":1,"state":"open","locked":false,"title":"pr","user":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"body":"for notes","created_at":"2015-02-20T04:42:13Z","updated_at":"2015-02-20T05:06:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d49e5d73caa43384c39a52334084f0ec79f22d29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1/commits","review_comments_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1/comments","review_comment_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls/comments/{number}","comments_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/1/comments","statuses_url":"https://api.github.com/repos/townie/news_aggrigrator/statuses/d58eda9b1846ffa4663e5ac59cda45e75914c02e","head":{"label":"pull_request","ref":"pull_request","sha":"d58eda9b1846ffa4663e5ac59cda45e75914c02e","user":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"repo":{"id":31051241,"name":"news_aggrigrator","full_name":"townie/news_aggrigrator","owner":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/townie/news_aggrigrator","description":"","fork":false,"url":"https://api.github.com/repos/townie/news_aggrigrator","forks_url":"https://api.github.com/repos/townie/news_aggrigrator/forks","keys_url":"https://api.github.com/repos/townie/news_aggrigrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/townie/news_aggrigrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/townie/news_aggrigrator/teams","hooks_url":"https://api.github.com/repos/townie/news_aggrigrator/hooks","issue_events_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/events{/number}","events_url":"https://api.github.com/repos/townie/news_aggrigrator/events","assignees_url":"https://api.github.com/repos/townie/news_aggrigrator/assignees{/user}","branches_url":"https://api.github.com/repos/townie/news_aggrigrator/branches{/branch}","tags_url":"https://api.github.com/repos/townie/news_aggrigrator/tags","blobs_url":"https://api.github.com/repos/townie/news_aggrigrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/townie/news_aggrigrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/townie/news_aggrigrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/townie/news_aggrigrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/townie/news_aggrigrator/statuses/{sha}","languages_url":"https://api.github.com/repos/townie/news_aggrigrator/languages","stargazers_url":"https://api.github.com/repos/townie/news_aggrigrator/stargazers","contributors_url":"https://api.github.com/repos/townie/news_aggrigrator/contributors","subscribers_url":"https://api.github.com/repos/townie/news_aggrigrator/subscribers","subscription_url":"https://api.github.com/repos/townie/news_aggrigrator/subscription","commits_url":"https://api.github.com/repos/townie/news_aggrigrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/townie/news_aggrigrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/townie/news_aggrigrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/comments/{number}","contents_url":"https://api.github.com/repos/townie/news_aggrigrator/contents/{+path}","compare_url":"https://api.github.com/repos/townie/news_aggrigrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/townie/news_aggrigrator/merges","archive_url":"https://api.github.com/repos/townie/news_aggrigrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/townie/news_aggrigrator/downloads","issues_url":"https://api.github.com/repos/townie/news_aggrigrator/issues{/number}","pulls_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls{/number}","milestones_url":"https://api.github.com/repos/townie/news_aggrigrator/milestones{/number}","notifications_url":"https://api.github.com/repos/townie/news_aggrigrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/townie/news_aggrigrator/labels{/name}","releases_url":"https://api.github.com/repos/townie/news_aggrigrator/releases{/id}","created_at":"2015-02-20T04:40:50Z","updated_at":"2015-02-20T04:40:50Z","pushed_at":"2015-02-20T04:42:05Z","git_url":"git://github.com/townie/news_aggrigrator.git","ssh_url":"git@github.com:townie/news_aggrigrator.git","clone_url":"https://github.com/townie/news_aggrigrator.git","svn_url":"https://github.com/townie/news_aggrigrator","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"master","ref":"master","sha":"ec0093e05062343b40235222e5b2ae8a58f89e82","user":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"repo":{"id":31051241,"name":"news_aggrigrator","full_name":"townie/news_aggrigrator","owner":{"login":"townie","id":5906193,"avatar_url":"https://avatars.githubusercontent.com/u/5906193?v=3","gravatar_id":"","url":"https://api.github.com/users/townie","html_url":"https://github.com/townie","followers_url":"https://api.github.com/users/townie/followers","following_url":"https://api.github.com/users/townie/following{/other_user}","gists_url":"https://api.github.com/users/townie/gists{/gist_id}","starred_url":"https://api.github.com/users/townie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/townie/subscriptions","organizations_url":"https://api.github.com/users/townie/orgs","repos_url":"https://api.github.com/users/townie/repos","events_url":"https://api.github.com/users/townie/events{/privacy}","received_events_url":"https://api.github.com/users/townie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/townie/news_aggrigrator","description":"","fork":false,"url":"https://api.github.com/repos/townie/news_aggrigrator","forks_url":"https://api.github.com/repos/townie/news_aggrigrator/forks","keys_url":"https://api.github.com/repos/townie/news_aggrigrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/townie/news_aggrigrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/townie/news_aggrigrator/teams","hooks_url":"https://api.github.com/repos/townie/news_aggrigrator/hooks","issue_events_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/events{/number}","events_url":"https://api.github.com/repos/townie/news_aggrigrator/events","assignees_url":"https://api.github.com/repos/townie/news_aggrigrator/assignees{/user}","branches_url":"https://api.github.com/repos/townie/news_aggrigrator/branches{/branch}","tags_url":"https://api.github.com/repos/townie/news_aggrigrator/tags","blobs_url":"https://api.github.com/repos/townie/news_aggrigrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/townie/news_aggrigrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/townie/news_aggrigrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/townie/news_aggrigrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/townie/news_aggrigrator/statuses/{sha}","languages_url":"https://api.github.com/repos/townie/news_aggrigrator/languages","stargazers_url":"https://api.github.com/repos/townie/news_aggrigrator/stargazers","contributors_url":"https://api.github.com/repos/townie/news_aggrigrator/contributors","subscribers_url":"https://api.github.com/repos/townie/news_aggrigrator/subscribers","subscription_url":"https://api.github.com/repos/townie/news_aggrigrator/subscription","commits_url":"https://api.github.com/repos/townie/news_aggrigrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/townie/news_aggrigrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/townie/news_aggrigrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/townie/news_aggrigrator/issues/comments/{number}","contents_url":"https://api.github.com/repos/townie/news_aggrigrator/contents/{+path}","compare_url":"https://api.github.com/repos/townie/news_aggrigrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/townie/news_aggrigrator/merges","archive_url":"https://api.github.com/repos/townie/news_aggrigrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/townie/news_aggrigrator/downloads","issues_url":"https://api.github.com/repos/townie/news_aggrigrator/issues{/number}","pulls_url":"https://api.github.com/repos/townie/news_aggrigrator/pulls{/number}","milestones_url":"https://api.github.com/repos/townie/news_aggrigrator/milestones{/number}","notifications_url":"https://api.github.com/repos/townie/news_aggrigrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/townie/news_aggrigrator/labels{/name}","releases_url":"https://api.github.com/repos/townie/news_aggrigrator/releases{/id}","created_at":"2015-02-20T04:40:50Z","updated_at":"2015-02-20T04:40:50Z","pushed_at":"2015-02-20T04:42:05Z","git_url":"git://github.com/townie/news_aggrigrator.git","ssh_url":"git@github.com:townie/news_aggrigrator.git","clone_url":"https://github.com/townie/news_aggrigrator.git","svn_url":"https://github.com/townie/news_aggrigrator","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1"},"html":{"href":"https://github.com/townie/news_aggrigrator/pull/1"},"issue":{"href":"https://api.github.com/repos/townie/news_aggrigrator/issues/1"},"comments":{"href":"https://api.github.com/repos/townie/news_aggrigrator/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/townie/news_aggrigrator/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/townie/news_aggrigrator/statuses/d58eda9b1846ffa4663e5ac59cda45e75914c02e"}}}}