{"action":"opened","number":7,"pull_request":{"url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7","id":26740166,"html_url":"https://github.com/18F/analytics-proxy-nodejs/pull/7","diff_url":"https://github.com/18F/analytics-proxy-nodejs/pull/7.diff","patch_url":"https://github.com/18F/analytics-proxy-nodejs/pull/7.patch","issue_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/7","number":7,"state":"open","locked":false,"title":"WIP: Framework for downloading, processing, and saving GA reports","user":{"login":"konklone","id":4592,"avatar_url":"https://avatars.githubusercontent.com/u/4592?v=3","gravatar_id":"","url":"https://api.github.com/users/konklone","html_url":"https://github.com/konklone","followers_url":"https://api.github.com/users/konklone/followers","following_url":"https://api.github.com/users/konklone/following{/other_user}","gists_url":"https://api.github.com/users/konklone/gists{/gist_id}","starred_url":"https://api.github.com/users/konklone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konklone/subscriptions","organizations_url":"https://api.github.com/users/konklone/orgs","repos_url":"https://api.github.com/users/konklone/repos","events_url":"https://api.github.com/users/konklone/events{/privacy}","received_events_url":"https://api.github.com/users/konklone/received_events","type":"User","site_admin":false},"body":"This adds `reports.json`, `download.js`, and an ignored `data/` directory for output JSON.\r\n\r\nThis is primarily meant for easy exporting, but is a useful separation even for a proxy - the proxy can create bulk data as it goes, and load that data into Mongo et al separately.\r\n\r\n`reports.json` is meant to replace `analytics_urls.txt`. I also moved the `ids` parameter into `config.js`.\r\n\r\n`download.js` uses a lot of code from `data.js`. The `Analytics` module in `download.js` should be separated into its own module. There's clear overlap, and we can refactor later and avoid duplication. I'm starting it this way to make a cleaner extract-transform-load workflow, which I think will benefit the proxy.\r\n\r\nThis PR is huge because I also did an update of dependencies, and removed `node_modules/` from the repo (because it involves a compiled C extension, which will differ between OS X and Ubuntu).\r\n\r\nMore work to go here -- but you can try it out by:\r\n\r\n* checking out this branch\r\n* filling in the `ids` parameter in `config.js` (see `config.js.example` for an example)\r\n* `rm -r node_modules`\r\n* `npm install`\r\n* `node download.js`\r\n\r\nYou should see something like:\r\n\r\n```\r\n$ node download.js \r\n\r\n[weekly-users] Fetching...\r\n[weekly-users] Saving original...\r\n[weekly-users] Saving processed...\r\n[weekly-users] Done.\r\n```\r\n\r\nAnd then look in `data/original` and `data/ready` to see the raw GA data, and a processed form, respectively.\r\n\r\nTODO:\r\n\r\n- [ ] Better schema for the processed data, maybe similar to GDS'.\r\n- [ ] More reports.\r\n- [ ] Documentation\r\n- [ ] Probably some refactoring of other parts to remove duplication, but that could also come post-merge.\r\n\r\nDon't bother opening the Changed Files tab for this PR - just visit the [`downloading`](https://github.com/18F/analytics-proxy-nodejs/tree/downloading) branch directly.","created_at":"2015-01-01T02:57:41Z","updated_at":"2015-01-01T02:57:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7/commits","review_comments_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7/comments","review_comment_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/7/comments","statuses_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/statuses/7e146b2ab1f5d19c2772538d8b2b8c808c17d58d","head":{"label":"18F:downloading","ref":"downloading","sha":"7e146b2ab1f5d19c2772538d8b2b8c808c17d58d","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":27411729,"name":"analytics-proxy-nodejs","full_name":"18F/analytics-proxy-nodejs","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/analytics-proxy-nodejs","description":"Google Analytics Proxy using nodeJS","fork":false,"url":"https://api.github.com/repos/18F/analytics-proxy-nodejs","forks_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/forks","keys_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/teams","hooks_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/hooks","issue_events_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/events","assignees_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/tags","blobs_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/languages","stargazers_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/stargazers","contributors_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/contributors","subscribers_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/subscribers","subscription_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/subscription","commits_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/comments/{number}","contents_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/merges","archive_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/downloads","issues_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/releases{/id}","created_at":"2014-12-02T02:44:42Z","updated_at":"2014-12-21T06:13:34Z","pushed_at":"2015-01-01T02:51:23Z","git_url":"git://github.com/18F/analytics-proxy-nodejs.git","ssh_url":"git@github.com:18F/analytics-proxy-nodejs.git","clone_url":"https://github.com/18F/analytics-proxy-nodejs.git","svn_url":"https://github.com/18F/analytics-proxy-nodejs","homepage":null,"size":4724,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":3,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"594a5cb30b6a730d7973529d66280070a89e8115","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":27411729,"name":"analytics-proxy-nodejs","full_name":"18F/analytics-proxy-nodejs","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/analytics-proxy-nodejs","description":"Google Analytics Proxy using nodeJS","fork":false,"url":"https://api.github.com/repos/18F/analytics-proxy-nodejs","forks_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/forks","keys_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/teams","hooks_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/hooks","issue_events_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/events","assignees_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/tags","blobs_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/languages","stargazers_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/stargazers","contributors_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/contributors","subscribers_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/subscribers","subscription_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/subscription","commits_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/comments/{number}","contents_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/merges","archive_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/downloads","issues_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/18F/analytics-proxy-nodejs/releases{/id}","created_at":"2014-12-02T02:44:42Z","updated_at":"2014-12-21T06:13:34Z","pushed_at":"2015-01-01T02:51:23Z","git_url":"git://github.com/18F/analytics-proxy-nodejs.git","ssh_url":"git@github.com:18F/analytics-proxy-nodejs.git","clone_url":"https://github.com/18F/analytics-proxy-nodejs.git","svn_url":"https://github.com/18F/analytics-proxy-nodejs","homepage":null,"size":4724,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7"},"html":{"href":"https://github.com/18F/analytics-proxy-nodejs/pull/7"},"issue":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/7"},"comments":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/18F/analytics-proxy-nodejs/statuses/7e146b2ab1f5d19c2772538d8b2b8c808c17d58d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":10,"additions":96,"deletions":41793,"changed_files":1599}}