{"action":"created","comment":{"url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/comments/236037142","pull_request_review_id":178042939,"id":236037142,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjAzNzE0Mg==","diff_hunk":"@@ -0,0 +1,8 @@\n+export enum ErrType {","path":"src/common/error.ts","position":1,"original_position":1,"commit_id":"26dacac4ea2dca5dce7d735020bed0fef24cfaef","original_commit_id":"26dacac4ea2dca5dce7d735020bed0fef24cfaef","user":{"login":"pea3nut","id":13781420,"node_id":"MDQ6VXNlcjEzNzgxNDIw","avatar_url":"https://avatars1.githubusercontent.com/u/13781420?v=4","gravatar_id":"","url":"https://api.github.com/users/pea3nut","html_url":"https://github.com/pea3nut","followers_url":"https://api.github.com/users/pea3nut/followers","following_url":"https://api.github.com/users/pea3nut/following{/other_user}","gists_url":"https://api.github.com/users/pea3nut/gists{/gist_id}","starred_url":"https://api.github.com/users/pea3nut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pea3nut/subscriptions","organizations_url":"https://api.github.com/users/pea3nut/orgs","repos_url":"https://api.github.com/users/pea3nut/repos","events_url":"https://api.github.com/users/pea3nut/events{/privacy}","received_events_url":"https://api.github.com/users/pea3nut/received_events","type":"User","site_admin":false},"body":"这东西为啥单独抽个文件？除非能集成 i18n ，否则一个 enum 没必要建立一个文件——它既没状态又没方法","created_at":"2018-11-24T09:33:09Z","updated_at":"2018-11-24T09:42:06Z","html_url":"https://github.com/FoXZilla/Pxer/pull/136#discussion_r236037142","pull_request_url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/comments/236037142"},"html":{"href":"https://github.com/FoXZilla/Pxer/pull/136#discussion_r236037142"},"pull_request":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136"}}},"pull_request":{"url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136","id":231943567,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxOTQzNTY3","html_url":"https://github.com/FoXZilla/Pxer/pull/136","diff_url":"https://github.com/FoXZilla/Pxer/pull/136.diff","patch_url":"https://github.com/FoXZilla/Pxer/pull/136.patch","issue_url":"https://api.github.com/repos/FoXZilla/Pxer/issues/136","number":136,"state":"open","locked":false,"title":"[WIP] nine","user":{"login":"eternal-flame-AD","id":35571479,"node_id":"MDQ6VXNlcjM1NTcxNDc5","avatar_url":"https://avatars3.githubusercontent.com/u/35571479?v=4","gravatar_id":"","url":"https://api.github.com/users/eternal-flame-AD","html_url":"https://github.com/eternal-flame-AD","followers_url":"https://api.github.com/users/eternal-flame-AD/followers","following_url":"https://api.github.com/users/eternal-flame-AD/following{/other_user}","gists_url":"https://api.github.com/users/eternal-flame-AD/gists{/gist_id}","starred_url":"https://api.github.com/users/eternal-flame-AD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternal-flame-AD/subscriptions","organizations_url":"https://api.github.com/users/eternal-flame-AD/orgs","repos_url":"https://api.github.com/users/eternal-flame-AD/repos","events_url":"https://api.github.com/users/eternal-flame-AD/events{/privacy}","received_events_url":"https://api.github.com/users/eternal-flame-AD/received_events","type":"User","site_admin":false},"body":"# Pxer 9 2nd demo\r\n\r\n## Main project structure\r\n```\r\n  src/\r\n    resolvers/\r\n        base.ts //  a single object containing all base resolvers\r\n        sugar.ts //  a single object containing all sugar resolvers\r\n    common/\r\n        error.ts // error type definition\r\n        illusttype.ts            // code for illust type detection\r\n        network.ts              // network request encapsulated\r\n        threadmamager.ts // thread manager\r\n    types.d.ts       // type definitions\r\n    router.ts         // resovler router\r\n    engine.ts        // PxerEngine (main class)\r\n    index.ts          // index file\r\n  test/\r\n    [ClassName]/\r\n       [TestName].ts         // Test with mocha+chai\r\n```\r\n\r\n## Diff from your demo\r\nThis demo is generally based on the structure of `pea3nut/pxer-engine-demo` with a few modifications.\r\n1. Mixin structure is removed. I think this adds excessive complicity to the project and encourages unnecessary coupplings in future development.\r\n1. Main Class(`PxerEngine`) reports results and errors to the front end using an event-based system.\r\n1. Instead of providing only a `callback` callback to resolvers with a lot of overrides. I provided three callbacks(`gotWork` `reportErr` `addTask`). This greatly reduced the difficulty in writing resolvers and resolver workflows would be more self-explanatory as callback function names are just what they are intended to do.\r\n\r\n## Testing\r\nI included a `cli.ts` in the demo so that we could test the package easily. To use `cli.ts`, use the following command:\r\n```bash\r\nenv COOKIE=\"PHPSESSID=xxx;\" ts-node cli.ts (directive) [optional JSON-encoded payload]\r\n```\r\n![Demo GIF](https://user-images.githubusercontent.com/35571479/48964427-e563c080-efe1-11e8-92ad-3c5867810e29.gif)\r\n\r\n## TODO\r\n\r\n- [ ] Improve error definitions and handling\r\n- [ ] Implement more resolvers\r\n- [ ] Unit tests\r\n","created_at":"2018-11-19T11:43:07Z","updated_at":"2018-11-24T09:42:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06af618a532730c1a3c99dc20d14724023f70236","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136/commits","review_comments_url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136/comments","review_comment_url":"https://api.github.com/repos/FoXZilla/Pxer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FoXZilla/Pxer/issues/136/comments","statuses_url":"https://api.github.com/repos/FoXZilla/Pxer/statuses/26dacac4ea2dca5dce7d735020bed0fef24cfaef","head":{"label":"eternal-flame-AD:ef-nine","ref":"ef-nine","sha":"26dacac4ea2dca5dce7d735020bed0fef24cfaef","user":{"login":"eternal-flame-AD","id":35571479,"node_id":"MDQ6VXNlcjM1NTcxNDc5","avatar_url":"https://avatars3.githubusercontent.com/u/35571479?v=4","gravatar_id":"","url":"https://api.github.com/users/eternal-flame-AD","html_url":"https://github.com/eternal-flame-AD","followers_url":"https://api.github.com/users/eternal-flame-AD/followers","following_url":"https://api.github.com/users/eternal-flame-AD/following{/other_user}","gists_url":"https://api.github.com/users/eternal-flame-AD/gists{/gist_id}","starred_url":"https://api.github.com/users/eternal-flame-AD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternal-flame-AD/subscriptions","organizations_url":"https://api.github.com/users/eternal-flame-AD/orgs","repos_url":"https://api.github.com/users/eternal-flame-AD/repos","events_url":"https://api.github.com/users/eternal-flame-AD/events{/privacy}","received_events_url":"https://api.github.com/users/eternal-flame-AD/received_events","type":"User","site_admin":false},"repo":{"id":139577945,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk1Nzc5NDU=","name":"Pxer","full_name":"eternal-flame-AD/Pxer","private":false,"owner":{"login":"eternal-flame-AD","id":35571479,"node_id":"MDQ6VXNlcjM1NTcxNDc5","avatar_url":"https://avatars3.githubusercontent.com/u/35571479?v=4","gravatar_id":"","url":"https://api.github.com/users/eternal-flame-AD","html_url":"https://github.com/eternal-flame-AD","followers_url":"https://api.github.com/users/eternal-flame-AD/followers","following_url":"https://api.github.com/users/eternal-flame-AD/following{/other_user}","gists_url":"https://api.github.com/users/eternal-flame-AD/gists{/gist_id}","starred_url":"https://api.github.com/users/eternal-flame-AD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eternal-flame-AD/subscriptions","organizations_url":"https://api.github.com/users/eternal-flame-AD/orgs","repos_url":"https://api.github.com/users/eternal-flame-AD/repos","events_url":"https://api.github.com/users/eternal-flame-AD/events{/privacy}","received_events_url":"https://api.github.com/users/eternal-flame-AD/received_events","type":"User","site_admin":false},"html_url":"https://github.com/eternal-flame-AD/Pxer","description":"Fork of pea3nut/Pxer. Personal development repository, I may force push occasionally to sync with upstream so please clone from pea3nut/Pxer","fork":true,"url":"https://api.github.com/repos/eternal-flame-AD/Pxer","forks_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/forks","keys_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/teams","hooks_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/hooks","issue_events_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/issues/events{/number}","events_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/events","assignees_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/assignees{/user}","branches_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/branches{/branch}","tags_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/tags","blobs_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/git/refs{/sha}","trees_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/statuses/{sha}","languages_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/languages","stargazers_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/stargazers","contributors_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/contributors","subscribers_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/subscribers","subscription_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/subscription","commits_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/commits{/sha}","git_commits_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/git/commits{/sha}","comments_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/comments{/number}","issue_comment_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/issues/comments{/number}","contents_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/contents/{+path}","compare_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/merges","archive_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/downloads","issues_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/issues{/number}","pulls_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/pulls{/number}","milestones_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/milestones{/number}","notifications_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/labels{/name}","releases_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/releases{/id}","deployments_url":"https://api.github.com/repos/eternal-flame-AD/Pxer/deployments","created_at":"2018-07-03T12:09:23Z","updated_at":"2018-11-11T10:54:50Z","pushed_at":"2018-11-24T04:14:16Z","git_url":"git://github.com/eternal-flame-AD/Pxer.git","ssh_url":"git@github.com:eternal-flame-AD/Pxer.git","clone_url":"https://github.com/eternal-flame-AD/Pxer.git","svn_url":"https://github.com/eternal-flame-AD/Pxer","homepage":"http://pxer.pea3nut.org/","size":3493,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"FoXZilla:ef-nine","ref":"ef-nine","sha":"d5e64ef1db024cbdc9616c3d528453988892cc3a","user":{"login":"FoXZilla","id":36357124,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzU3MTI0","avatar_url":"https://avatars1.githubusercontent.com/u/36357124?v=4","gravatar_id":"","url":"https://api.github.com/users/FoXZilla","html_url":"https://github.com/FoXZilla","followers_url":"https://api.github.com/users/FoXZilla/followers","following_url":"https://api.github.com/users/FoXZilla/following{/other_user}","gists_url":"https://api.github.com/users/FoXZilla/gists{/gist_id}","starred_url":"https://api.github.com/users/FoXZilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FoXZilla/subscriptions","organizations_url":"https://api.github.com/users/FoXZilla/orgs","repos_url":"https://api.github.com/users/FoXZilla/repos","events_url":"https://api.github.com/users/FoXZilla/events{/privacy}","received_events_url":"https://api.github.com/users/FoXZilla/received_events","type":"Organization","site_admin":false},"repo":{"id":48087129,"node_id":"MDEwOlJlcG9zaXRvcnk0ODA4NzEyOQ==","name":"Pxer","full_name":"FoXZilla/Pxer","private":false,"owner":{"login":"FoXZilla","id":36357124,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzU3MTI0","avatar_url":"https://avatars1.githubusercontent.com/u/36357124?v=4","gravatar_id":"","url":"https://api.github.com/users/FoXZilla","html_url":"https://github.com/FoXZilla","followers_url":"https://api.github.com/users/FoXZilla/followers","following_url":"https://api.github.com/users/FoXZilla/following{/other_user}","gists_url":"https://api.github.com/users/FoXZilla/gists{/gist_id}","starred_url":"https://api.github.com/users/FoXZilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FoXZilla/subscriptions","organizations_url":"https://api.github.com/users/FoXZilla/orgs","repos_url":"https://api.github.com/users/FoXZilla/repos","events_url":"https://api.github.com/users/FoXZilla/events{/privacy}","received_events_url":"https://api.github.com/users/FoXZilla/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/FoXZilla/Pxer","description":"人人可用的pixiv.net批量抓图爬虫，纯客户端JavaScript编写","fork":false,"url":"https://api.github.com/repos/FoXZilla/Pxer","forks_url":"https://api.github.com/repos/FoXZilla/Pxer/forks","keys_url":"https://api.github.com/repos/FoXZilla/Pxer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FoXZilla/Pxer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FoXZilla/Pxer/teams","hooks_url":"https://api.github.com/repos/FoXZilla/Pxer/hooks","issue_events_url":"https://api.github.com/repos/FoXZilla/Pxer/issues/events{/number}","events_url":"https://api.github.com/repos/FoXZilla/Pxer/events","assignees_url":"https://api.github.com/repos/FoXZilla/Pxer/assignees{/user}","branches_url":"https://api.github.com/repos/FoXZilla/Pxer/branches{/branch}","tags_url":"https://api.github.com/repos/FoXZilla/Pxer/tags","blobs_url":"https://api.github.com/repos/FoXZilla/Pxer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FoXZilla/Pxer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FoXZilla/Pxer/git/refs{/sha}","trees_url":"https://api.github.com/repos/FoXZilla/Pxer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FoXZilla/Pxer/statuses/{sha}","languages_url":"https://api.github.com/repos/FoXZilla/Pxer/languages","stargazers_url":"https://api.github.com/repos/FoXZilla/Pxer/stargazers","contributors_url":"https://api.github.com/repos/FoXZilla/Pxer/contributors","subscribers_url":"https://api.github.com/repos/FoXZilla/Pxer/subscribers","subscription_url":"https://api.github.com/repos/FoXZilla/Pxer/subscription","commits_url":"https://api.github.com/repos/FoXZilla/Pxer/commits{/sha}","git_commits_url":"https://api.github.com/repos/FoXZilla/Pxer/git/commits{/sha}","comments_url":"https://api.github.com/repos/FoXZilla/Pxer/comments{/number}","issue_comment_url":"https://api.github.com/repos/FoXZilla/Pxer/issues/comments{/number}","contents_url":"https://api.github.com/repos/FoXZilla/Pxer/contents/{+path}","compare_url":"https://api.github.com/repos/FoXZilla/Pxer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FoXZilla/Pxer/merges","archive_url":"https://api.github.com/repos/FoXZilla/Pxer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FoXZilla/Pxer/downloads","issues_url":"https://api.github.com/repos/FoXZilla/Pxer/issues{/number}","pulls_url":"https://api.github.com/repos/FoXZilla/Pxer/pulls{/number}","milestones_url":"https://api.github.com/repos/FoXZilla/Pxer/milestones{/number}","notifications_url":"https://api.github.com/repos/FoXZilla/Pxer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FoXZilla/Pxer/labels{/name}","releases_url":"https://api.github.com/repos/FoXZilla/Pxer/releases{/id}","deployments_url":"https://api.github.com/repos/FoXZilla/Pxer/deployments","created_at":"2015-12-16T04:21:26Z","updated_at":"2018-11-23T13:54:11Z","pushed_at":"2018-11-24T04:14:18Z","git_url":"git://github.com/FoXZilla/Pxer.git","ssh_url":"git@github.com:FoXZilla/Pxer.git","clone_url":"https://github.com/FoXZilla/Pxer.git","svn_url":"https://github.com/FoXZilla/Pxer","homepage":"http://pxer.pea3nut.org/","size":3436,"stargazers_count":390,"watchers_count":390,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":57,"open_issues":19,"watchers":390,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136"},"html":{"href":"https://github.com/FoXZilla/Pxer/pull/136"},"issue":{"href":"https://api.github.com/repos/FoXZilla/Pxer/issues/136"},"comments":{"href":"https://api.github.com/repos/FoXZilla/Pxer/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FoXZilla/Pxer/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/FoXZilla/Pxer/statuses/26dacac4ea2dca5dce7d735020bed0fef24cfaef"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pea3nut"}}