{"action":"created","comment":{"url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/comments/68963314","id":68963314,"diff_hunk":"@@ -0,0 +1,34 @@\n+var request = require('request');\n+var osmtogeojson = require('osmtogeojson');\n+var fs = require('fs');\n+var wstream = fs.createWriteStream('bus_stops.json');\n+\n+var fetchCityBusStops = function (name) {\n+ var uri = 'http://overpass-api.de/api/interpreter?data=[out:json][timeout:25];area[\"place\"=\"city\"][\"name:en\"=\"'+name+'\"];(node[\"highway\"=\"bus_stop\"](area););out;';\n+ request(uri, function (err, res, doc) {\n+  if(err){\n+   console.error(err);\n+  }else {\n+   var data = JSON.parse(doc);\n+   var newData = JSON.stringify(osmtogeojson(data));\n+   save(newData);\n+  }\n+ });\n+};\n+\n+var save = function (data) {\n+\n+ wstream.write(data);\n+ wstream.end();\n+\n+ wstream.on('finish', function() {\n+  console.log(\"well done, bus stops add in bus_stops.json\");\n+ });\n+\n+ wstream.on('error', function(err){\n+  console.log(err.stack);\n+ });\n+};\n+\n+//enter the name of the city in english (Hrodna, Minsk..)\n+fetchCityBusStops('Hrodna');","path":"osm.js","position":34,"original_position":34,"commit_id":"9318b5089743cde4524f5f885fef3ca4aa624236","original_commit_id":"9318b5089743cde4524f5f885fef3ca4aa624236","user":{"login":"irnc","id":486101,"avatar_url":"https://avatars.githubusercontent.com/u/486101?v=3","gravatar_id":"","url":"https://api.github.com/users/irnc","html_url":"https://github.com/irnc","followers_url":"https://api.github.com/users/irnc/followers","following_url":"https://api.github.com/users/irnc/following{/other_user}","gists_url":"https://api.github.com/users/irnc/gists{/gist_id}","starred_url":"https://api.github.com/users/irnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irnc/subscriptions","organizations_url":"https://api.github.com/users/irnc/orgs","repos_url":"https://api.github.com/users/irnc/repos","events_url":"https://api.github.com/users/irnc/events{/privacy}","received_events_url":"https://api.github.com/users/irnc/received_events","type":"User","site_admin":false},"body":"This function should be exported, not called, otherwise there is no way to use it outside this module. Please add test which should that this function works and gives expected results using Stream API.","created_at":"2016-06-29T15:05:52Z","updated_at":"2016-06-29T15:05:52Z","html_url":"https://github.com/pub-t/city-bus-stops/pull/4#discussion_r68963314","pull_request_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/comments/68963314"},"html":{"href":"https://github.com/pub-t/city-bus-stops/pull/4#discussion_r68963314"},"pull_request":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4","id":75433979,"html_url":"https://github.com/pub-t/city-bus-stops/pull/4","diff_url":"https://github.com/pub-t/city-bus-stops/pull/4.diff","patch_url":"https://github.com/pub-t/city-bus-stops/pull/4.patch","issue_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/4","number":4,"state":"open","locked":false,"title":"stream API (try 1)","user":{"login":"DimaProkop","id":11046461,"avatar_url":"https://avatars.githubusercontent.com/u/11046461?v=3","gravatar_id":"","url":"https://api.github.com/users/DimaProkop","html_url":"https://github.com/DimaProkop","followers_url":"https://api.github.com/users/DimaProkop/followers","following_url":"https://api.github.com/users/DimaProkop/following{/other_user}","gists_url":"https://api.github.com/users/DimaProkop/gists{/gist_id}","starred_url":"https://api.github.com/users/DimaProkop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DimaProkop/subscriptions","organizations_url":"https://api.github.com/users/DimaProkop/orgs","repos_url":"https://api.github.com/users/DimaProkop/repos","events_url":"https://api.github.com/users/DimaProkop/events{/privacy}","received_events_url":"https://api.github.com/users/DimaProkop/received_events","type":"User","site_admin":false},"body":"Вопрос по [этому](https://github.com/pub-t/city-bus-stops/issues/3) заданию\r\nМне нужно в этом [месте](https://github.com/pub-t/city-bus-stops/compare/dev?expand=1#diff-2d5bbda346ebb54b9745d10f2fb5b1b6R12) конвертировать json в geojson, сижу и туплю как это сделать. делал **.pipe(osmtogeojson)** после чтения, ругается. нужна помощь","created_at":"2016-06-28T08:03:15Z","updated_at":"2016-06-29T15:05:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1749c7113856627e027d273b45c3bbfbf02712f6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4/commits","review_comments_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4/comments","review_comment_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/4/comments","statuses_url":"https://api.github.com/repos/pub-t/city-bus-stops/statuses/9318b5089743cde4524f5f885fef3ca4aa624236","head":{"label":"pub-t:dev","ref":"dev","sha":"9318b5089743cde4524f5f885fef3ca4aa624236","user":{"login":"pub-t","id":19839659,"avatar_url":"https://avatars.githubusercontent.com/u/19839659?v=3","gravatar_id":"","url":"https://api.github.com/users/pub-t","html_url":"https://github.com/pub-t","followers_url":"https://api.github.com/users/pub-t/followers","following_url":"https://api.github.com/users/pub-t/following{/other_user}","gists_url":"https://api.github.com/users/pub-t/gists{/gist_id}","starred_url":"https://api.github.com/users/pub-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pub-t/subscriptions","organizations_url":"https://api.github.com/users/pub-t/orgs","repos_url":"https://api.github.com/users/pub-t/repos","events_url":"https://api.github.com/users/pub-t/events{/privacy}","received_events_url":"https://api.github.com/users/pub-t/received_events","type":"Organization","site_admin":false},"repo":{"id":61117864,"name":"city-bus-stops","full_name":"pub-t/city-bus-stops","owner":{"login":"pub-t","id":19839659,"avatar_url":"https://avatars.githubusercontent.com/u/19839659?v=3","gravatar_id":"","url":"https://api.github.com/users/pub-t","html_url":"https://github.com/pub-t","followers_url":"https://api.github.com/users/pub-t/followers","following_url":"https://api.github.com/users/pub-t/following{/other_user}","gists_url":"https://api.github.com/users/pub-t/gists{/gist_id}","starred_url":"https://api.github.com/users/pub-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pub-t/subscriptions","organizations_url":"https://api.github.com/users/pub-t/orgs","repos_url":"https://api.github.com/users/pub-t/repos","events_url":"https://api.github.com/users/pub-t/events{/privacy}","received_events_url":"https://api.github.com/users/pub-t/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pub-t/city-bus-stops","description":"Get all bus stops for a given city","fork":false,"url":"https://api.github.com/repos/pub-t/city-bus-stops","forks_url":"https://api.github.com/repos/pub-t/city-bus-stops/forks","keys_url":"https://api.github.com/repos/pub-t/city-bus-stops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pub-t/city-bus-stops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pub-t/city-bus-stops/teams","hooks_url":"https://api.github.com/repos/pub-t/city-bus-stops/hooks","issue_events_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/events{/number}","events_url":"https://api.github.com/repos/pub-t/city-bus-stops/events","assignees_url":"https://api.github.com/repos/pub-t/city-bus-stops/assignees{/user}","branches_url":"https://api.github.com/repos/pub-t/city-bus-stops/branches{/branch}","tags_url":"https://api.github.com/repos/pub-t/city-bus-stops/tags","blobs_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/refs{/sha}","trees_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pub-t/city-bus-stops/statuses/{sha}","languages_url":"https://api.github.com/repos/pub-t/city-bus-stops/languages","stargazers_url":"https://api.github.com/repos/pub-t/city-bus-stops/stargazers","contributors_url":"https://api.github.com/repos/pub-t/city-bus-stops/contributors","subscribers_url":"https://api.github.com/repos/pub-t/city-bus-stops/subscribers","subscription_url":"https://api.github.com/repos/pub-t/city-bus-stops/subscription","commits_url":"https://api.github.com/repos/pub-t/city-bus-stops/commits{/sha}","git_commits_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/commits{/sha}","comments_url":"https://api.github.com/repos/pub-t/city-bus-stops/comments{/number}","issue_comment_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/comments{/number}","contents_url":"https://api.github.com/repos/pub-t/city-bus-stops/contents/{+path}","compare_url":"https://api.github.com/repos/pub-t/city-bus-stops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pub-t/city-bus-stops/merges","archive_url":"https://api.github.com/repos/pub-t/city-bus-stops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pub-t/city-bus-stops/downloads","issues_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues{/number}","pulls_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls{/number}","milestones_url":"https://api.github.com/repos/pub-t/city-bus-stops/milestones{/number}","notifications_url":"https://api.github.com/repos/pub-t/city-bus-stops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pub-t/city-bus-stops/labels{/name}","releases_url":"https://api.github.com/repos/pub-t/city-bus-stops/releases{/id}","deployments_url":"https://api.github.com/repos/pub-t/city-bus-stops/deployments","created_at":"2016-06-14T11:36:47Z","updated_at":"2016-06-14T13:34:40Z","pushed_at":"2016-06-29T10:15:54Z","git_url":"git://github.com/pub-t/city-bus-stops.git","ssh_url":"git@github.com:pub-t/city-bus-stops.git","clone_url":"https://github.com/pub-t/city-bus-stops.git","svn_url":"https://github.com/pub-t/city-bus-stops","homepage":null,"size":13,"stargazers_count":1,"watchers_count":1,"language":null,"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":1,"default_branch":"master"}},"base":{"label":"pub-t:master","ref":"master","sha":"51a95162022422febb8446e08c1357f9cac9da68","user":{"login":"pub-t","id":19839659,"avatar_url":"https://avatars.githubusercontent.com/u/19839659?v=3","gravatar_id":"","url":"https://api.github.com/users/pub-t","html_url":"https://github.com/pub-t","followers_url":"https://api.github.com/users/pub-t/followers","following_url":"https://api.github.com/users/pub-t/following{/other_user}","gists_url":"https://api.github.com/users/pub-t/gists{/gist_id}","starred_url":"https://api.github.com/users/pub-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pub-t/subscriptions","organizations_url":"https://api.github.com/users/pub-t/orgs","repos_url":"https://api.github.com/users/pub-t/repos","events_url":"https://api.github.com/users/pub-t/events{/privacy}","received_events_url":"https://api.github.com/users/pub-t/received_events","type":"Organization","site_admin":false},"repo":{"id":61117864,"name":"city-bus-stops","full_name":"pub-t/city-bus-stops","owner":{"login":"pub-t","id":19839659,"avatar_url":"https://avatars.githubusercontent.com/u/19839659?v=3","gravatar_id":"","url":"https://api.github.com/users/pub-t","html_url":"https://github.com/pub-t","followers_url":"https://api.github.com/users/pub-t/followers","following_url":"https://api.github.com/users/pub-t/following{/other_user}","gists_url":"https://api.github.com/users/pub-t/gists{/gist_id}","starred_url":"https://api.github.com/users/pub-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pub-t/subscriptions","organizations_url":"https://api.github.com/users/pub-t/orgs","repos_url":"https://api.github.com/users/pub-t/repos","events_url":"https://api.github.com/users/pub-t/events{/privacy}","received_events_url":"https://api.github.com/users/pub-t/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pub-t/city-bus-stops","description":"Get all bus stops for a given city","fork":false,"url":"https://api.github.com/repos/pub-t/city-bus-stops","forks_url":"https://api.github.com/repos/pub-t/city-bus-stops/forks","keys_url":"https://api.github.com/repos/pub-t/city-bus-stops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pub-t/city-bus-stops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pub-t/city-bus-stops/teams","hooks_url":"https://api.github.com/repos/pub-t/city-bus-stops/hooks","issue_events_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/events{/number}","events_url":"https://api.github.com/repos/pub-t/city-bus-stops/events","assignees_url":"https://api.github.com/repos/pub-t/city-bus-stops/assignees{/user}","branches_url":"https://api.github.com/repos/pub-t/city-bus-stops/branches{/branch}","tags_url":"https://api.github.com/repos/pub-t/city-bus-stops/tags","blobs_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/refs{/sha}","trees_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pub-t/city-bus-stops/statuses/{sha}","languages_url":"https://api.github.com/repos/pub-t/city-bus-stops/languages","stargazers_url":"https://api.github.com/repos/pub-t/city-bus-stops/stargazers","contributors_url":"https://api.github.com/repos/pub-t/city-bus-stops/contributors","subscribers_url":"https://api.github.com/repos/pub-t/city-bus-stops/subscribers","subscription_url":"https://api.github.com/repos/pub-t/city-bus-stops/subscription","commits_url":"https://api.github.com/repos/pub-t/city-bus-stops/commits{/sha}","git_commits_url":"https://api.github.com/repos/pub-t/city-bus-stops/git/commits{/sha}","comments_url":"https://api.github.com/repos/pub-t/city-bus-stops/comments{/number}","issue_comment_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues/comments{/number}","contents_url":"https://api.github.com/repos/pub-t/city-bus-stops/contents/{+path}","compare_url":"https://api.github.com/repos/pub-t/city-bus-stops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pub-t/city-bus-stops/merges","archive_url":"https://api.github.com/repos/pub-t/city-bus-stops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pub-t/city-bus-stops/downloads","issues_url":"https://api.github.com/repos/pub-t/city-bus-stops/issues{/number}","pulls_url":"https://api.github.com/repos/pub-t/city-bus-stops/pulls{/number}","milestones_url":"https://api.github.com/repos/pub-t/city-bus-stops/milestones{/number}","notifications_url":"https://api.github.com/repos/pub-t/city-bus-stops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pub-t/city-bus-stops/labels{/name}","releases_url":"https://api.github.com/repos/pub-t/city-bus-stops/releases{/id}","deployments_url":"https://api.github.com/repos/pub-t/city-bus-stops/deployments","created_at":"2016-06-14T11:36:47Z","updated_at":"2016-06-14T13:34:40Z","pushed_at":"2016-06-29T10:15:54Z","git_url":"git://github.com/pub-t/city-bus-stops.git","ssh_url":"git@github.com:pub-t/city-bus-stops.git","clone_url":"https://github.com/pub-t/city-bus-stops.git","svn_url":"https://github.com/pub-t/city-bus-stops","homepage":null,"size":13,"stargazers_count":1,"watchers_count":1,"language":null,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4"},"html":{"href":"https://github.com/pub-t/city-bus-stops/pull/4"},"issue":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/issues/4"},"comments":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/pub-t/city-bus-stops/statuses/9318b5089743cde4524f5f885fef3ca4aa624236"}}}}
{"actor":{"display_login":"irnc"}}