{"action":"created","comment":{"url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/comments/222285566","pull_request_review_id":161133079,"id":222285566,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjI4NTU2Ng==","diff_hunk":"@@ -0,0 +1,103 @@\n+// Copyright © 2018 NAME HERE <EMAIL ADDRESS>\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package cmd\n+\n+import (\n+\t\"fmt\"\n+\t\"log\"\n+\t\"os\"\n+\n+\t\"github.com/Coderockr/vitrine-social/server/db\"\n+\t\"github.com/Coderockr/vitrine-social/server/db/repo\"\n+\t\"github.com/Coderockr/vitrine-social/server/model\"\n+\t\"github.com/spf13/cobra\"\n+\t\"github.com/thecodenation/go-sitemap-generator/stm\"\n+)\n+\n+// sitemapCmd represents the sitemap command\n+var sitemapCmd = &cobra.Command{\n+\tAliases: []string{\"sitemap\"},\n+\tUse:     \"sitemap-generate\",\n+\tShort:   \"Generate sitemap\",\n+\tRun:     withEnvironment(sitemapFunc),\n+}\n+\n+func init() {\n+\trootCmd.AddCommand(sitemapCmd)\n+}\n+\n+func sitemapFunc(cmd *cobra.Command, args []string) {\n+\tvar o []*model.Organization\n+\tsm := generateSitemap()\n+\n+\tconn, err := db.GetFromEnv()\n+\tif err != nil {\n+\t\tlog.Fatal(err.Error())\n+\t\tos.Exit(1)\n+\t}\n+\n+\trO := repo.NewOrganizationRepository(conn)\n+\trN := repo.NewNeedRepository(conn)\n+\to, err = rO.GetAll()\n+\tif err != nil {\n+\t\tlog.Fatal(err.Error())\n+\t\tos.Exit(1)\n+\t}\n+\tfor _, v := range o {\n+\t\tsm.Add(stm.URL{\"loc\": fmt.Sprintf(\"entidade/%d\", v.ID), \"changefreq\": \"hourly\", \"priority\": 0.8})\n+\t\tn, err := rN.GetOrganizationNeeds(v.ID, \"id\", \"asc\")\n+\t\tif err != nil {\n+\t\t\tlog.Fatal(err.Error())\n+\t\t\tos.Exit(1)\n+\t\t}\n+\t\tfor _, k := range n {\n+\t\t\tsm.Add(stm.URL{\"loc\": fmt.Sprintf(\"%s/detalhes/%d\", os.Getenv(\"FRONTEND_URL\"), k.ID), \"changefreq\": \"hourly\", \"priority\": 0.8})","path":"server/cmd/sitemap.go","position":66,"original_position":66,"commit_id":"70463ee460ae2caf1dda76c2eb1b7ba4636791ee","original_commit_id":"70463ee460ae2caf1dda76c2eb1b7ba4636791ee","user":{"login":"lucassabreu","id":3457213,"node_id":"MDQ6VXNlcjM0NTcyMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/3457213?v=4","gravatar_id":"","url":"https://api.github.com/users/lucassabreu","html_url":"https://github.com/lucassabreu","followers_url":"https://api.github.com/users/lucassabreu/followers","following_url":"https://api.github.com/users/lucassabreu/following{/other_user}","gists_url":"https://api.github.com/users/lucassabreu/gists{/gist_id}","starred_url":"https://api.github.com/users/lucassabreu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucassabreu/subscriptions","organizations_url":"https://api.github.com/users/lucassabreu/orgs","repos_url":"https://api.github.com/users/lucassabreu/repos","events_url":"https://api.github.com/users/lucassabreu/events{/privacy}","received_events_url":"https://api.github.com/users/lucassabreu/received_events","type":"User","site_admin":false},"body":"humm... soh que vcs estão usando JAM Stack ai, quando entra nesse \"http://www.codenation.com.br/journey/frontend/challenge/react-0.html\" tem o conteúdo de verdade... no nosso é soh aquele load do react \"https://vitrinesocial.org/detalhes/122\" (da um curl para ver)... acho nesse caso, se não formos adicionar metadados aqui, seria melhor usar a URL do `shareNeed` (https://api.vitrinesocial.org/v1/need/${needID}/share) que dai vai ter algo para ele olhar","created_at":"2018-10-03T12:17:25Z","updated_at":"2018-10-03T12:17:25Z","html_url":"https://github.com/Coderockr/vitrine-social/pull/306#discussion_r222285566","pull_request_url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/comments/222285566"},"html":{"href":"https://github.com/Coderockr/vitrine-social/pull/306#discussion_r222285566"},"pull_request":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306"}},"in_reply_to_id":222280789},"pull_request":{"url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306","id":219887911,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5ODg3OTEx","html_url":"https://github.com/Coderockr/vitrine-social/pull/306","diff_url":"https://github.com/Coderockr/vitrine-social/pull/306.diff","patch_url":"https://github.com/Coderockr/vitrine-social/pull/306.patch","issue_url":"https://api.github.com/repos/Coderockr/vitrine-social/issues/306","number":306,"state":"open","locked":false,"title":"Gerar sitemap - WIP","user":{"login":"eminetto","id":197939,"node_id":"MDQ6VXNlcjE5NzkzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/197939?v=4","gravatar_id":"","url":"https://api.github.com/users/eminetto","html_url":"https://github.com/eminetto","followers_url":"https://api.github.com/users/eminetto/followers","following_url":"https://api.github.com/users/eminetto/following{/other_user}","gists_url":"https://api.github.com/users/eminetto/gists{/gist_id}","starred_url":"https://api.github.com/users/eminetto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminetto/subscriptions","organizations_url":"https://api.github.com/users/eminetto/orgs","repos_url":"https://api.github.com/users/eminetto/repos","events_url":"https://api.github.com/users/eminetto/events{/privacy}","received_events_url":"https://api.github.com/users/eminetto/received_events","type":"User","site_admin":false},"body":"# This PR is connected to a issue?\r\n\r\nconnected to #192 \r\n","created_at":"2018-10-03T01:02:34Z","updated_at":"2018-10-03T12:17:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"013e982b72a36e5f9e5df68053602c6d8ba82a86","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":677039147,"node_id":"MDU6TGFiZWw2NzcwMzkxNDc=","url":"https://api.github.com/repos/Coderockr/vitrine-social/labels/Stage:%20Review","name":"Stage: Review","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306/commits","review_comments_url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306/comments","review_comment_url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Coderockr/vitrine-social/issues/306/comments","statuses_url":"https://api.github.com/repos/Coderockr/vitrine-social/statuses/70463ee460ae2caf1dda76c2eb1b7ba4636791ee","head":{"label":"eminetto:master","ref":"master","sha":"70463ee460ae2caf1dda76c2eb1b7ba4636791ee","user":{"login":"eminetto","id":197939,"node_id":"MDQ6VXNlcjE5NzkzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/197939?v=4","gravatar_id":"","url":"https://api.github.com/users/eminetto","html_url":"https://github.com/eminetto","followers_url":"https://api.github.com/users/eminetto/followers","following_url":"https://api.github.com/users/eminetto/following{/other_user}","gists_url":"https://api.github.com/users/eminetto/gists{/gist_id}","starred_url":"https://api.github.com/users/eminetto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminetto/subscriptions","organizations_url":"https://api.github.com/users/eminetto/orgs","repos_url":"https://api.github.com/users/eminetto/repos","events_url":"https://api.github.com/users/eminetto/events{/privacy}","received_events_url":"https://api.github.com/users/eminetto/received_events","type":"User","site_admin":false},"repo":{"id":151180675,"node_id":"MDEwOlJlcG9zaXRvcnkxNTExODA2NzU=","name":"vitrine-social","full_name":"eminetto/vitrine-social","private":false,"owner":{"login":"eminetto","id":197939,"node_id":"MDQ6VXNlcjE5NzkzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/197939?v=4","gravatar_id":"","url":"https://api.github.com/users/eminetto","html_url":"https://github.com/eminetto","followers_url":"https://api.github.com/users/eminetto/followers","following_url":"https://api.github.com/users/eminetto/following{/other_user}","gists_url":"https://api.github.com/users/eminetto/gists{/gist_id}","starred_url":"https://api.github.com/users/eminetto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eminetto/subscriptions","organizations_url":"https://api.github.com/users/eminetto/orgs","repos_url":"https://api.github.com/users/eminetto/repos","events_url":"https://api.github.com/users/eminetto/events{/privacy}","received_events_url":"https://api.github.com/users/eminetto/received_events","type":"User","site_admin":false},"html_url":"https://github.com/eminetto/vitrine-social","description":"O classificado de doações","fork":true,"url":"https://api.github.com/repos/eminetto/vitrine-social","forks_url":"https://api.github.com/repos/eminetto/vitrine-social/forks","keys_url":"https://api.github.com/repos/eminetto/vitrine-social/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eminetto/vitrine-social/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eminetto/vitrine-social/teams","hooks_url":"https://api.github.com/repos/eminetto/vitrine-social/hooks","issue_events_url":"https://api.github.com/repos/eminetto/vitrine-social/issues/events{/number}","events_url":"https://api.github.com/repos/eminetto/vitrine-social/events","assignees_url":"https://api.github.com/repos/eminetto/vitrine-social/assignees{/user}","branches_url":"https://api.github.com/repos/eminetto/vitrine-social/branches{/branch}","tags_url":"https://api.github.com/repos/eminetto/vitrine-social/tags","blobs_url":"https://api.github.com/repos/eminetto/vitrine-social/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eminetto/vitrine-social/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eminetto/vitrine-social/git/refs{/sha}","trees_url":"https://api.github.com/repos/eminetto/vitrine-social/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eminetto/vitrine-social/statuses/{sha}","languages_url":"https://api.github.com/repos/eminetto/vitrine-social/languages","stargazers_url":"https://api.github.com/repos/eminetto/vitrine-social/stargazers","contributors_url":"https://api.github.com/repos/eminetto/vitrine-social/contributors","subscribers_url":"https://api.github.com/repos/eminetto/vitrine-social/subscribers","subscription_url":"https://api.github.com/repos/eminetto/vitrine-social/subscription","commits_url":"https://api.github.com/repos/eminetto/vitrine-social/commits{/sha}","git_commits_url":"https://api.github.com/repos/eminetto/vitrine-social/git/commits{/sha}","comments_url":"https://api.github.com/repos/eminetto/vitrine-social/comments{/number}","issue_comment_url":"https://api.github.com/repos/eminetto/vitrine-social/issues/comments{/number}","contents_url":"https://api.github.com/repos/eminetto/vitrine-social/contents/{+path}","compare_url":"https://api.github.com/repos/eminetto/vitrine-social/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eminetto/vitrine-social/merges","archive_url":"https://api.github.com/repos/eminetto/vitrine-social/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eminetto/vitrine-social/downloads","issues_url":"https://api.github.com/repos/eminetto/vitrine-social/issues{/number}","pulls_url":"https://api.github.com/repos/eminetto/vitrine-social/pulls{/number}","milestones_url":"https://api.github.com/repos/eminetto/vitrine-social/milestones{/number}","notifications_url":"https://api.github.com/repos/eminetto/vitrine-social/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eminetto/vitrine-social/labels{/name}","releases_url":"https://api.github.com/repos/eminetto/vitrine-social/releases{/id}","deployments_url":"https://api.github.com/repos/eminetto/vitrine-social/deployments","created_at":"2018-10-02T00:42:15Z","updated_at":"2018-10-03T11:47:07Z","pushed_at":"2018-10-03T11:47:05Z","git_url":"git://github.com/eminetto/vitrine-social.git","ssh_url":"git@github.com:eminetto/vitrine-social.git","clone_url":"https://github.com/eminetto/vitrine-social.git","svn_url":"https://github.com/eminetto/vitrine-social","homepage":"https://www.vitrinesocial.org/","size":1812,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Coderockr:master","ref":"master","sha":"2a0b5d5841c902fcce122811d4d0ff11874120c5","user":{"login":"Coderockr","id":846756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Njc1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/846756?v=4","gravatar_id":"","url":"https://api.github.com/users/Coderockr","html_url":"https://github.com/Coderockr","followers_url":"https://api.github.com/users/Coderockr/followers","following_url":"https://api.github.com/users/Coderockr/following{/other_user}","gists_url":"https://api.github.com/users/Coderockr/gists{/gist_id}","starred_url":"https://api.github.com/users/Coderockr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coderockr/subscriptions","organizations_url":"https://api.github.com/users/Coderockr/orgs","repos_url":"https://api.github.com/users/Coderockr/repos","events_url":"https://api.github.com/users/Coderockr/events{/privacy}","received_events_url":"https://api.github.com/users/Coderockr/received_events","type":"Organization","site_admin":false},"repo":{"id":100302222,"node_id":"MDEwOlJlcG9zaXRvcnkxMDAzMDIyMjI=","name":"vitrine-social","full_name":"Coderockr/vitrine-social","private":false,"owner":{"login":"Coderockr","id":846756,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg0Njc1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/846756?v=4","gravatar_id":"","url":"https://api.github.com/users/Coderockr","html_url":"https://github.com/Coderockr","followers_url":"https://api.github.com/users/Coderockr/followers","following_url":"https://api.github.com/users/Coderockr/following{/other_user}","gists_url":"https://api.github.com/users/Coderockr/gists{/gist_id}","starred_url":"https://api.github.com/users/Coderockr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coderockr/subscriptions","organizations_url":"https://api.github.com/users/Coderockr/orgs","repos_url":"https://api.github.com/users/Coderockr/repos","events_url":"https://api.github.com/users/Coderockr/events{/privacy}","received_events_url":"https://api.github.com/users/Coderockr/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Coderockr/vitrine-social","description":"O classificado de doações","fork":false,"url":"https://api.github.com/repos/Coderockr/vitrine-social","forks_url":"https://api.github.com/repos/Coderockr/vitrine-social/forks","keys_url":"https://api.github.com/repos/Coderockr/vitrine-social/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Coderockr/vitrine-social/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Coderockr/vitrine-social/teams","hooks_url":"https://api.github.com/repos/Coderockr/vitrine-social/hooks","issue_events_url":"https://api.github.com/repos/Coderockr/vitrine-social/issues/events{/number}","events_url":"https://api.github.com/repos/Coderockr/vitrine-social/events","assignees_url":"https://api.github.com/repos/Coderockr/vitrine-social/assignees{/user}","branches_url":"https://api.github.com/repos/Coderockr/vitrine-social/branches{/branch}","tags_url":"https://api.github.com/repos/Coderockr/vitrine-social/tags","blobs_url":"https://api.github.com/repos/Coderockr/vitrine-social/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Coderockr/vitrine-social/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Coderockr/vitrine-social/git/refs{/sha}","trees_url":"https://api.github.com/repos/Coderockr/vitrine-social/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Coderockr/vitrine-social/statuses/{sha}","languages_url":"https://api.github.com/repos/Coderockr/vitrine-social/languages","stargazers_url":"https://api.github.com/repos/Coderockr/vitrine-social/stargazers","contributors_url":"https://api.github.com/repos/Coderockr/vitrine-social/contributors","subscribers_url":"https://api.github.com/repos/Coderockr/vitrine-social/subscribers","subscription_url":"https://api.github.com/repos/Coderockr/vitrine-social/subscription","commits_url":"https://api.github.com/repos/Coderockr/vitrine-social/commits{/sha}","git_commits_url":"https://api.github.com/repos/Coderockr/vitrine-social/git/commits{/sha}","comments_url":"https://api.github.com/repos/Coderockr/vitrine-social/comments{/number}","issue_comment_url":"https://api.github.com/repos/Coderockr/vitrine-social/issues/comments{/number}","contents_url":"https://api.github.com/repos/Coderockr/vitrine-social/contents/{+path}","compare_url":"https://api.github.com/repos/Coderockr/vitrine-social/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Coderockr/vitrine-social/merges","archive_url":"https://api.github.com/repos/Coderockr/vitrine-social/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Coderockr/vitrine-social/downloads","issues_url":"https://api.github.com/repos/Coderockr/vitrine-social/issues{/number}","pulls_url":"https://api.github.com/repos/Coderockr/vitrine-social/pulls{/number}","milestones_url":"https://api.github.com/repos/Coderockr/vitrine-social/milestones{/number}","notifications_url":"https://api.github.com/repos/Coderockr/vitrine-social/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Coderockr/vitrine-social/labels{/name}","releases_url":"https://api.github.com/repos/Coderockr/vitrine-social/releases{/id}","deployments_url":"https://api.github.com/repos/Coderockr/vitrine-social/deployments","created_at":"2017-08-14T19:27:25Z","updated_at":"2018-10-03T10:59:32Z","pushed_at":"2018-10-03T11:47:15Z","git_url":"git://github.com/Coderockr/vitrine-social.git","ssh_url":"git@github.com:Coderockr/vitrine-social.git","clone_url":"https://github.com/Coderockr/vitrine-social.git","svn_url":"https://github.com/Coderockr/vitrine-social","homepage":"https://www.vitrinesocial.org/","size":1800,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":23,"license":null,"forks":8,"open_issues":23,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306"},"html":{"href":"https://github.com/Coderockr/vitrine-social/pull/306"},"issue":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/issues/306"},"comments":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/issues/306/comments"},"review_comments":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306/comments"},"review_comment":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/pulls/306/commits"},"statuses":{"href":"https://api.github.com/repos/Coderockr/vitrine-social/statuses/70463ee460ae2caf1dda76c2eb1b7ba4636791ee"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lucassabreu"}}