{"action":"created","comment":{"url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/comments/192756332","pull_request_review_id":125592631,"id":192756332,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mjc1NjMzMg==","diff_hunk":"@@ -0,0 +1,26 @@\n+import re\n+import requests\n+from bs4 import BeautifulSoup\n+\n+PIXNET_BLOG_RANKING_PAGE = 'https://pixranking.events.pixnet.net/ranking/'\n+\n+\n+def get_user_ids(category, page, period):\n+    \"\"\"Get user ID of top ranked blogs.\n+\n+    ategory - category ID (int)\n+    page - given page, 100 blogs per page (int)\n+    period - ranking period, Y-m-d (str)\n+\n+    return user_id (str)\n+    \"\"\"\n+    result = requests.post(PIXNET_BLOG_RANKING_PAGE, data={'category': category, 'page': page, 'period': period})\n+\n+    soup = BeautifulSoup(result.text, 'html.parser')\n+    blog_user_name = soup.find_all(id='blogUserName')\n+    blog_links = [name['href'] for name in blog_user_name if 'blog' in name['href']]\n+\n+    for link in blog_links:\n+        user_id.append(re.sub(r'http://|/blog|\\.pixnet\\.net|www\\.|\\.tw|\\.com|', '', link))\n+\n+    return user_id","path":"get_user_id.py","position":null,"original_position":26,"commit_id":"e67151832c73cc16f5e99991a17c7c05f7ef597b","original_commit_id":"e3484b37d79a9268362b0845f9c96cbdf3da8900","user":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"body":"不然有什麼比較好的寫法？","created_at":"2018-06-04T14:18:18Z","updated_at":"2018-06-04T14:18:18Z","html_url":"https://github.com/shannywu/pixnet-crawler/pull/1#discussion_r192756332","pull_request_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/comments/192756332"},"html":{"href":"https://github.com/shannywu/pixnet-crawler/pull/1#discussion_r192756332"},"pull_request":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1"}},"in_reply_to_id":192563386},"pull_request":{"url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1","id":192204540,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjA0NTQw","html_url":"https://github.com/shannywu/pixnet-crawler/pull/1","diff_url":"https://github.com/shannywu/pixnet-crawler/pull/1.diff","patch_url":"https://github.com/shannywu/pixnet-crawler/pull/1.patch","issue_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/1","number":1,"state":"open","locked":false,"title":"Add get user_id and articles","user":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"body":"- get user id through PIXNET ranking page\r\n- get articles of each user","created_at":"2018-06-02T15:58:49Z","updated_at":"2018-06-04T14:18:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0934202550b1412ab23a82809e38ee1deb48f75d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1/commits","review_comments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1/comments","review_comment_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/1/comments","statuses_url":"https://api.github.com/repos/shannywu/pixnet-crawler/statuses/e67151832c73cc16f5e99991a17c7c05f7ef597b","head":{"label":"shannywu:dev","ref":"dev","sha":"e67151832c73cc16f5e99991a17c7c05f7ef597b","user":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"repo":{"id":135831227,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU4MzEyMjc=","name":"pixnet-crawler","full_name":"shannywu/pixnet-crawler","owner":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shannywu/pixnet-crawler","description":null,"fork":false,"url":"https://api.github.com/repos/shannywu/pixnet-crawler","forks_url":"https://api.github.com/repos/shannywu/pixnet-crawler/forks","keys_url":"https://api.github.com/repos/shannywu/pixnet-crawler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shannywu/pixnet-crawler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shannywu/pixnet-crawler/teams","hooks_url":"https://api.github.com/repos/shannywu/pixnet-crawler/hooks","issue_events_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/events{/number}","events_url":"https://api.github.com/repos/shannywu/pixnet-crawler/events","assignees_url":"https://api.github.com/repos/shannywu/pixnet-crawler/assignees{/user}","branches_url":"https://api.github.com/repos/shannywu/pixnet-crawler/branches{/branch}","tags_url":"https://api.github.com/repos/shannywu/pixnet-crawler/tags","blobs_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/refs{/sha}","trees_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shannywu/pixnet-crawler/statuses/{sha}","languages_url":"https://api.github.com/repos/shannywu/pixnet-crawler/languages","stargazers_url":"https://api.github.com/repos/shannywu/pixnet-crawler/stargazers","contributors_url":"https://api.github.com/repos/shannywu/pixnet-crawler/contributors","subscribers_url":"https://api.github.com/repos/shannywu/pixnet-crawler/subscribers","subscription_url":"https://api.github.com/repos/shannywu/pixnet-crawler/subscription","commits_url":"https://api.github.com/repos/shannywu/pixnet-crawler/commits{/sha}","git_commits_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/commits{/sha}","comments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/comments{/number}","issue_comment_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/comments{/number}","contents_url":"https://api.github.com/repos/shannywu/pixnet-crawler/contents/{+path}","compare_url":"https://api.github.com/repos/shannywu/pixnet-crawler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shannywu/pixnet-crawler/merges","archive_url":"https://api.github.com/repos/shannywu/pixnet-crawler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shannywu/pixnet-crawler/downloads","issues_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues{/number}","pulls_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls{/number}","milestones_url":"https://api.github.com/repos/shannywu/pixnet-crawler/milestones{/number}","notifications_url":"https://api.github.com/repos/shannywu/pixnet-crawler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shannywu/pixnet-crawler/labels{/name}","releases_url":"https://api.github.com/repos/shannywu/pixnet-crawler/releases{/id}","deployments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/deployments","created_at":"2018-06-02T15:51:56Z","updated_at":"2018-06-02T15:51:58Z","pushed_at":"2018-06-04T14:16:43Z","git_url":"git://github.com/shannywu/pixnet-crawler.git","ssh_url":"git@github.com:shannywu/pixnet-crawler.git","clone_url":"https://github.com/shannywu/pixnet-crawler.git","svn_url":"https://github.com/shannywu/pixnet-crawler","homepage":null,"size":3,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"shannywu:master","ref":"master","sha":"a6f1bb54608d58dd58558a6b166015f7f94ae095","user":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"repo":{"id":135831227,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU4MzEyMjc=","name":"pixnet-crawler","full_name":"shannywu/pixnet-crawler","owner":{"login":"shannywu","id":5529272,"node_id":"MDQ6VXNlcjU1MjkyNzI=","avatar_url":"https://avatars1.githubusercontent.com/u/5529272?v=4","gravatar_id":"","url":"https://api.github.com/users/shannywu","html_url":"https://github.com/shannywu","followers_url":"https://api.github.com/users/shannywu/followers","following_url":"https://api.github.com/users/shannywu/following{/other_user}","gists_url":"https://api.github.com/users/shannywu/gists{/gist_id}","starred_url":"https://api.github.com/users/shannywu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shannywu/subscriptions","organizations_url":"https://api.github.com/users/shannywu/orgs","repos_url":"https://api.github.com/users/shannywu/repos","events_url":"https://api.github.com/users/shannywu/events{/privacy}","received_events_url":"https://api.github.com/users/shannywu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shannywu/pixnet-crawler","description":null,"fork":false,"url":"https://api.github.com/repos/shannywu/pixnet-crawler","forks_url":"https://api.github.com/repos/shannywu/pixnet-crawler/forks","keys_url":"https://api.github.com/repos/shannywu/pixnet-crawler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shannywu/pixnet-crawler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shannywu/pixnet-crawler/teams","hooks_url":"https://api.github.com/repos/shannywu/pixnet-crawler/hooks","issue_events_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/events{/number}","events_url":"https://api.github.com/repos/shannywu/pixnet-crawler/events","assignees_url":"https://api.github.com/repos/shannywu/pixnet-crawler/assignees{/user}","branches_url":"https://api.github.com/repos/shannywu/pixnet-crawler/branches{/branch}","tags_url":"https://api.github.com/repos/shannywu/pixnet-crawler/tags","blobs_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/refs{/sha}","trees_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shannywu/pixnet-crawler/statuses/{sha}","languages_url":"https://api.github.com/repos/shannywu/pixnet-crawler/languages","stargazers_url":"https://api.github.com/repos/shannywu/pixnet-crawler/stargazers","contributors_url":"https://api.github.com/repos/shannywu/pixnet-crawler/contributors","subscribers_url":"https://api.github.com/repos/shannywu/pixnet-crawler/subscribers","subscription_url":"https://api.github.com/repos/shannywu/pixnet-crawler/subscription","commits_url":"https://api.github.com/repos/shannywu/pixnet-crawler/commits{/sha}","git_commits_url":"https://api.github.com/repos/shannywu/pixnet-crawler/git/commits{/sha}","comments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/comments{/number}","issue_comment_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/comments{/number}","contents_url":"https://api.github.com/repos/shannywu/pixnet-crawler/contents/{+path}","compare_url":"https://api.github.com/repos/shannywu/pixnet-crawler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shannywu/pixnet-crawler/merges","archive_url":"https://api.github.com/repos/shannywu/pixnet-crawler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shannywu/pixnet-crawler/downloads","issues_url":"https://api.github.com/repos/shannywu/pixnet-crawler/issues{/number}","pulls_url":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls{/number}","milestones_url":"https://api.github.com/repos/shannywu/pixnet-crawler/milestones{/number}","notifications_url":"https://api.github.com/repos/shannywu/pixnet-crawler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shannywu/pixnet-crawler/labels{/name}","releases_url":"https://api.github.com/repos/shannywu/pixnet-crawler/releases{/id}","deployments_url":"https://api.github.com/repos/shannywu/pixnet-crawler/deployments","created_at":"2018-06-02T15:51:56Z","updated_at":"2018-06-02T15:51:58Z","pushed_at":"2018-06-04T14:16:43Z","git_url":"git://github.com/shannywu/pixnet-crawler.git","ssh_url":"git@github.com:shannywu/pixnet-crawler.git","clone_url":"https://github.com/shannywu/pixnet-crawler.git","svn_url":"https://github.com/shannywu/pixnet-crawler","homepage":null,"size":3,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1"},"html":{"href":"https://github.com/shannywu/pixnet-crawler/pull/1"},"issue":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/1"},"comments":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/shannywu/pixnet-crawler/statuses/e67151832c73cc16f5e99991a17c7c05f7ef597b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"shannywu"}}