{"action":"created","comment":{"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments/37477650","id":37477650,"diff_hunk":"@@ -0,0 +1,43 @@\n+#1 - Pull the json from the reddit API via http://www.reddit.com/.json\n+  # - http://mashable.com/stories.json (homework)\n+#2 - Parse it using the JSON library\n+#3 - Find the stories based on techniques used in the code_along (max of 25 provided)\n+#4 - Create a new story hash out of each story with the following keys :title, :upvotes and :category\n+    #title, #category and #upvotes may not be the names use\n+#5 - Add each story to an array\n+#6 - Print each story from the array on your \"Front Page\"\n+#7 - BONUS ### create a 'csv' file using the api data & Ruby's CSV library\n+     # -> http://ruby-doc.org/stdlib-2.2.2/libdoc/csv/rdoc/CSV.html\n+         #title, upvote, category are the required columns\n+\n+require 'rest-client'\n+require 'pry'\n+require 'json'\n+\n+def connect_to_api(url)\n+  response = RestClient.get(url)\n+  JSON.parse(response)\n+end\n+\n+def find_stories(response)\n+  stories = response[\"data\"][\"children\"]\n+  puts \"*************Mashable has blessed us with #{stories.count} stories ***********\"\n+  return stories\n+end\n+\n+def print_stories(stories)\n+  stories.each do |tackle|\n+    create_story_hash(tackle[\"data\"])\n+  end\n+end\n+\n+def create_story_hash(story)\n+  story = {title: story[\"title\"], category: story[\"mashable\"], upvotes: story[\"ups\"]}\n+  puts \"Title: #{story[:title\"], category: story[\"mashable\"], upvotes: story[\"ups\"]}","path":"GarrettSpitzer-spitzergarrett/hw_5/get_it_mashable.rb","position":36,"original_position":36,"commit_id":"67639bc448e10002497ea8286abbf4818fcb7b38","original_commit_id":"67639bc448e10002497ea8286abbf4818fcb7b38","user":{"login":"chylaudes","id":10103582,"avatar_url":"https://avatars.githubusercontent.com/u/10103582?v=3","gravatar_id":"","url":"https://api.github.com/users/chylaudes","html_url":"https://github.com/chylaudes","followers_url":"https://api.github.com/users/chylaudes/followers","following_url":"https://api.github.com/users/chylaudes/following{/other_user}","gists_url":"https://api.github.com/users/chylaudes/gists{/gist_id}","starred_url":"https://api.github.com/users/chylaudes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylaudes/subscriptions","organizations_url":"https://api.github.com/users/chylaudes/orgs","repos_url":"https://api.github.com/users/chylaudes/repos","events_url":"https://api.github.com/users/chylaudes/events{/privacy}","received_events_url":"https://api.github.com/users/chylaudes/received_events","type":"User","site_admin":false},"body":"The reason why it's throwing an error here is because of syntax.  Close your quotes and make sure each variable you're calling has its own #{}\r\n```\r\n  puts \"Title: #{story[\":title\"]}, category: #{story[\"mashable\"]}, upvotes: #{story[\"ups\"]}}\"\r\n\r\n```","created_at":"2015-08-19T22:40:43Z","updated_at":"2015-08-19T22:40:43Z","html_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/125#discussion_r37477650","pull_request_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments/37477650"},"html":{"href":"https://github.com/ga-students/bewd_sf_10_homework/pull/125#discussion_r37477650"},"pull_request":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125","id":42651556,"html_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/125","diff_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/125.diff","patch_url":"https://github.com/ga-students/bewd_sf_10_homework/pull/125.patch","issue_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/125","number":125,"state":"open","locked":false,"title":"hw 5","user":{"login":"spitzergarrett","id":5667709,"avatar_url":"https://avatars.githubusercontent.com/u/5667709?v=3","gravatar_id":"","url":"https://api.github.com/users/spitzergarrett","html_url":"https://github.com/spitzergarrett","followers_url":"https://api.github.com/users/spitzergarrett/followers","following_url":"https://api.github.com/users/spitzergarrett/following{/other_user}","gists_url":"https://api.github.com/users/spitzergarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/spitzergarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spitzergarrett/subscriptions","organizations_url":"https://api.github.com/users/spitzergarrett/orgs","repos_url":"https://api.github.com/users/spitzergarrett/repos","events_url":"https://api.github.com/users/spitzergarrett/events{/privacy}","received_events_url":"https://api.github.com/users/spitzergarrett/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-18T01:00:42Z","updated_at":"2015-08-19T22:40:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21e3c2c7f662c1e5095217cf1e7483943928e0f9","assignee":{"login":"chylaudes","id":10103582,"avatar_url":"https://avatars.githubusercontent.com/u/10103582?v=3","gravatar_id":"","url":"https://api.github.com/users/chylaudes","html_url":"https://github.com/chylaudes","followers_url":"https://api.github.com/users/chylaudes/followers","following_url":"https://api.github.com/users/chylaudes/following{/other_user}","gists_url":"https://api.github.com/users/chylaudes/gists{/gist_id}","starred_url":"https://api.github.com/users/chylaudes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chylaudes/subscriptions","organizations_url":"https://api.github.com/users/chylaudes/orgs","repos_url":"https://api.github.com/users/chylaudes/repos","events_url":"https://api.github.com/users/chylaudes/events{/privacy}","received_events_url":"https://api.github.com/users/chylaudes/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125/commits","review_comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125/comments","review_comment_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/125/comments","statuses_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/67639bc448e10002497ea8286abbf4818fcb7b38","head":{"label":"spitzergarrett:master","ref":"master","sha":"67639bc448e10002497ea8286abbf4818fcb7b38","user":{"login":"spitzergarrett","id":5667709,"avatar_url":"https://avatars.githubusercontent.com/u/5667709?v=3","gravatar_id":"","url":"https://api.github.com/users/spitzergarrett","html_url":"https://github.com/spitzergarrett","followers_url":"https://api.github.com/users/spitzergarrett/followers","following_url":"https://api.github.com/users/spitzergarrett/following{/other_user}","gists_url":"https://api.github.com/users/spitzergarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/spitzergarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spitzergarrett/subscriptions","organizations_url":"https://api.github.com/users/spitzergarrett/orgs","repos_url":"https://api.github.com/users/spitzergarrett/repos","events_url":"https://api.github.com/users/spitzergarrett/events{/privacy}","received_events_url":"https://api.github.com/users/spitzergarrett/received_events","type":"User","site_admin":false},"repo":{"id":39925754,"name":"bewd_sf_10_homework","full_name":"spitzergarrett/bewd_sf_10_homework","owner":{"login":"spitzergarrett","id":5667709,"avatar_url":"https://avatars.githubusercontent.com/u/5667709?v=3","gravatar_id":"","url":"https://api.github.com/users/spitzergarrett","html_url":"https://github.com/spitzergarrett","followers_url":"https://api.github.com/users/spitzergarrett/followers","following_url":"https://api.github.com/users/spitzergarrett/following{/other_user}","gists_url":"https://api.github.com/users/spitzergarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/spitzergarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spitzergarrett/subscriptions","organizations_url":"https://api.github.com/users/spitzergarrett/orgs","repos_url":"https://api.github.com/users/spitzergarrett/repos","events_url":"https://api.github.com/users/spitzergarrett/events{/privacy}","received_events_url":"https://api.github.com/users/spitzergarrett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spitzergarrett/bewd_sf_10_homework","description":"BEWD 10 Cohort Homework","fork":true,"url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework","forks_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/forks","keys_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/teams","hooks_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/hooks","issue_events_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/issues/events{/number}","events_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/events","assignees_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/assignees{/user}","branches_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/branches{/branch}","tags_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/tags","blobs_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/languages","stargazers_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/stargazers","contributors_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/contributors","subscribers_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/subscribers","subscription_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/subscription","commits_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/contents/{+path}","compare_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/merges","archive_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/downloads","issues_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/issues{/number}","pulls_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/labels{/name}","releases_url":"https://api.github.com/repos/spitzergarrett/bewd_sf_10_homework/releases{/id}","created_at":"2015-07-30T01:53:49Z","updated_at":"2015-08-04T03:16:26Z","pushed_at":"2015-08-18T00:52:51Z","git_url":"git://github.com/spitzergarrett/bewd_sf_10_homework.git","ssh_url":"git@github.com:spitzergarrett/bewd_sf_10_homework.git","clone_url":"https://github.com/spitzergarrett/bewd_sf_10_homework.git","svn_url":"https://github.com/spitzergarrett/bewd_sf_10_homework","homepage":null,"size":88,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"ga-students:master","ref":"master","sha":"4576522ed5cc6d70ede4383bfac01cf34fb9b894","user":{"login":"ga-students","id":5048067,"avatar_url":"https://avatars.githubusercontent.com/u/5048067?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-students","html_url":"https://github.com/ga-students","followers_url":"https://api.github.com/users/ga-students/followers","following_url":"https://api.github.com/users/ga-students/following{/other_user}","gists_url":"https://api.github.com/users/ga-students/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-students/subscriptions","organizations_url":"https://api.github.com/users/ga-students/orgs","repos_url":"https://api.github.com/users/ga-students/repos","events_url":"https://api.github.com/users/ga-students/events{/privacy}","received_events_url":"https://api.github.com/users/ga-students/received_events","type":"Organization","site_admin":false},"repo":{"id":39805458,"name":"bewd_sf_10_homework","full_name":"ga-students/bewd_sf_10_homework","owner":{"login":"ga-students","id":5048067,"avatar_url":"https://avatars.githubusercontent.com/u/5048067?v=3","gravatar_id":"","url":"https://api.github.com/users/ga-students","html_url":"https://github.com/ga-students","followers_url":"https://api.github.com/users/ga-students/followers","following_url":"https://api.github.com/users/ga-students/following{/other_user}","gists_url":"https://api.github.com/users/ga-students/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-students/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-students/subscriptions","organizations_url":"https://api.github.com/users/ga-students/orgs","repos_url":"https://api.github.com/users/ga-students/repos","events_url":"https://api.github.com/users/ga-students/events{/privacy}","received_events_url":"https://api.github.com/users/ga-students/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga-students/bewd_sf_10_homework","description":"BEWD 10 Cohort Homework","fork":false,"url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework","forks_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/forks","keys_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/teams","hooks_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/hooks","issue_events_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/events{/number}","events_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/events","assignees_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/assignees{/user}","branches_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/branches{/branch}","tags_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/tags","blobs_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/languages","stargazers_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/stargazers","contributors_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/contributors","subscribers_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/subscribers","subscription_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/subscription","commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/contents/{+path}","compare_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/merges","archive_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/downloads","issues_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues{/number}","pulls_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/labels{/name}","releases_url":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/releases{/id}","created_at":"2015-07-28T00:57:38Z","updated_at":"2015-08-07T03:46:14Z","pushed_at":"2015-08-19T21:50:40Z","git_url":"git://github.com/ga-students/bewd_sf_10_homework.git","ssh_url":"git@github.com:ga-students/bewd_sf_10_homework.git","clone_url":"https://github.com/ga-students/bewd_sf_10_homework.git","svn_url":"https://github.com/ga-students/bewd_sf_10_homework","homepage":null,"size":3658,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":9,"forks":34,"open_issues":9,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125"},"html":{"href":"https://github.com/ga-students/bewd_sf_10_homework/pull/125"},"issue":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/125"},"comments":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/ga-students/bewd_sf_10_homework/statuses/67639bc448e10002497ea8286abbf4818fcb7b38"}}}}