{"action":"created","comment":{"url":"https://api.github.com/repos/joshuajlai/randos/pulls/comments/143281663","pull_request_review_id":67777180,"id":143281663,"diff_hunk":"@@ -0,0 +1,40 @@\n+<?php\n+$usage = \"Usage: php beanstalk_env_vars.php <json_file.json>\\n\";\n+if ($argc < 2) {\n+    echo $usage;\n+    exit(1);\n+}\n+\n+$jsonFile = $argv[1];\n+if (! file_exists($jsonFile)) {\n+    printf(\"Cannot reach file %s\", $jsonFile);\n+    exit(1);\n+}\n+\n+$text = '\n+  setting {\n+    namespace = \"aws:elasticbeanstalk:application:environment\"\n+    name      = \"{{name}}\"\n+    value     = \"{{value}}\"\n+  }\n+';\n+$contents = file_get_contents($jsonFile);\n+$jsonData = json_decode($contents, true);\n+if (false === $jsonData) {\n+    printf(\"Invalid json data: %s\", json_last_error_msg());\n+    exit(1);\n+}\n+\n+print_r($jsonData);\n+\n+$result = [];\n+foreach ($jsonData as $key => $value) {\n+    // why doesn't php have named arguments yet =(","path":"terraform_scripts/beanstalk_env_vars.php","position":32,"original_position":32,"commit_id":"40d8c68e25ef9d0004bb1b7f9361170b19304340","original_commit_id":"40d8c68e25ef9d0004bb1b7f9361170b19304340","user":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"body":"i think you mean python's string \"format\" function with variable substition or whatevers","created_at":"2017-10-06T19:55:32Z","updated_at":"2017-10-06T19:55:32Z","html_url":"https://github.com/joshuajlai/randos/pull/3#discussion_r143281663","pull_request_url":"https://api.github.com/repos/joshuajlai/randos/pulls/3","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/joshuajlai/randos/pulls/comments/143281663"},"html":{"href":"https://github.com/joshuajlai/randos/pull/3#discussion_r143281663"},"pull_request":{"href":"https://api.github.com/repos/joshuajlai/randos/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/joshuajlai/randos/pulls/3","id":145233445,"html_url":"https://github.com/joshuajlai/randos/pull/3","diff_url":"https://github.com/joshuajlai/randos/pull/3.diff","patch_url":"https://github.com/joshuajlai/randos/pull/3.patch","issue_url":"https://api.github.com/repos/joshuajlai/randos/issues/3","number":3,"state":"open","locked":false,"title":"simple script for writing beanstalk env var blocks","user":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-06T19:55:02Z","updated_at":"2017-10-06T19:55:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15f2c94afc2ff847ffab0b25858634595b9493e9","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/joshuajlai/randos/pulls/3/commits","review_comments_url":"https://api.github.com/repos/joshuajlai/randos/pulls/3/comments","review_comment_url":"https://api.github.com/repos/joshuajlai/randos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joshuajlai/randos/issues/3/comments","statuses_url":"https://api.github.com/repos/joshuajlai/randos/statuses/40d8c68e25ef9d0004bb1b7f9361170b19304340","head":{"label":"joshuajlai:beanstalk_templates","ref":"beanstalk_templates","sha":"40d8c68e25ef9d0004bb1b7f9361170b19304340","user":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"repo":{"id":98696150,"name":"randos","full_name":"joshuajlai/randos","owner":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshuajlai/randos","description":"Random scripts and stuff","fork":false,"url":"https://api.github.com/repos/joshuajlai/randos","forks_url":"https://api.github.com/repos/joshuajlai/randos/forks","keys_url":"https://api.github.com/repos/joshuajlai/randos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshuajlai/randos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshuajlai/randos/teams","hooks_url":"https://api.github.com/repos/joshuajlai/randos/hooks","issue_events_url":"https://api.github.com/repos/joshuajlai/randos/issues/events{/number}","events_url":"https://api.github.com/repos/joshuajlai/randos/events","assignees_url":"https://api.github.com/repos/joshuajlai/randos/assignees{/user}","branches_url":"https://api.github.com/repos/joshuajlai/randos/branches{/branch}","tags_url":"https://api.github.com/repos/joshuajlai/randos/tags","blobs_url":"https://api.github.com/repos/joshuajlai/randos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshuajlai/randos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshuajlai/randos/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshuajlai/randos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshuajlai/randos/statuses/{sha}","languages_url":"https://api.github.com/repos/joshuajlai/randos/languages","stargazers_url":"https://api.github.com/repos/joshuajlai/randos/stargazers","contributors_url":"https://api.github.com/repos/joshuajlai/randos/contributors","subscribers_url":"https://api.github.com/repos/joshuajlai/randos/subscribers","subscription_url":"https://api.github.com/repos/joshuajlai/randos/subscription","commits_url":"https://api.github.com/repos/joshuajlai/randos/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshuajlai/randos/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshuajlai/randos/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshuajlai/randos/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshuajlai/randos/contents/{+path}","compare_url":"https://api.github.com/repos/joshuajlai/randos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshuajlai/randos/merges","archive_url":"https://api.github.com/repos/joshuajlai/randos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshuajlai/randos/downloads","issues_url":"https://api.github.com/repos/joshuajlai/randos/issues{/number}","pulls_url":"https://api.github.com/repos/joshuajlai/randos/pulls{/number}","milestones_url":"https://api.github.com/repos/joshuajlai/randos/milestones{/number}","notifications_url":"https://api.github.com/repos/joshuajlai/randos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshuajlai/randos/labels{/name}","releases_url":"https://api.github.com/repos/joshuajlai/randos/releases{/id}","deployments_url":"https://api.github.com/repos/joshuajlai/randos/deployments","created_at":"2017-07-28T23:48:01Z","updated_at":"2017-07-29T00:32:19Z","pushed_at":"2017-10-06T19:55:03Z","git_url":"git://github.com/joshuajlai/randos.git","ssh_url":"git@github.com:joshuajlai/randos.git","clone_url":"https://github.com/joshuajlai/randos.git","svn_url":"https://github.com/joshuajlai/randos","homepage":null,"size":2,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":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":"joshuajlai:master","ref":"master","sha":"0c8b2d25d46b25781c9d687360d3821425f63b99","user":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"repo":{"id":98696150,"name":"randos","full_name":"joshuajlai/randos","owner":{"login":"joshuajlai","id":150894,"avatar_url":"https://avatars1.githubusercontent.com/u/150894?v=4","gravatar_id":"","url":"https://api.github.com/users/joshuajlai","html_url":"https://github.com/joshuajlai","followers_url":"https://api.github.com/users/joshuajlai/followers","following_url":"https://api.github.com/users/joshuajlai/following{/other_user}","gists_url":"https://api.github.com/users/joshuajlai/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuajlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuajlai/subscriptions","organizations_url":"https://api.github.com/users/joshuajlai/orgs","repos_url":"https://api.github.com/users/joshuajlai/repos","events_url":"https://api.github.com/users/joshuajlai/events{/privacy}","received_events_url":"https://api.github.com/users/joshuajlai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshuajlai/randos","description":"Random scripts and stuff","fork":false,"url":"https://api.github.com/repos/joshuajlai/randos","forks_url":"https://api.github.com/repos/joshuajlai/randos/forks","keys_url":"https://api.github.com/repos/joshuajlai/randos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshuajlai/randos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshuajlai/randos/teams","hooks_url":"https://api.github.com/repos/joshuajlai/randos/hooks","issue_events_url":"https://api.github.com/repos/joshuajlai/randos/issues/events{/number}","events_url":"https://api.github.com/repos/joshuajlai/randos/events","assignees_url":"https://api.github.com/repos/joshuajlai/randos/assignees{/user}","branches_url":"https://api.github.com/repos/joshuajlai/randos/branches{/branch}","tags_url":"https://api.github.com/repos/joshuajlai/randos/tags","blobs_url":"https://api.github.com/repos/joshuajlai/randos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshuajlai/randos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshuajlai/randos/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshuajlai/randos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshuajlai/randos/statuses/{sha}","languages_url":"https://api.github.com/repos/joshuajlai/randos/languages","stargazers_url":"https://api.github.com/repos/joshuajlai/randos/stargazers","contributors_url":"https://api.github.com/repos/joshuajlai/randos/contributors","subscribers_url":"https://api.github.com/repos/joshuajlai/randos/subscribers","subscription_url":"https://api.github.com/repos/joshuajlai/randos/subscription","commits_url":"https://api.github.com/repos/joshuajlai/randos/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshuajlai/randos/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshuajlai/randos/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshuajlai/randos/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshuajlai/randos/contents/{+path}","compare_url":"https://api.github.com/repos/joshuajlai/randos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshuajlai/randos/merges","archive_url":"https://api.github.com/repos/joshuajlai/randos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshuajlai/randos/downloads","issues_url":"https://api.github.com/repos/joshuajlai/randos/issues{/number}","pulls_url":"https://api.github.com/repos/joshuajlai/randos/pulls{/number}","milestones_url":"https://api.github.com/repos/joshuajlai/randos/milestones{/number}","notifications_url":"https://api.github.com/repos/joshuajlai/randos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshuajlai/randos/labels{/name}","releases_url":"https://api.github.com/repos/joshuajlai/randos/releases{/id}","deployments_url":"https://api.github.com/repos/joshuajlai/randos/deployments","created_at":"2017-07-28T23:48:01Z","updated_at":"2017-07-29T00:32:19Z","pushed_at":"2017-10-06T19:55:03Z","git_url":"git://github.com/joshuajlai/randos.git","ssh_url":"git@github.com:joshuajlai/randos.git","clone_url":"https://github.com/joshuajlai/randos.git","svn_url":"https://github.com/joshuajlai/randos","homepage":null,"size":2,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":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/joshuajlai/randos/pulls/3"},"html":{"href":"https://github.com/joshuajlai/randos/pull/3"},"issue":{"href":"https://api.github.com/repos/joshuajlai/randos/issues/3"},"comments":{"href":"https://api.github.com/repos/joshuajlai/randos/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/joshuajlai/randos/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/joshuajlai/randos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joshuajlai/randos/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/joshuajlai/randos/statuses/40d8c68e25ef9d0004bb1b7f9361170b19304340"}},"author_association":"OWNER"}}
{"actor":{"display_login":"joshuajlai"}}