{"action":"created","comment":{"url":"https://api.github.com/repos/xnick421/gameon/pulls/comments/60649254","id":60649254,"diff_hunk":"@@ -4,4 +4,52 @@ class Game < ActiveRecord::Base\n   validates :away_team, presence: true\n   validates :start_time, presence: true\n   validates :user_id, presence: true\n+\n+  @year = Date.today.year\n+  @month = Date.today.month\n+  @day = Date.today.day\n+  def self.populate_mlb\n+    key = ENV['MLB_API_KEY']\n+    req = RestClient.get \"http://api.sportradar.us/mlb-t5/games/#{@year}/#{@month}/#{@day}/schedule.json?api_key=#{key}\"\n+    res = JSON.parse(req)\n+    unless res['league']['games'].empty?\n+      res['league']['games'].each do |game|\n+        location = game['venue']['name']\n+        start_time = Time.parse(game['scheduled']).strftime(\"%I:%M %p\")\n+        away_team = game['away']['name']\n+        home_team = game['home']['name']\n+        Game.create(away_team: \"#{away_team}\", home_team: \"#{home_team}\", location: \"#{location}\", start_time: \"#{start_time}\", league: \"MLB\", user: User.find_by(id: 1))","path":"app/models/game.rb","position":18,"original_position":18,"commit_id":"51aee51741a433861de329ba2059950400c7a55f","original_commit_id":"51aee51741a433861de329ba2059950400c7a55f","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long. [169/80]<br>Prefer `to_s` over string interpolation.","created_at":"2016-04-21T20:25:54Z","updated_at":"2016-04-21T20:25:54Z","html_url":"https://github.com/xnick421/gameon/pull/7#discussion_r60649254","pull_request_url":"https://api.github.com/repos/xnick421/gameon/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/xnick421/gameon/pulls/comments/60649254"},"html":{"href":"https://github.com/xnick421/gameon/pull/7#discussion_r60649254"},"pull_request":{"href":"https://api.github.com/repos/xnick421/gameon/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/xnick421/gameon/pulls/7","id":67416592,"html_url":"https://github.com/xnick421/gameon/pull/7","diff_url":"https://github.com/xnick421/gameon/pull/7.diff","patch_url":"https://github.com/xnick421/gameon/pull/7.patch","issue_url":"https://api.github.com/repos/xnick421/gameon/issues/7","number":7,"state":"open","locked":false,"title":"integrated all api calls","user":{"login":"xnick421","id":16607249,"avatar_url":"https://avatars.githubusercontent.com/u/16607249?v=3","gravatar_id":"","url":"https://api.github.com/users/xnick421","html_url":"https://github.com/xnick421","followers_url":"https://api.github.com/users/xnick421/followers","following_url":"https://api.github.com/users/xnick421/following{/other_user}","gists_url":"https://api.github.com/users/xnick421/gists{/gist_id}","starred_url":"https://api.github.com/users/xnick421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnick421/subscriptions","organizations_url":"https://api.github.com/users/xnick421/orgs","repos_url":"https://api.github.com/users/xnick421/repos","events_url":"https://api.github.com/users/xnick421/events{/privacy}","received_events_url":"https://api.github.com/users/xnick421/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-21T20:25:50Z","updated_at":"2016-04-21T20:25:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"831f578d15abfececb12799c313748d83336a14c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/xnick421/gameon/pulls/7/commits","review_comments_url":"https://api.github.com/repos/xnick421/gameon/pulls/7/comments","review_comment_url":"https://api.github.com/repos/xnick421/gameon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xnick421/gameon/issues/7/comments","statuses_url":"https://api.github.com/repos/xnick421/gameon/statuses/51aee51741a433861de329ba2059950400c7a55f","head":{"label":"xnick421:api","ref":"api","sha":"51aee51741a433861de329ba2059950400c7a55f","user":{"login":"xnick421","id":16607249,"avatar_url":"https://avatars.githubusercontent.com/u/16607249?v=3","gravatar_id":"","url":"https://api.github.com/users/xnick421","html_url":"https://github.com/xnick421","followers_url":"https://api.github.com/users/xnick421/followers","following_url":"https://api.github.com/users/xnick421/following{/other_user}","gists_url":"https://api.github.com/users/xnick421/gists{/gist_id}","starred_url":"https://api.github.com/users/xnick421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnick421/subscriptions","organizations_url":"https://api.github.com/users/xnick421/orgs","repos_url":"https://api.github.com/users/xnick421/repos","events_url":"https://api.github.com/users/xnick421/events{/privacy}","received_events_url":"https://api.github.com/users/xnick421/received_events","type":"User","site_admin":false},"repo":{"id":56533393,"name":"gameon","full_name":"xnick421/gameon","owner":{"login":"xnick421","id":16607249,"avatar_url":"https://avatars.githubusercontent.com/u/16607249?v=3","gravatar_id":"","url":"https://api.github.com/users/xnick421","html_url":"https://github.com/xnick421","followers_url":"https://api.github.com/users/xnick421/followers","following_url":"https://api.github.com/users/xnick421/following{/other_user}","gists_url":"https://api.github.com/users/xnick421/gists{/gist_id}","starred_url":"https://api.github.com/users/xnick421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnick421/subscriptions","organizations_url":"https://api.github.com/users/xnick421/orgs","repos_url":"https://api.github.com/users/xnick421/repos","events_url":"https://api.github.com/users/xnick421/events{/privacy}","received_events_url":"https://api.github.com/users/xnick421/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xnick421/gameon","description":"","fork":false,"url":"https://api.github.com/repos/xnick421/gameon","forks_url":"https://api.github.com/repos/xnick421/gameon/forks","keys_url":"https://api.github.com/repos/xnick421/gameon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xnick421/gameon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xnick421/gameon/teams","hooks_url":"https://api.github.com/repos/xnick421/gameon/hooks","issue_events_url":"https://api.github.com/repos/xnick421/gameon/issues/events{/number}","events_url":"https://api.github.com/repos/xnick421/gameon/events","assignees_url":"https://api.github.com/repos/xnick421/gameon/assignees{/user}","branches_url":"https://api.github.com/repos/xnick421/gameon/branches{/branch}","tags_url":"https://api.github.com/repos/xnick421/gameon/tags","blobs_url":"https://api.github.com/repos/xnick421/gameon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xnick421/gameon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xnick421/gameon/git/refs{/sha}","trees_url":"https://api.github.com/repos/xnick421/gameon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xnick421/gameon/statuses/{sha}","languages_url":"https://api.github.com/repos/xnick421/gameon/languages","stargazers_url":"https://api.github.com/repos/xnick421/gameon/stargazers","contributors_url":"https://api.github.com/repos/xnick421/gameon/contributors","subscribers_url":"https://api.github.com/repos/xnick421/gameon/subscribers","subscription_url":"https://api.github.com/repos/xnick421/gameon/subscription","commits_url":"https://api.github.com/repos/xnick421/gameon/commits{/sha}","git_commits_url":"https://api.github.com/repos/xnick421/gameon/git/commits{/sha}","comments_url":"https://api.github.com/repos/xnick421/gameon/comments{/number}","issue_comment_url":"https://api.github.com/repos/xnick421/gameon/issues/comments{/number}","contents_url":"https://api.github.com/repos/xnick421/gameon/contents/{+path}","compare_url":"https://api.github.com/repos/xnick421/gameon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xnick421/gameon/merges","archive_url":"https://api.github.com/repos/xnick421/gameon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xnick421/gameon/downloads","issues_url":"https://api.github.com/repos/xnick421/gameon/issues{/number}","pulls_url":"https://api.github.com/repos/xnick421/gameon/pulls{/number}","milestones_url":"https://api.github.com/repos/xnick421/gameon/milestones{/number}","notifications_url":"https://api.github.com/repos/xnick421/gameon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xnick421/gameon/labels{/name}","releases_url":"https://api.github.com/repos/xnick421/gameon/releases{/id}","deployments_url":"https://api.github.com/repos/xnick421/gameon/deployments","created_at":"2016-04-18T18:51:39Z","updated_at":"2016-04-18T21:31:26Z","pushed_at":"2016-04-21T20:25:50Z","git_url":"git://github.com/xnick421/gameon.git","ssh_url":"git@github.com:xnick421/gameon.git","clone_url":"https://github.com/xnick421/gameon.git","svn_url":"https://github.com/xnick421/gameon","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"xnick421:master","ref":"master","sha":"a1e08d08a70e72074df0cdcef1c35999ae6de556","user":{"login":"xnick421","id":16607249,"avatar_url":"https://avatars.githubusercontent.com/u/16607249?v=3","gravatar_id":"","url":"https://api.github.com/users/xnick421","html_url":"https://github.com/xnick421","followers_url":"https://api.github.com/users/xnick421/followers","following_url":"https://api.github.com/users/xnick421/following{/other_user}","gists_url":"https://api.github.com/users/xnick421/gists{/gist_id}","starred_url":"https://api.github.com/users/xnick421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnick421/subscriptions","organizations_url":"https://api.github.com/users/xnick421/orgs","repos_url":"https://api.github.com/users/xnick421/repos","events_url":"https://api.github.com/users/xnick421/events{/privacy}","received_events_url":"https://api.github.com/users/xnick421/received_events","type":"User","site_admin":false},"repo":{"id":56533393,"name":"gameon","full_name":"xnick421/gameon","owner":{"login":"xnick421","id":16607249,"avatar_url":"https://avatars.githubusercontent.com/u/16607249?v=3","gravatar_id":"","url":"https://api.github.com/users/xnick421","html_url":"https://github.com/xnick421","followers_url":"https://api.github.com/users/xnick421/followers","following_url":"https://api.github.com/users/xnick421/following{/other_user}","gists_url":"https://api.github.com/users/xnick421/gists{/gist_id}","starred_url":"https://api.github.com/users/xnick421/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xnick421/subscriptions","organizations_url":"https://api.github.com/users/xnick421/orgs","repos_url":"https://api.github.com/users/xnick421/repos","events_url":"https://api.github.com/users/xnick421/events{/privacy}","received_events_url":"https://api.github.com/users/xnick421/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xnick421/gameon","description":"","fork":false,"url":"https://api.github.com/repos/xnick421/gameon","forks_url":"https://api.github.com/repos/xnick421/gameon/forks","keys_url":"https://api.github.com/repos/xnick421/gameon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xnick421/gameon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xnick421/gameon/teams","hooks_url":"https://api.github.com/repos/xnick421/gameon/hooks","issue_events_url":"https://api.github.com/repos/xnick421/gameon/issues/events{/number}","events_url":"https://api.github.com/repos/xnick421/gameon/events","assignees_url":"https://api.github.com/repos/xnick421/gameon/assignees{/user}","branches_url":"https://api.github.com/repos/xnick421/gameon/branches{/branch}","tags_url":"https://api.github.com/repos/xnick421/gameon/tags","blobs_url":"https://api.github.com/repos/xnick421/gameon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xnick421/gameon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xnick421/gameon/git/refs{/sha}","trees_url":"https://api.github.com/repos/xnick421/gameon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xnick421/gameon/statuses/{sha}","languages_url":"https://api.github.com/repos/xnick421/gameon/languages","stargazers_url":"https://api.github.com/repos/xnick421/gameon/stargazers","contributors_url":"https://api.github.com/repos/xnick421/gameon/contributors","subscribers_url":"https://api.github.com/repos/xnick421/gameon/subscribers","subscription_url":"https://api.github.com/repos/xnick421/gameon/subscription","commits_url":"https://api.github.com/repos/xnick421/gameon/commits{/sha}","git_commits_url":"https://api.github.com/repos/xnick421/gameon/git/commits{/sha}","comments_url":"https://api.github.com/repos/xnick421/gameon/comments{/number}","issue_comment_url":"https://api.github.com/repos/xnick421/gameon/issues/comments{/number}","contents_url":"https://api.github.com/repos/xnick421/gameon/contents/{+path}","compare_url":"https://api.github.com/repos/xnick421/gameon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xnick421/gameon/merges","archive_url":"https://api.github.com/repos/xnick421/gameon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xnick421/gameon/downloads","issues_url":"https://api.github.com/repos/xnick421/gameon/issues{/number}","pulls_url":"https://api.github.com/repos/xnick421/gameon/pulls{/number}","milestones_url":"https://api.github.com/repos/xnick421/gameon/milestones{/number}","notifications_url":"https://api.github.com/repos/xnick421/gameon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xnick421/gameon/labels{/name}","releases_url":"https://api.github.com/repos/xnick421/gameon/releases{/id}","deployments_url":"https://api.github.com/repos/xnick421/gameon/deployments","created_at":"2016-04-18T18:51:39Z","updated_at":"2016-04-18T21:31:26Z","pushed_at":"2016-04-21T20:25:50Z","git_url":"git://github.com/xnick421/gameon.git","ssh_url":"git@github.com:xnick421/gameon.git","clone_url":"https://github.com/xnick421/gameon.git","svn_url":"https://github.com/xnick421/gameon","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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/xnick421/gameon/pulls/7"},"html":{"href":"https://github.com/xnick421/gameon/pull/7"},"issue":{"href":"https://api.github.com/repos/xnick421/gameon/issues/7"},"comments":{"href":"https://api.github.com/repos/xnick421/gameon/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/xnick421/gameon/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/xnick421/gameon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xnick421/gameon/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/xnick421/gameon/statuses/51aee51741a433861de329ba2059950400c7a55f"}}}}