{"action":"created","comment":{"url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/comments/76828054","id":76828054,"diff_hunk":"@@ -0,0 +1,118 @@\n+#!/bin/bash\n+#\n+#  load_reviews\n+#  Copyright(c) 2016 Bitergia\n+#  Author: Bitergia <fiware-testing@bitergia.com>\n+#  MIT Licensed\n+#\n+#  load reviews subcommand for TourGuide CLI.\n+#\n+\n+load_reviews_wait=0\n+restaurant_name=\"\"\n+limit=0\n+feeder_params=\"\"\n+from_date=\"\"\n+to_date=\"\"\n+\n+function submodule_help () {\n+    cat <<EOF >&2\n+Usage: ${appname} load reviews [-h | --help] [-w | --wait] [-r <name> | --restaurant <name>]\n+                                    [-l <n> | --limit <n>] [-o <name> | --organization <name>]\n+\n+Create reviews for the loaded restaurants.\n+\n+Command options:\n+\n+  -h  --help                 Show this help.\n+  -w  --wait                 Wait for the tourguide container to be ready.\n+                             Default is to exit if tourguide container is not ready.\n+  -r  --restaurant <name>    Create a review for a single restaurant using its <name>.\n+                             Default is to create reviews for all available restaurants.\n+  -l  --limit <n>            Limit the number of reviews to load per restaurant to <n>.\n+                             Default is 1 review per restaurant.\n+  -o  --organization <name>  Create reviews for all the restaurants of a given organization.\n+                             Default is to create reviews for all available restaurants.\n+\n+EOF\n+    exit 0\n+}\n+\n+function submodule_options () {\n+    TEMP=`getopt -o hwr:l:o: -l help,wait,restaurant:,limit:,organization: -- \"$@\"`\n+\n+    if test \"$?\" -ne 0 ; then\n+        submodule_help\n+    fi\n+\n+    eval set -- \"$TEMP\"\n+\n+    while true ; do\n+        case \"$1\" in\n+            \"-h\" | \"--help\" )\n+                submodule_help\n+                ;;\n+            \"-w\" | \"--wait\")\n+                shift\n+                load_reviews_wait=1\n+                ;;\n+            \"-r\" | \"--restaurant\")\n+                shift\n+                restaurant_name=$1\n+                ;;\n+            \"-l\" | \"--limit\")\n+                shift\n+                limit=$1\n+                ;;\n+            \"-o\" | \"--organization\")\n+                shift\n+                organization_name=$1\n+                ;;\n+            --|*)\n+                break;\n+                ;;\n+        esac\n+        shift\n+    done\n+    shift\n+\n+    if [ $# -gt 0 ]; then\n+        echo \"Unknown parameters: $@\"\n+        submodule_help\n+    fi\n+\n+    [ ${limit} -gt 0 ] && feeder_params=\"${feeder_params} --numberOfReviews ${limit}\"\n+    [ ! -z \"${restaurant_name}\" ] && feeder_params=\"${feeder_params} --restaurant '${restaurant_name}'\"","path":"cli/load_reviews","position":null,"original_position":85,"commit_id":"bd0e13ec887a4b50f1c02c6de6afcbaf07f96e15","original_commit_id":"d191d0b27b00f1c427e9491c7e3ff3f7b1192ae1","user":{"login":"dmabtrg","id":9825857,"avatar_url":"https://avatars.githubusercontent.com/u/9825857?v=3","gravatar_id":"","url":"https://api.github.com/users/dmabtrg","html_url":"https://github.com/dmabtrg","followers_url":"https://api.github.com/users/dmabtrg/followers","following_url":"https://api.github.com/users/dmabtrg/following{/other_user}","gists_url":"https://api.github.com/users/dmabtrg/gists{/gist_id}","starred_url":"https://api.github.com/users/dmabtrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmabtrg/subscriptions","organizations_url":"https://api.github.com/users/dmabtrg/orgs","repos_url":"https://api.github.com/users/dmabtrg/repos","events_url":"https://api.github.com/users/dmabtrg/events{/privacy}","received_events_url":"https://api.github.com/users/dmabtrg/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2016-08-30T16:15:03Z","updated_at":"2016-08-30T16:15:03Z","html_url":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130#discussion_r76828054","pull_request_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130","_links":{"self":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/comments/76828054"},"html":{"href":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130#discussion_r76828054"},"pull_request":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130"}}},"pull_request":{"url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130","id":82902189,"html_url":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130","diff_url":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130.diff","patch_url":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130.patch","issue_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/130","number":130,"state":"open","locked":false,"title":"CLI: Add load commands","user":{"login":"dmabtrg","id":9825857,"avatar_url":"https://avatars.githubusercontent.com/u/9825857?v=3","gravatar_id":"","url":"https://api.github.com/users/dmabtrg","html_url":"https://github.com/dmabtrg","followers_url":"https://api.github.com/users/dmabtrg/followers","following_url":"https://api.github.com/users/dmabtrg/following{/other_user}","gists_url":"https://api.github.com/users/dmabtrg/gists{/gist_id}","starred_url":"https://api.github.com/users/dmabtrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmabtrg/subscriptions","organizations_url":"https://api.github.com/users/dmabtrg/orgs","repos_url":"https://api.github.com/users/dmabtrg/repos","events_url":"https://api.github.com/users/dmabtrg/events{/privacy}","received_events_url":"https://api.github.com/users/dmabtrg/received_events","type":"User","site_admin":false},"body":"This PR adds the `load`, `load restaurants`, `load reservations` and `load reviews` commands to the CLI. This PR depends on both #127 and #122.\r\n\r\nThese commands allows the user to load sample data for use in TourGuide-App.","created_at":"2016-08-26T14:56:13Z","updated_at":"2016-08-30T16:15:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cd8c62d73630ab8ec65d9fc2063342f056eb27b","assignee":{"login":"FiwareULPGC","id":9944828,"avatar_url":"https://avatars.githubusercontent.com/u/9944828?v=3","gravatar_id":"","url":"https://api.github.com/users/FiwareULPGC","html_url":"https://github.com/FiwareULPGC","followers_url":"https://api.github.com/users/FiwareULPGC/followers","following_url":"https://api.github.com/users/FiwareULPGC/following{/other_user}","gists_url":"https://api.github.com/users/FiwareULPGC/gists{/gist_id}","starred_url":"https://api.github.com/users/FiwareULPGC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FiwareULPGC/subscriptions","organizations_url":"https://api.github.com/users/FiwareULPGC/orgs","repos_url":"https://api.github.com/users/FiwareULPGC/repos","events_url":"https://api.github.com/users/FiwareULPGC/events{/privacy}","received_events_url":"https://api.github.com/users/FiwareULPGC/received_events","type":"User","site_admin":false},"assignees":[{"login":"FiwareULPGC","id":9944828,"avatar_url":"https://avatars.githubusercontent.com/u/9944828?v=3","gravatar_id":"","url":"https://api.github.com/users/FiwareULPGC","html_url":"https://github.com/FiwareULPGC","followers_url":"https://api.github.com/users/FiwareULPGC/followers","following_url":"https://api.github.com/users/FiwareULPGC/following{/other_user}","gists_url":"https://api.github.com/users/FiwareULPGC/gists{/gist_id}","starred_url":"https://api.github.com/users/FiwareULPGC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FiwareULPGC/subscriptions","organizations_url":"https://api.github.com/users/FiwareULPGC/orgs","repos_url":"https://api.github.com/users/FiwareULPGC/repos","events_url":"https://api.github.com/users/FiwareULPGC/events{/privacy}","received_events_url":"https://api.github.com/users/FiwareULPGC/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130/commits","review_comments_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130/comments","review_comment_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/130/comments","statuses_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/statuses/bd0e13ec887a4b50f1c02c6de6afcbaf07f96e15","head":{"label":"dmabtrg:feature/cli-load","ref":"feature/cli-load","sha":"bd0e13ec887a4b50f1c02c6de6afcbaf07f96e15","user":{"login":"dmabtrg","id":9825857,"avatar_url":"https://avatars.githubusercontent.com/u/9825857?v=3","gravatar_id":"","url":"https://api.github.com/users/dmabtrg","html_url":"https://github.com/dmabtrg","followers_url":"https://api.github.com/users/dmabtrg/followers","following_url":"https://api.github.com/users/dmabtrg/following{/other_user}","gists_url":"https://api.github.com/users/dmabtrg/gists{/gist_id}","starred_url":"https://api.github.com/users/dmabtrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmabtrg/subscriptions","organizations_url":"https://api.github.com/users/dmabtrg/orgs","repos_url":"https://api.github.com/users/dmabtrg/repos","events_url":"https://api.github.com/users/dmabtrg/events{/privacy}","received_events_url":"https://api.github.com/users/dmabtrg/received_events","type":"User","site_admin":false},"repo":{"id":52870394,"name":"tutorials.TourGuide-App","full_name":"dmabtrg/tutorials.TourGuide-App","owner":{"login":"dmabtrg","id":9825857,"avatar_url":"https://avatars.githubusercontent.com/u/9825857?v=3","gravatar_id":"","url":"https://api.github.com/users/dmabtrg","html_url":"https://github.com/dmabtrg","followers_url":"https://api.github.com/users/dmabtrg/followers","following_url":"https://api.github.com/users/dmabtrg/following{/other_user}","gists_url":"https://api.github.com/users/dmabtrg/gists{/gist_id}","starred_url":"https://api.github.com/users/dmabtrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmabtrg/subscriptions","organizations_url":"https://api.github.com/users/dmabtrg/orgs","repos_url":"https://api.github.com/users/dmabtrg/repos","events_url":"https://api.github.com/users/dmabtrg/events{/privacy}","received_events_url":"https://api.github.com/users/dmabtrg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmabtrg/tutorials.TourGuide-App","description":"FIWARE Tour Guide Application. See http://bit.ly/1pby3WP","fork":true,"url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App","forks_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/forks","keys_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/teams","hooks_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/hooks","issue_events_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/issues/events{/number}","events_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/events","assignees_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/assignees{/user}","branches_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/branches{/branch}","tags_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/tags","blobs_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/statuses/{sha}","languages_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/languages","stargazers_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/stargazers","contributors_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/contributors","subscribers_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/subscribers","subscription_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/subscription","commits_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/contents/{+path}","compare_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/merges","archive_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/downloads","issues_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/issues{/number}","pulls_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/pulls{/number}","milestones_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/milestones{/number}","notifications_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/labels{/name}","releases_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/releases{/id}","deployments_url":"https://api.github.com/repos/dmabtrg/tutorials.TourGuide-App/deployments","created_at":"2016-03-01T11:00:27Z","updated_at":"2016-03-01T11:00:28Z","pushed_at":"2016-08-30T16:14:20Z","git_url":"git://github.com/dmabtrg/tutorials.TourGuide-App.git","ssh_url":"git@github.com:dmabtrg/tutorials.TourGuide-App.git","clone_url":"https://github.com/dmabtrg/tutorials.TourGuide-App.git","svn_url":"https://github.com/dmabtrg/tutorials.TourGuide-App","homepage":"","size":9896,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Fiware:develop","ref":"develop","sha":"77307a0e555c626803314e781abb815b34d72045","user":{"login":"Fiware","id":5936803,"avatar_url":"https://avatars.githubusercontent.com/u/5936803?v=3","gravatar_id":"","url":"https://api.github.com/users/Fiware","html_url":"https://github.com/Fiware","followers_url":"https://api.github.com/users/Fiware/followers","following_url":"https://api.github.com/users/Fiware/following{/other_user}","gists_url":"https://api.github.com/users/Fiware/gists{/gist_id}","starred_url":"https://api.github.com/users/Fiware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fiware/subscriptions","organizations_url":"https://api.github.com/users/Fiware/orgs","repos_url":"https://api.github.com/users/Fiware/repos","events_url":"https://api.github.com/users/Fiware/events{/privacy}","received_events_url":"https://api.github.com/users/Fiware/received_events","type":"Organization","site_admin":false},"repo":{"id":38439707,"name":"tutorials.TourGuide-App","full_name":"Fiware/tutorials.TourGuide-App","owner":{"login":"Fiware","id":5936803,"avatar_url":"https://avatars.githubusercontent.com/u/5936803?v=3","gravatar_id":"","url":"https://api.github.com/users/Fiware","html_url":"https://github.com/Fiware","followers_url":"https://api.github.com/users/Fiware/followers","following_url":"https://api.github.com/users/Fiware/following{/other_user}","gists_url":"https://api.github.com/users/Fiware/gists{/gist_id}","starred_url":"https://api.github.com/users/Fiware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fiware/subscriptions","organizations_url":"https://api.github.com/users/Fiware/orgs","repos_url":"https://api.github.com/users/Fiware/repos","events_url":"https://api.github.com/users/Fiware/events{/privacy}","received_events_url":"https://api.github.com/users/Fiware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Fiware/tutorials.TourGuide-App","description":"FIWARE Tour Guide Application. See http://bit.ly/1pby3WP","fork":false,"url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App","forks_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/forks","keys_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/teams","hooks_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/hooks","issue_events_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/events{/number}","events_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/events","assignees_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/assignees{/user}","branches_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/branches{/branch}","tags_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/tags","blobs_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/statuses/{sha}","languages_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/languages","stargazers_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/stargazers","contributors_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/contributors","subscribers_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/subscribers","subscription_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/subscription","commits_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/contents/{+path}","compare_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/merges","archive_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/downloads","issues_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues{/number}","pulls_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls{/number}","milestones_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/milestones{/number}","notifications_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/labels{/name}","releases_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/releases{/id}","deployments_url":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/deployments","created_at":"2015-07-02T15:08:43Z","updated_at":"2016-07-20T14:55:58Z","pushed_at":"2016-08-30T16:14:20Z","git_url":"git://github.com/Fiware/tutorials.TourGuide-App.git","ssh_url":"git@github.com:Fiware/tutorials.TourGuide-App.git","clone_url":"https://github.com/Fiware/tutorials.TourGuide-App.git","svn_url":"https://github.com/Fiware/tutorials.TourGuide-App","homepage":"","size":10507,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":21,"forks":11,"open_issues":21,"watchers":10,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130"},"html":{"href":"https://github.com/Fiware/tutorials.TourGuide-App/pull/130"},"issue":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/130"},"comments":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/issues/130/comments"},"review_comments":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130/comments"},"review_comment":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/pulls/130/commits"},"statuses":{"href":"https://api.github.com/repos/Fiware/tutorials.TourGuide-App/statuses/bd0e13ec887a4b50f1c02c6de6afcbaf07f96e15"}}}}
{"actor":{"display_login":"dmabtrg"}}