json_metadata | "{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":115948769,"name":"nowplaying","full_name":"alex-osman/nowplaying","html_url":"https://github.com/alex-osman/nowplaying","fork":false,"owner":{"login":"alex-osman"}},"pullRequests":[{"url":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65","id":184789409,"html_url":"https://github.com/alex-osman/nowplaying/pull/65","diff_url":"https://github.com/alex-osman/nowplaying/pull/65.diff","patch_url":"https://github.com/alex-osman/nowplaying/pull/65.patch","issue_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/65","number":65,"state":"closed","locked":false,"title":"Spotify stabilizing and error handling","user":{"login":"alex-osman","id":9692067,"avatar_url":"https://avatars2.githubusercontent.com/u/9692067?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-osman","html_url":"https://github.com/alex-osman","followers_url":"https://api.github.com/users/alex-osman/followers","following_url":"https://api.github.com/users/alex-osman/following{/other_user}","gists_url":"https://api.github.com/users/alex-osman/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-osman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-osman/subscriptions","organizations_url":"https://api.github.com/users/alex-osman/orgs","repos_url":"https://api.github.com/users/alex-osman/repos","events_url":"https://api.github.com/users/alex-osman/events{/privacy}","received_events_url":"https://api.github.com/users/alex-osman/received_events","type":"User","site_admin":false},"body":"### New Features\r\n#### Waiting 20 seconds between posts\r\nThis pull request stabilizes and cleans up the code relating to the spotify-reply integration. Rather than reading and processing all comments asynchronously, the code now runs through each reply synchronously and pauses 20 seconds between replies.\r\n\r\nBefore:\r\n\r\n\r\nAfter:\r\n\r\n\r\n#### Approaches\r\nThe simplest approach would be to delay each run by 20 seconds. However, that means if we have 20 contestants it would take 20*20 = 2 minutes and 40 seconds to read the replies. 50 contestants would be 16 minutes and 40 seconds. This approach does not scale well.\r\n\r\nI could asynchornously loop through all replies and separate out the ones that nowplaying needs to respond to. Then I could synchronously loop through the list and reply with a delay between each. This takes 20 seconds per post we have to respond to, and we can't do any better than that with steem's limitations.\r\n\r\nWhat I chose to do was a synchronous for loop\r\n```\r\n for (const post of authorReplies) {\r\n await someFunction()\r\n}\r\n```\r\nI have never experimented with the `for-of` loop before - it's very concise and easy to use. It is comparable to `.forEach` except that it runs in sequence, meaning we can `return` or `break` or `continue`. And if you throw an `await` in there, it will wait for it to resolve before continuing. \r\n\r\n### Next Steps\r\nThere is still more to be done regarding spotify replies. Right now spotify supports an \"artist search\" and a \"track search\". I have been using \"track search\" with `${artistName} ${trackName}` which gives pretty good results. This needs to be smarter, and should probably use \"track search\" with `${trackName}` and then search the tracks for an artist name that's similar to `${artistName}`.\r\n\r\nThere is also a bit of a \"bug\" with the current week. If I run the bot today and do not touch it, it will always think it's week 17. This means that posts are approved if they upvoted week 17's post, not the current weeks post. This became very obvious when one user missed a week that I ran the bot, and participated in the next two weeks. Because she did not upvoted the post in which the bot was running, her posts were never getting approved even though she upvoted the next weekly posts.\r\n\r\n### Now Playing\r\nCheck out the #nowplaying community and bot in action [here](https://steemit.com/nowplaying/@nowplaying-music/nowplaying-week-13)\r\n","created_at":"2018-04-28T14:42:41Z","updated_at":"2018-04-28T15:15:22Z","closed_at":"2018-04-28T15:15:22Z","merged_at":"2018-04-28T15:15:22Z","merge_commit_sha":"5da7926b63487bf50045b79a0f169d26716516d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65/commits","review_comments_url":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65/comments","review_comment_url":"https://api.github.com/repos/alex-osman/nowplaying/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/65/comments","statuses_url":"https://api.github.com/repos/alex-osman/nowplaying/statuses/14d30c7425e897f9c1ea792d19b42758d2413c90","head":{"label":"alex-osman:spotify-error-handling","ref":"spotify-error-handling","sha":"14d30c7425e897f9c1ea792d19b42758d2413c90","user":{"login":"alex-osman","id":9692067,"avatar_url":"https://avatars2.githubusercontent.com/u/9692067?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-osman","html_url":"https://github.com/alex-osman","followers_url":"https://api.github.com/users/alex-osman/followers","following_url":"https://api.github.com/users/alex-osman/following{/other_user}","gists_url":"https://api.github.com/users/alex-osman/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-osman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-osman/subscriptions","organizations_url":"https://api.github.com/users/alex-osman/orgs","repos_url":"https://api.github.com/users/alex-osman/repos","events_url":"https://api.github.com/users/alex-osman/events{/privacy}","received_events_url":"https://api.github.com/users/alex-osman/received_events","type":"User","site_admin":false},"repo":{"id":115948769,"name":"nowplaying","full_name":"alex-osman/nowplaying","owner":{"login":"alex-osman","id":9692067,"avatar_url":"https://avatars2.githubusercontent.com/u/9692067?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-osman","html_url":"https://github.com/alex-osman","followers_url":"https://api.github.com/users/alex-osman/followers","following_url":"https://api.github.com/users/alex-osman/following{/other_user}","gists_url":"https://api.github.com/users/alex-osman/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-osman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-osman/subscriptions","organizations_url":"https://api.github.com/users/alex-osman/orgs","repos_url":"https://api.github.com/users/alex-osman/repos","events_url":"https://api.github.com/users/alex-osman/events{/privacy}","received_events_url":"https://api.github.com/users/alex-osman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alex-osman/nowplaying","description":"Steemit Now Playing Repo","fork":false,"url":"https://api.github.com/repos/alex-osman/nowplaying","forks_url":"https://api.github.com/repos/alex-osman/nowplaying/forks","keys_url":"https://api.github.com/repos/alex-osman/nowplaying/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alex-osman/nowplaying/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alex-osman/nowplaying/teams","hooks_url":"https://api.github.com/repos/alex-osman/nowplaying/hooks","issue_events_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/events{/number}","events_url":"https://api.github.com/repos/alex-osman/nowplaying/events","assignees_url":"https://api.github.com/repos/alex-osman/nowplaying/assignees{/user}","branches_url":"https://api.github.com/repos/alex-osman/nowplaying/branches{/branch}","tags_url":"https://api.github.com/repos/alex-osman/nowplaying/tags","blobs_url":"https://api.github.com/repos/alex-osman/nowplaying/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alex-osman/nowplaying/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alex-osman/nowplaying/git/refs{/sha}","trees_url":"https://api.github.com/repos/alex-osman/nowplaying/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alex-osman/nowplaying/statuses/{sha}","languages_url":"https://api.github.com/repos/alex-osman/nowplaying/languages","stargazers_url":"https://api.github.com/repos/alex-osman/nowplaying/stargazers","contributors_url":"https://api.github.com/repos/alex-osman/nowplaying/contributors","subscribers_url":"https://api.github.com/repos/alex-osman/nowplaying/subscribers","subscription_url":"https://api.github.com/repos/alex-osman/nowplaying/subscription","commits_url":"https://api.github.com/repos/alex-osman/nowplaying/commits{/sha}","git_commits_url":"https://api.github.com/repos/alex-osman/nowplaying/git/commits{/sha}","comments_url":"https://api.github.com/repos/alex-osman/nowplaying/comments{/number}","issue_comment_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/comments{/number}","contents_url":"https://api.github.com/repos/alex-osman/nowplaying/contents/{+path}","compare_url":"https://api.github.com/repos/alex-osman/nowplaying/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alex-osman/nowplaying/merges","archive_url":"https://api.github.com/repos/alex-osman/nowplaying/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alex-osman/nowplaying/downloads","issues_url":"https://api.github.com/repos/alex-osman/nowplaying/issues{/number}","pulls_url":"https://api.github.com/repos/alex-osman/nowplaying/pulls{/number}","milestones_url":"https://api.github.com/repos/alex-osman/nowplaying/milestones{/number}","notifications_url":"https://api.github.com/repos/alex-osman/nowplaying/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alex-osman/nowplaying/labels{/name}","releases_url":"https://api.github.com/repos/alex-osman/nowplaying/releases{/id}","deployments_url":"https://api.github.com/repos/alex-osman/nowplaying/deployments","created_at":"2018-01-01T21:21:17Z","updated_at":"2018-04-28T15:15:24Z","pushed_at":"2018-04-28T15:15:22Z","git_url":"git://github.com/alex-osman/nowplaying.git","ssh_url":"git@github.com:alex-osman/nowplaying.git","clone_url":"https://github.com/alex-osman/nowplaying.git","svn_url":"https://github.com/alex-osman/nowplaying","homepage":null,"size":206,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","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":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":29,"watchers":2,"default_branch":"master"}},"base":{"label":"alex-osman:master","ref":"master","sha":"967090d1e848c741da32dce1a282e2a7e80ec12f","user":{"login":"alex-osman","id":9692067,"avatar_url":"https://avatars2.githubusercontent.com/u/9692067?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-osman","html_url":"https://github.com/alex-osman","followers_url":"https://api.github.com/users/alex-osman/followers","following_url":"https://api.github.com/users/alex-osman/following{/other_user}","gists_url":"https://api.github.com/users/alex-osman/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-osman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-osman/subscriptions","organizations_url":"https://api.github.com/users/alex-osman/orgs","repos_url":"https://api.github.com/users/alex-osman/repos","events_url":"https://api.github.com/users/alex-osman/events{/privacy}","received_events_url":"https://api.github.com/users/alex-osman/received_events","type":"User","site_admin":false},"repo":{"id":115948769,"name":"nowplaying","full_name":"alex-osman/nowplaying","owner":{"login":"alex-osman","id":9692067,"avatar_url":"https://avatars2.githubusercontent.com/u/9692067?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-osman","html_url":"https://github.com/alex-osman","followers_url":"https://api.github.com/users/alex-osman/followers","following_url":"https://api.github.com/users/alex-osman/following{/other_user}","gists_url":"https://api.github.com/users/alex-osman/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-osman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-osman/subscriptions","organizations_url":"https://api.github.com/users/alex-osman/orgs","repos_url":"https://api.github.com/users/alex-osman/repos","events_url":"https://api.github.com/users/alex-osman/events{/privacy}","received_events_url":"https://api.github.com/users/alex-osman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alex-osman/nowplaying","description":"Steemit Now Playing Repo","fork":false,"url":"https://api.github.com/repos/alex-osman/nowplaying","forks_url":"https://api.github.com/repos/alex-osman/nowplaying/forks","keys_url":"https://api.github.com/repos/alex-osman/nowplaying/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alex-osman/nowplaying/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alex-osman/nowplaying/teams","hooks_url":"https://api.github.com/repos/alex-osman/nowplaying/hooks","issue_events_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/events{/number}","events_url":"https://api.github.com/repos/alex-osman/nowplaying/events","assignees_url":"https://api.github.com/repos/alex-osman/nowplaying/assignees{/user}","branches_url":"https://api.github.com/repos/alex-osman/nowplaying/branches{/branch}","tags_url":"https://api.github.com/repos/alex-osman/nowplaying/tags","blobs_url":"https://api.github.com/repos/alex-osman/nowplaying/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alex-osman/nowplaying/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alex-osman/nowplaying/git/refs{/sha}","trees_url":"https://api.github.com/repos/alex-osman/nowplaying/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alex-osman/nowplaying/statuses/{sha}","languages_url":"https://api.github.com/repos/alex-osman/nowplaying/languages","stargazers_url":"https://api.github.com/repos/alex-osman/nowplaying/stargazers","contributors_url":"https://api.github.com/repos/alex-osman/nowplaying/contributors","subscribers_url":"https://api.github.com/repos/alex-osman/nowplaying/subscribers","subscription_url":"https://api.github.com/repos/alex-osman/nowplaying/subscription","commits_url":"https://api.github.com/repos/alex-osman/nowplaying/commits{/sha}","git_commits_url":"https://api.github.com/repos/alex-osman/nowplaying/git/commits{/sha}","comments_url":"https://api.github.com/repos/alex-osman/nowplaying/comments{/number}","issue_comment_url":"https://api.github.com/repos/alex-osman/nowplaying/issues/comments{/number}","contents_url":"https://api.github.com/repos/alex-osman/nowplaying/contents/{+path}","compare_url":"https://api.github.com/repos/alex-osman/nowplaying/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alex-osman/nowplaying/merges","archive_url":"https://api.github.com/repos/alex-osman/nowplaying/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alex-osman/nowplaying/downloads","issues_url":"https://api.github.com/repos/alex-osman/nowplaying/issues{/number}","pulls_url":"https://api.github.com/repos/alex-osman/nowplaying/pulls{/number}","milestones_url":"https://api.github.com/repos/alex-osman/nowplaying/milestones{/number}","notifications_url":"https://api.github.com/repos/alex-osman/nowplaying/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alex-osman/nowplaying/labels{/name}","releases_url":"https://api.github.com/repos/alex-osman/nowplaying/releases{/id}","deployments_url":"https://api.github.com/repos/alex-osman/nowplaying/deployments","created_at":"2018-01-01T21:21:17Z","updated_at":"2018-04-28T15:15:24Z","pushed_at":"2018-04-28T15:15:22Z","git_url":"git://github.com/alex-osman/nowplaying.git","ssh_url":"git@github.com:alex-osman/nowplaying.git","clone_url":"https://github.com/alex-osman/nowplaying.git","svn_url":"https://github.com/alex-osman/nowplaying","homepage":null,"size":206,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","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":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":29,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65"},"html":{"href":"https://github.com/alex-osman/nowplaying/pull/65"},"issue":{"href":"https://api.github.com/repos/alex-osman/nowplaying/issues/65"},"comments":{"href":"https://api.github.com/repos/alex-osman/nowplaying/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/alex-osman/nowplaying/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alex-osman/nowplaying/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/alex-osman/nowplaying/statuses/14d30c7425e897f9c1ea792d19b42758d2413c90"}},"author_association":"OWNER"}],"platform":"github","type":"development","tags":["utopian-io","opensource","javascript","typescript","music"],"users":["nowplaying-music"],"links":["https://user-images.githubusercontent.com/9692067/39397708-d5da8eba-4ad1-11e8-8030-6da7bec09e13.png","https://user-images.githubusercontent.com/9692067/39397757-7b9a4a16-4ad2-11e8-8d8d-0eacc118258b.png","https://steemit.com/nowplaying/@nowplaying-music/nowplaying-week-13"],"image":["https://user-images.githubusercontent.com/9692067/39397708-d5da8eba-4ad1-11e8-8030-6da7bec09e13.png","https://user-images.githubusercontent.com/9692067/39397757-7b9a4a16-4ad2-11e8-8d8d-0eacc118258b.png"],"moderator":{"account":"amosbastian","time":"2018-05-01T21:26:34.792Z","pending":false,"reviewed":false,"flagged":true},"questions":null,"score":null,"total_influence":null,"staff_pick":null,"staff_pick_by":null,"config":{"questions":[{"question":"How would you describe the formatting, language and overall presentation of the post?","question_id":"dev-1","answers":[{"answer":"The post is of very high quality.","answer_id":"dev-1-a-1","value":10},{"answer":"The post is of decent quality, but not spectacular in any way.","answer_id":"dev-1-a-2","value":7},{"answer":"The post is poorly written and/or formatted, but readable.","answer_id":"dev-1-a-3","value":3},{"answer":"The post is really hard to read and the content is barely understandable.","answer_id":"dev-1-a-4","value":0}]},{"question":"How would you rate the impact and significance of the contribution to the project and/or open source ecosystem in terms of uniqueness, usefulness and potential future applications?","question_id":"dev-2","answers":[{"answer":"This contribution adds high value and holds great significance for the project and/or open source ecosystem.","answer_id":"dev-2-a-1","value":35},{"answer":"This contribution adds significant value to the project and/or open source ecosystem. ","answer_id":"dev-2-a-2","value":23},{"answer":"This contribution adds some value to the project and/or open source ecosystem.","answer_id":"dev-2-a-3","value":12.5},{"answer":"This contribution hold no value and is insignificant in impact. ","answer_id":"dev-2-a-4","value":0}]},{"question":"How would you rate the total volume of work invested into this contribution?","question_id":"dev-3","answers":[{"answer":"This contribution appears to have demanded a lot of intensive work.","answer_id":"dev-3-a-1","value":20},{"answer":"This contribution appears to have required an average volume of work.","answer_id":"dev-3-a-2","value":14},{"answer":"This contribution shows some work done.","answer_id":"dev-3-a-3","value":6},{"answer":"This contribution shows no work done.","answer_id":"dev-3-a-4","value":0}]},{"question":"How would you rate the quality of the code submitted?","question_id":"dev-4","answers":[{"answer":"High - it follows all best practices. ","answer_id":"dev-4-a-1","value":20},{"answer":"Average - it follows most best practices.","answer_id":"dev-4-a-2","value":14},{"answer":"Low - it follows some best practices.","answer_id":"dev-4-a-3","value":6},{"answer":"Very low - it doesn't follow any best practices. ","answer_id":"dev-4-a-4","value":0}]},{"question":"How would you rate the knowledge and expertise necessary to fix the bug / implement the added feature(s)?","question_id":"dev-5","answers":[{"answer":"High - a lot of research and specific knowledge was required.","answer_id":"dev-5-a-1","value":7.5},{"answer":"Average - some research and knowledge was required.","answer_id":"dev-5-a-2","value":5.25},{"answer":"Low - not much knowledge or skill were required.","answer_id":"dev-5-a-3","value":2.25},{"answer":"Insignificant - no knowledge or skills were necessary.","answer_id":"dev-5-a-4","value":0}]},{"question":"How would you rate the accuracy and readability of the commit messages?","question_id":"dev-6","answers":[{"answer":"High - they are concise, descriptive and consistent. ","answer_id":"dev-6-a-1","value":2.5},{"answer":"Average - they are mostly concise, descriptive and consistent. ","answer_id":"dev-6-a-2","value":2},{"answer":"Low - they could be more concise, descriptive or consistent.","answer_id":"dev-6-a-3","value":0.75},{"answer":"Very low - they aren't concise, descriptive or consistent at all.","answer_id":"dev-6-a-4","value":0}]},{"question":"How do you rate the quality of the comments in the code?","question_id":"dev-7","answers":[{"answer":"High - everything is well-commented and adds to the readability of the code. ","answer_id":"dev-7-a-1","value":5},{"answer":"Average - most of the code is commented and most if it adds to the readability of the code.","answer_id":"dev-7-a-2","value":3},{"answer":"Low - little of the code is commented, but it still adds to the readability.","answer_id":"dev-7-a-3","value":1.5},{"answer":"Very low - the added comments provide no value or are not present at all.","answer_id":"dev-7-a-4","value":0}]}]}}" |
---|