{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/comments/23004823","id":23004823,"diff_hunk":"@@ -0,0 +1,60 @@\n+(function (env) {\n+    \"use strict\";\n+    env.ddg_spice_seasons = function(api_result){\n+\n+        // Make sure we have a result\n+        if (!(api_result &&\n+                api_result.holidays &&\n+                api_result.holidays.length == 4)) {\n+            return Spice.failed('seasons');\n+        }\n+\n+        // Grab the matching search terms and figure out the season\n+        var script = $('[src*=\"/js/spice/seasons/\"]')[0];\n+        var source = $(script).attr(\"src\");\n+        var query = source.match(/seasons\\/[0-9]{4}\\/[a-zA-Z]{2}\\/([a-z]+)/)[1];\n+        var season = $.inArray(query, [ \"spring\", \"summer\", \"autumn\", \"winter\" ]);\n+\n+        // Somehow we got an unknown season, bail out\n+        if (season < 0) {\n+            return Spice.failed('seasons');\n+        }\n+\n+        // Grab the correct season from api results and generate output data\n+        var event = api_result.holidays[season];\n+        var date = DDG.getDateFromString(event.date.iso);\n+\n+        var result = {\n+          event: DDG.capitalize(event.name.toLowerCase()),\n+          year: date.getFullYear(),\n+          date: date.toLocaleDateString(),","path":"share/spice/seasons/seasons.js","position":30,"original_position":30,"commit_id":"f00487984429eddb0d642e87c8c4473a7a632087","original_commit_id":"f00487984429eddb0d642e87c8c4473a7a632087","user":{"login":"MrChrisW","id":5282264,"avatar_url":"https://avatars.githubusercontent.com/u/5282264?v=3","gravatar_id":"","url":"https://api.github.com/users/MrChrisW","html_url":"https://github.com/MrChrisW","followers_url":"https://api.github.com/users/MrChrisW/followers","following_url":"https://api.github.com/users/MrChrisW/following{/other_user}","gists_url":"https://api.github.com/users/MrChrisW/gists{/gist_id}","starred_url":"https://api.github.com/users/MrChrisW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrChrisW/subscriptions","organizations_url":"https://api.github.com/users/MrChrisW/orgs","repos_url":"https://api.github.com/users/MrChrisW/repos","events_url":"https://api.github.com/users/MrChrisW/events{/privacy}","received_events_url":"https://api.github.com/users/MrChrisW/received_events","type":"User","site_admin":false},"body":"@mayo You can use `DDG.getDateFromString`\r\nSee example: https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/share/spice/time/time.js#L28","created_at":"2015-01-15T11:50:24Z","updated_at":"2015-01-15T11:50:24Z","html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335#discussion_r23004823","pull_request_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/comments/23004823"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335#discussion_r23004823"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335","id":25720409,"html_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335","diff_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335.patch","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1335","number":1335,"state":"open","locked":false,"title":"Seasons Spice","user":{"login":"mayo","id":2772,"avatar_url":"https://avatars.githubusercontent.com/u/2772?v=3","gravatar_id":"","url":"https://api.github.com/users/mayo","html_url":"https://github.com/mayo","followers_url":"https://api.github.com/users/mayo/followers","following_url":"https://api.github.com/users/mayo/following{/other_user}","gists_url":"https://api.github.com/users/mayo/gists{/gist_id}","starred_url":"https://api.github.com/users/mayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayo/subscriptions","organizations_url":"https://api.github.com/users/mayo/orgs","repos_url":"https://api.github.com/users/mayo/repos","events_url":"https://api.github.com/users/mayo/events{/privacy}","received_events_url":"https://api.github.com/users/mayo/received_events","type":"User","site_admin":false},"body":"**What does your Instant Answer do?**\r\n The Instant Answers gives time and date of solstices and equinoxes.\r\n\r\n**What problem does your Instant Answer solve (Why is it better than organic links)?**\r\nAnswers to questions this instant answer provides are usually definitive and relatively simple to answer. It saves the user from having to hunt through the organic list of links to find their answer.\r\n\r\n**What is the data source for your Instant Answer? (Provide a link if possible)**\r\nhttp://www.timeanddate.com/calendar/seasons.html\r\n\r\n**Why did you choose this data source?**\r\nTimeanddate.com provides a nice API and DDG already has other Instant Answers that use the API.\r\n\r\n**Are there any other alternative (better) data sources?**\r\nunderground.com, weather.com, almanac.com (and others) all provide this data, but I have not found anyone who exposes this data through an API.\r\n\r\n**What are some example queries that trigger this Instant Answer?**\r\nfirst day of spring\r\nsummer solstice\r\nstart of fall in 2015\r\n\r\n**Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)**\r\ntrivia, photographers, weather observers, religious\r\n\r\n**Is this Instant Answer connected to a DuckDuckHack [Instant Answer idea](https://duck.co/ideas)?**\r\nhttps://duck.co/ideas/idea/4682/when-does-season-start\r\n\r\n**Which existing Instant Answers will this one supersede/overlap with?**\r\nNone that I'm aware of\r\n\r\n**Are you having any problems? Do you need our help with anything?**\r\nNo\r\n\r\n**What are the terms of use for the API? Will DuckDuckGo need specific authorization (e.g. an API key)? Are there any costs associated with API usage?**\r\nThere is a cost for the API usage, but DDG is already partnering with the data provider.\r\n\r\n**Where did you hear about DuckDuckHack? (For first time contributors)**\r\nDDG's blog and website.\r\n\r\n**What does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)**\r\n![screenshot](https://cloud.githubusercontent.com/assets/2772/5352752/ba379a88-7f21-11e4-9444-c7e24819bc17.png)\r\n\r\n\r\n## Checklist\r\nPlease place an 'X' where appropriate.\r\n\r\n```\r\n[X] Added metadata and attribution information\r\n[X] Wrote test file and added to t/ directory\r\n[X] Verified that instant answer adheres to design guidelines (https://duck.co/duckduckhack/design_styleguide)\r\n[X] Verified that instant answer adheres to code styleguide (https://duck.co/duckduckhack/code_styleguide)\r\n[X] Tested cross-browser compatibility\r\n\r\n    Please let us know which browsers/devices you've tested on:\r\n    - Windows 8\r\n        [] Google Chrome\r\n        [] Firefox\r\n        [] Opera\r\n        [X] IE 10\r\n\r\n    - Windows 7\r\n        [] Google Chrome\r\n        [] Firefox\r\n        [] Opera\r\n        [] IE 8\r\n        [] IE 9\r\n        [X] IE 10\r\n\r\n    - Windows XP\r\n        [X] IE 7\r\n        [X] IE 8\r\n\r\n    - Mac OSX\r\n        [X] Google Chrome\r\n        [] Firefox\r\n        [] Opera\r\n        [X] Safari\r\n\r\n    - iOS (iPhone)\r\n        [X] Safari Mobile\r\n        [] Google Chrome\r\n        [] Opera\r\n\r\n    - iOS (iPad)\r\n        [X] Safari Mobile\r\n        [] Google Chrome\r\n        [] Opera\r\n\r\n    - Android\r\n        [] Firefox\r\n        [] Native Browser\r\n        [] Google Chrome\r\n        [] Opera\r\n```","created_at":"2014-12-09T05:33:15Z","updated_at":"2015-01-15T11:50:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"910cac66edfcee26d4ad55b3a51dbb81c5b619e4","assignee":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/comments/{number}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1335/comments","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/statuses/f00487984429eddb0d642e87c8c4473a7a632087","head":{"label":"mayo:Seasons","ref":"Seasons","sha":"f00487984429eddb0d642e87c8c4473a7a632087","user":{"login":"mayo","id":2772,"avatar_url":"https://avatars.githubusercontent.com/u/2772?v=3","gravatar_id":"","url":"https://api.github.com/users/mayo","html_url":"https://github.com/mayo","followers_url":"https://api.github.com/users/mayo/followers","following_url":"https://api.github.com/users/mayo/following{/other_user}","gists_url":"https://api.github.com/users/mayo/gists{/gist_id}","starred_url":"https://api.github.com/users/mayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayo/subscriptions","organizations_url":"https://api.github.com/users/mayo/orgs","repos_url":"https://api.github.com/users/mayo/repos","events_url":"https://api.github.com/users/mayo/events{/privacy}","received_events_url":"https://api.github.com/users/mayo/received_events","type":"User","site_admin":false},"repo":{"id":24626638,"name":"zeroclickinfo-spice","full_name":"mayo/zeroclickinfo-spice","owner":{"login":"mayo","id":2772,"avatar_url":"https://avatars.githubusercontent.com/u/2772?v=3","gravatar_id":"","url":"https://api.github.com/users/mayo","html_url":"https://github.com/mayo","followers_url":"https://api.github.com/users/mayo/followers","following_url":"https://api.github.com/users/mayo/following{/other_user}","gists_url":"https://api.github.com/users/mayo/gists{/gist_id}","starred_url":"https://api.github.com/users/mayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayo/subscriptions","organizations_url":"https://api.github.com/users/mayo/orgs","repos_url":"https://api.github.com/users/mayo/repos","events_url":"https://api.github.com/users/mayo/events{/privacy}","received_events_url":"https://api.github.com/users/mayo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mayo/zeroclickinfo-spice","description":"DuckDuckGo instant answer plugins based on JavaScript APIs","fork":true,"url":"https://api.github.com/repos/mayo/zeroclickinfo-spice","forks_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/forks","keys_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/teams","hooks_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/hooks","issue_events_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/issues/events{/number}","events_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/events","assignees_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/assignees{/user}","branches_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/branches{/branch}","tags_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/tags","blobs_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/git/refs{/sha}","trees_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/statuses/{sha}","languages_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/languages","stargazers_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/stargazers","contributors_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/contributors","subscribers_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/subscribers","subscription_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/subscription","commits_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/commits{/sha}","git_commits_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/git/commits{/sha}","comments_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/comments{/number}","issue_comment_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/issues/comments/{number}","contents_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/contents/{+path}","compare_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/merges","archive_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/downloads","issues_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/issues{/number}","pulls_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/pulls{/number}","milestones_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/milestones{/number}","notifications_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/labels{/name}","releases_url":"https://api.github.com/repos/mayo/zeroclickinfo-spice/releases{/id}","created_at":"2014-09-30T06:14:20Z","updated_at":"2014-12-03T06:29:10Z","pushed_at":"2015-01-04T04:04:53Z","git_url":"git://github.com/mayo/zeroclickinfo-spice.git","ssh_url":"git@github.com:mayo/zeroclickinfo-spice.git","clone_url":"https://github.com/mayo/zeroclickinfo-spice.git","svn_url":"https://github.com/mayo/zeroclickinfo-spice","homepage":"http://duckduckhack.com/","size":12645,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"duckduckgo:master","ref":"master","sha":"54ea4568918ac55b8d97cd63f84d0b1de4201d87","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":1997671,"name":"zeroclickinfo-spice","full_name":"duckduckgo/zeroclickinfo-spice","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/zeroclickinfo-spice","description":"DuckDuckGo instant answer plugins based on JavaScript APIs","fork":false,"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice","forks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/forks","keys_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/teams","hooks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/events","assignees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/tags","blobs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/subscription","commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/comments/{number}","contents_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/merges","archive_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/downloads","issues_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/releases{/id}","created_at":"2011-07-04T22:08:37Z","updated_at":"2015-01-15T11:44:28Z","pushed_at":"2015-01-15T11:44:28Z","git_url":"git://github.com/duckduckgo/zeroclickinfo-spice.git","ssh_url":"git@github.com:duckduckgo/zeroclickinfo-spice.git","clone_url":"https://github.com/duckduckgo/zeroclickinfo-spice.git","svn_url":"https://github.com/duckduckgo/zeroclickinfo-spice","homepage":"http://duckduckhack.com/","size":27398,"stargazers_count":203,"watchers_count":203,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":413,"mirror_url":null,"open_issues_count":98,"forks":413,"open_issues":98,"watchers":203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-spice/pull/1335"},"issue":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1335"},"comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/issues/1335/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/pulls/1335/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-spice/statuses/f00487984429eddb0d642e87c8c4473a7a632087"}}}}