{"action":"created","comment":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/comments/35484746","id":35484746,"diff_hunk":"@@ -0,0 +1,230 @@\n+module CalendarResponse where\n+\n+import Data.List (sort)\n+import Data.List.Split (splitOn)\n+import Data.Time (Day, UTCTime, addDays, formatTime, getCurrentTime, utctDay)\n+import Happstack.Server (ServerPart, Response, toResponse)\n+import Control.Monad.IO.Class (liftIO)\n+import System.Locale\n+import Config (firstMondayFall, lastWednesdayFall ,firstMondayWinter, lastMondayWinter, outDay)\n+import Database.CourseQueries (returnTutorialTimes, returnLectureTimes)\n+import qualified Data.Text as T\n+import Database.Tables as Tables\n+\n+-- | Returns a CSV file of events as requested by the user.\n+calendarResponse :: String -> ServerPart Response\n+calendarResponse courses =\n+    liftIO $ getCalendar courses\n+\n+-- | Gets together all the pieces of the program.\n+getCalendar :: String -> IO Response\n+getCalendar courses = do\n+    let courseInfo = getCoursesInfo courses\n+    databaseInfo <- sequence $ map pullDatabase courseInfo\n+    currentTime <- getCurrentTime\n+    let timeSystem = getTime currentTime\n+    let events = concat $ map (getEvent timeSystem) databaseInfo\n+    return $ toResponse $ getCSV $ events","path":"hs/CalendarResponse.hs","position":27,"original_position":27,"commit_id":"8db4b3606ce78a9019d6f849eb85172588b208a5","original_commit_id":"8db4b3606ce78a9019d6f849eb85172588b208a5","user":{"login":"Ian-Stewart-Binks","id":6301000,"avatar_url":"https://avatars.githubusercontent.com/u/6301000?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Stewart-Binks","html_url":"https://github.com/Ian-Stewart-Binks","followers_url":"https://api.github.com/users/Ian-Stewart-Binks/followers","following_url":"https://api.github.com/users/Ian-Stewart-Binks/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Stewart-Binks/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Stewart-Binks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Stewart-Binks/subscriptions","organizations_url":"https://api.github.com/users/Ian-Stewart-Binks/orgs","repos_url":"https://api.github.com/users/Ian-Stewart-Binks/repos","events_url":"https://api.github.com/users/Ian-Stewart-Binks/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Stewart-Binks/received_events","type":"User","site_admin":false},"body":"Redundant `$`.","created_at":"2015-07-25T17:07:11Z","updated_at":"2015-07-25T17:07:11Z","html_url":"https://github.com/Courseography/courseography/pull/684#discussion_r35484746","pull_request_url":"https://api.github.com/repos/Courseography/courseography/pulls/684","_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments/35484746"},"html":{"href":"https://github.com/Courseography/courseography/pull/684#discussion_r35484746"},"pull_request":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/684"}}},"pull_request":{"url":"https://api.github.com/repos/Courseography/courseography/pulls/684","id":40787948,"html_url":"https://github.com/Courseography/courseography/pull/684","diff_url":"https://github.com/Courseography/courseography/pull/684.diff","patch_url":"https://github.com/Courseography/courseography/pull/684.patch","issue_url":"https://api.github.com/repos/Courseography/courseography/issues/684","number":684,"state":"open","locked":false,"title":"ICalendar Event Generator","user":{"login":"GitGeminiano","id":11246238,"avatar_url":"https://avatars.githubusercontent.com/u/11246238?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGeminiano","html_url":"https://github.com/GitGeminiano","followers_url":"https://api.github.com/users/GitGeminiano/followers","following_url":"https://api.github.com/users/GitGeminiano/following{/other_user}","gists_url":"https://api.github.com/users/GitGeminiano/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGeminiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGeminiano/subscriptions","organizations_url":"https://api.github.com/users/GitGeminiano/orgs","repos_url":"https://api.github.com/users/GitGeminiano/repos","events_url":"https://api.github.com/users/GitGeminiano/events{/privacy}","received_events_url":"https://api.github.com/users/GitGeminiano/received_events","type":"User","site_admin":false},"body":"Dear Courseography members,\r\n\r\nI have been working on the event generator for Google Calendar and ICalendar. This is a working version of my work. Please let me know if changes are needed.\r\n\r\nBest Regards,\r\nChristian  Garcia","created_at":"2015-07-24T15:42:45Z","updated_at":"2015-07-25T17:07:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd6c1008a0a480b4f72d0251d99d7d24664dedf3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Courseography/courseography/pulls/684/commits","review_comments_url":"https://api.github.com/repos/Courseography/courseography/pulls/684/comments","review_comment_url":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Courseography/courseography/issues/684/comments","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/8db4b3606ce78a9019d6f849eb85172588b208a5","head":{"label":"GitGeminiano:IcalRepetitivePull","ref":"IcalRepetitivePull","sha":"8db4b3606ce78a9019d6f849eb85172588b208a5","user":{"login":"GitGeminiano","id":11246238,"avatar_url":"https://avatars.githubusercontent.com/u/11246238?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGeminiano","html_url":"https://github.com/GitGeminiano","followers_url":"https://api.github.com/users/GitGeminiano/followers","following_url":"https://api.github.com/users/GitGeminiano/following{/other_user}","gists_url":"https://api.github.com/users/GitGeminiano/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGeminiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGeminiano/subscriptions","organizations_url":"https://api.github.com/users/GitGeminiano/orgs","repos_url":"https://api.github.com/users/GitGeminiano/repos","events_url":"https://api.github.com/users/GitGeminiano/events{/privacy}","received_events_url":"https://api.github.com/users/GitGeminiano/received_events","type":"User","site_admin":false},"repo":{"id":35104832,"name":"courseography","full_name":"GitGeminiano/courseography","owner":{"login":"GitGeminiano","id":11246238,"avatar_url":"https://avatars.githubusercontent.com/u/11246238?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGeminiano","html_url":"https://github.com/GitGeminiano","followers_url":"https://api.github.com/users/GitGeminiano/followers","following_url":"https://api.github.com/users/GitGeminiano/following{/other_user}","gists_url":"https://api.github.com/users/GitGeminiano/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGeminiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGeminiano/subscriptions","organizations_url":"https://api.github.com/users/GitGeminiano/orgs","repos_url":"https://api.github.com/users/GitGeminiano/repos","events_url":"https://api.github.com/users/GitGeminiano/events{/privacy}","received_events_url":"https://api.github.com/users/GitGeminiano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GitGeminiano/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":true,"url":"https://api.github.com/repos/GitGeminiano/courseography","forks_url":"https://api.github.com/repos/GitGeminiano/courseography/forks","keys_url":"https://api.github.com/repos/GitGeminiano/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GitGeminiano/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GitGeminiano/courseography/teams","hooks_url":"https://api.github.com/repos/GitGeminiano/courseography/hooks","issue_events_url":"https://api.github.com/repos/GitGeminiano/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/GitGeminiano/courseography/events","assignees_url":"https://api.github.com/repos/GitGeminiano/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/GitGeminiano/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/GitGeminiano/courseography/tags","blobs_url":"https://api.github.com/repos/GitGeminiano/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GitGeminiano/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GitGeminiano/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/GitGeminiano/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GitGeminiano/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/GitGeminiano/courseography/languages","stargazers_url":"https://api.github.com/repos/GitGeminiano/courseography/stargazers","contributors_url":"https://api.github.com/repos/GitGeminiano/courseography/contributors","subscribers_url":"https://api.github.com/repos/GitGeminiano/courseography/subscribers","subscription_url":"https://api.github.com/repos/GitGeminiano/courseography/subscription","commits_url":"https://api.github.com/repos/GitGeminiano/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/GitGeminiano/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/GitGeminiano/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/GitGeminiano/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/GitGeminiano/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/GitGeminiano/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GitGeminiano/courseography/merges","archive_url":"https://api.github.com/repos/GitGeminiano/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GitGeminiano/courseography/downloads","issues_url":"https://api.github.com/repos/GitGeminiano/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/GitGeminiano/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/GitGeminiano/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/GitGeminiano/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GitGeminiano/courseography/labels{/name}","releases_url":"https://api.github.com/repos/GitGeminiano/courseography/releases{/id}","created_at":"2015-05-05T14:29:25Z","updated_at":"2015-05-05T14:29:26Z","pushed_at":"2015-07-24T15:32:45Z","git_url":"git://github.com/GitGeminiano/courseography.git","ssh_url":"git@github.com:GitGeminiano/courseography.git","clone_url":"https://github.com/GitGeminiano/courseography.git","svn_url":"https://github.com/GitGeminiano/courseography","homepage":"","size":28378,"stargazers_count":0,"watchers_count":0,"language":"Haskell","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":"Courseography:master","ref":"master","sha":"3173fd35d6981b1a825dbcd208204f759fdcf616","user":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"repo":{"id":16873349,"name":"courseography","full_name":"Courseography/courseography","owner":{"login":"Courseography","id":9721671,"avatar_url":"https://avatars.githubusercontent.com/u/9721671?v=3","gravatar_id":"","url":"https://api.github.com/users/Courseography","html_url":"https://github.com/Courseography","followers_url":"https://api.github.com/users/Courseography/followers","following_url":"https://api.github.com/users/Courseography/following{/other_user}","gists_url":"https://api.github.com/users/Courseography/gists{/gist_id}","starred_url":"https://api.github.com/users/Courseography/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Courseography/subscriptions","organizations_url":"https://api.github.com/users/Courseography/orgs","repos_url":"https://api.github.com/users/Courseography/repos","events_url":"https://api.github.com/users/Courseography/events{/privacy}","received_events_url":"https://api.github.com/users/Courseography/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Courseography/courseography","description":"Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.","fork":false,"url":"https://api.github.com/repos/Courseography/courseography","forks_url":"https://api.github.com/repos/Courseography/courseography/forks","keys_url":"https://api.github.com/repos/Courseography/courseography/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Courseography/courseography/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Courseography/courseography/teams","hooks_url":"https://api.github.com/repos/Courseography/courseography/hooks","issue_events_url":"https://api.github.com/repos/Courseography/courseography/issues/events{/number}","events_url":"https://api.github.com/repos/Courseography/courseography/events","assignees_url":"https://api.github.com/repos/Courseography/courseography/assignees{/user}","branches_url":"https://api.github.com/repos/Courseography/courseography/branches{/branch}","tags_url":"https://api.github.com/repos/Courseography/courseography/tags","blobs_url":"https://api.github.com/repos/Courseography/courseography/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Courseography/courseography/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Courseography/courseography/git/refs{/sha}","trees_url":"https://api.github.com/repos/Courseography/courseography/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Courseography/courseography/statuses/{sha}","languages_url":"https://api.github.com/repos/Courseography/courseography/languages","stargazers_url":"https://api.github.com/repos/Courseography/courseography/stargazers","contributors_url":"https://api.github.com/repos/Courseography/courseography/contributors","subscribers_url":"https://api.github.com/repos/Courseography/courseography/subscribers","subscription_url":"https://api.github.com/repos/Courseography/courseography/subscription","commits_url":"https://api.github.com/repos/Courseography/courseography/commits{/sha}","git_commits_url":"https://api.github.com/repos/Courseography/courseography/git/commits{/sha}","comments_url":"https://api.github.com/repos/Courseography/courseography/comments{/number}","issue_comment_url":"https://api.github.com/repos/Courseography/courseography/issues/comments{/number}","contents_url":"https://api.github.com/repos/Courseography/courseography/contents/{+path}","compare_url":"https://api.github.com/repos/Courseography/courseography/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Courseography/courseography/merges","archive_url":"https://api.github.com/repos/Courseography/courseography/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Courseography/courseography/downloads","issues_url":"https://api.github.com/repos/Courseography/courseography/issues{/number}","pulls_url":"https://api.github.com/repos/Courseography/courseography/pulls{/number}","milestones_url":"https://api.github.com/repos/Courseography/courseography/milestones{/number}","notifications_url":"https://api.github.com/repos/Courseography/courseography/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Courseography/courseography/labels{/name}","releases_url":"https://api.github.com/repos/Courseography/courseography/releases{/id}","created_at":"2014-02-15T22:32:22Z","updated_at":"2015-07-18T02:09:22Z","pushed_at":"2015-07-24T15:42:46Z","git_url":"git://github.com/Courseography/courseography.git","ssh_url":"git@github.com:Courseography/courseography.git","clone_url":"https://github.com/Courseography/courseography.git","svn_url":"https://github.com/Courseography/courseography","homepage":"","size":41960,"stargazers_count":12,"watchers_count":12,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":43,"forks":21,"open_issues":43,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/684"},"html":{"href":"https://github.com/Courseography/courseography/pull/684"},"issue":{"href":"https://api.github.com/repos/Courseography/courseography/issues/684"},"comments":{"href":"https://api.github.com/repos/Courseography/courseography/issues/684/comments"},"review_comments":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/684/comments"},"review_comment":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Courseography/courseography/pulls/684/commits"},"statuses":{"href":"https://api.github.com/repos/Courseography/courseography/statuses/8db4b3606ce78a9019d6f849eb85172588b208a5"}}}}