{"action":"created","comment":{"url":"https://api.github.com/repos/adicu/calendar/pulls/comments/28644974","id":28644974,"diff_hunk":"@@ -0,0 +1,56 @@\n+from __future__ import absolute_import\n+from datetime import tzinfo, timedelta, datetime, datetime, date, time\n+\n+from cal.schema import db, User, Event\n+from bs4 import BeautifulSoup\n+import requests\n+\n+import re\n+\n+from icalendar import Calendar\n+from datetime import datetime\n+\n+\n+r = requests.get('http://engineering.columbia.edu/feeds/events')\n+text = r.text\n+soup = BeautifulSoup(text)\n+\n+def update_engineering_events():\n+\tevents = soup.find_all('item')\n+\tuser = User.query.filter(User.name==\"Columbia Engineering\").first()\n+\tfor event in events:\n+\t\tcurrent_soup = BeautifulSoup(event.renderContents())\n+\n+\t\tevent_name = current_soup.find('title').text\n+\t\turl = current_soup.find('link').get_text() #event url\n+\t\turl = url.encode('ascii','ignore')\n+\t\tevent_id = url[len(url) - 5: len(url)]\n+\n+\t\turl = \"https://calendar.columbia.edu/sundial/webapi/iCalendar.php?EventID=\" + event_id\n+\n+\t\tprint url\n+\t\tr_event = requests.get(url) \n+\t\tr_text = r_event.text #the individual html for each event\n+\t\tindividual_soup = BeautifulSoup(r_text)\n+\n+\t\tcal = Calendar.from_ical(individual_soup.get_text())\n+\n+\t\tfor event in cal.walk('vevent'):\n+\t\t\tdate_start = event.get('dtstart')\n+\t\t\tdate_end = event.get('dtend')\n+\t\t\tdescription = event.get('description')\n+\t\t\tlocation = event.get('location')","path":"cal/engineeringevents.py","position":42,"original_position":42,"commit_id":"a7b14bf973ecd532f6e2f20a433aecf1255607d9","original_commit_id":"a7b14bf973ecd532f6e2f20a433aecf1255607d9","user":{"login":"alanhdu","id":1914111,"avatar_url":"https://avatars.githubusercontent.com/u/1914111?v=3","gravatar_id":"","url":"https://api.github.com/users/alanhdu","html_url":"https://github.com/alanhdu","followers_url":"https://api.github.com/users/alanhdu/followers","following_url":"https://api.github.com/users/alanhdu/following{/other_user}","gists_url":"https://api.github.com/users/alanhdu/gists{/gist_id}","starred_url":"https://api.github.com/users/alanhdu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanhdu/subscriptions","organizations_url":"https://api.github.com/users/alanhdu/orgs","repos_url":"https://api.github.com/users/alanhdu/repos","events_url":"https://api.github.com/users/alanhdu/events{/privacy}","received_events_url":"https://api.github.com/users/alanhdu/received_events","type":"User","site_admin":false},"body":"Is there only one event per calendar? ","created_at":"2015-04-18T15:45:33Z","updated_at":"2015-04-18T15:45:33Z","html_url":"https://github.com/adicu/calendar/pull/79#discussion_r28644974","pull_request_url":"https://api.github.com/repos/adicu/calendar/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/adicu/calendar/pulls/comments/28644974"},"html":{"href":"https://github.com/adicu/calendar/pull/79#discussion_r28644974"},"pull_request":{"href":"https://api.github.com/repos/adicu/calendar/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/adicu/calendar/pulls/79","id":33583879,"html_url":"https://github.com/adicu/calendar/pull/79","diff_url":"https://github.com/adicu/calendar/pull/79.diff","patch_url":"https://github.com/adicu/calendar/pull/79.patch","issue_url":"https://api.github.com/repos/adicu/calendar/issues/79","number":79,"state":"open","locked":false,"title":"events from engineering","user":{"login":"kl2806","id":9100255,"avatar_url":"https://avatars.githubusercontent.com/u/9100255?v=3","gravatar_id":"","url":"https://api.github.com/users/kl2806","html_url":"https://github.com/kl2806","followers_url":"https://api.github.com/users/kl2806/followers","following_url":"https://api.github.com/users/kl2806/following{/other_user}","gists_url":"https://api.github.com/users/kl2806/gists{/gist_id}","starred_url":"https://api.github.com/users/kl2806/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl2806/subscriptions","organizations_url":"https://api.github.com/users/kl2806/orgs","repos_url":"https://api.github.com/users/kl2806/repos","events_url":"https://api.github.com/users/kl2806/events{/privacy}","received_events_url":"https://api.github.com/users/kl2806/received_events","type":"User","site_admin":false},"body":"added events from engineering http://events.engineering.columbia.edu/","created_at":"2015-04-17T21:26:22Z","updated_at":"2015-04-18T15:45:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/adicu/calendar/pulls/79/commits","review_comments_url":"https://api.github.com/repos/adicu/calendar/pulls/79/comments","review_comment_url":"https://api.github.com/repos/adicu/calendar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adicu/calendar/issues/79/comments","statuses_url":"https://api.github.com/repos/adicu/calendar/statuses/a7b14bf973ecd532f6e2f20a433aecf1255607d9","head":{"label":"kl2806:master","ref":"master","sha":"a7b14bf973ecd532f6e2f20a433aecf1255607d9","user":{"login":"kl2806","id":9100255,"avatar_url":"https://avatars.githubusercontent.com/u/9100255?v=3","gravatar_id":"","url":"https://api.github.com/users/kl2806","html_url":"https://github.com/kl2806","followers_url":"https://api.github.com/users/kl2806/followers","following_url":"https://api.github.com/users/kl2806/following{/other_user}","gists_url":"https://api.github.com/users/kl2806/gists{/gist_id}","starred_url":"https://api.github.com/users/kl2806/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl2806/subscriptions","organizations_url":"https://api.github.com/users/kl2806/orgs","repos_url":"https://api.github.com/users/kl2806/repos","events_url":"https://api.github.com/users/kl2806/events{/privacy}","received_events_url":"https://api.github.com/users/kl2806/received_events","type":"User","site_admin":false},"repo":{"id":30771272,"name":"calendar","full_name":"kl2806/calendar","owner":{"login":"kl2806","id":9100255,"avatar_url":"https://avatars.githubusercontent.com/u/9100255?v=3","gravatar_id":"","url":"https://api.github.com/users/kl2806","html_url":"https://github.com/kl2806","followers_url":"https://api.github.com/users/kl2806/followers","following_url":"https://api.github.com/users/kl2806/following{/other_user}","gists_url":"https://api.github.com/users/kl2806/gists{/gist_id}","starred_url":"https://api.github.com/users/kl2806/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kl2806/subscriptions","organizations_url":"https://api.github.com/users/kl2806/orgs","repos_url":"https://api.github.com/users/kl2806/repos","events_url":"https://api.github.com/users/kl2806/events{/privacy}","received_events_url":"https://api.github.com/users/kl2806/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kl2806/calendar","description":"","fork":true,"url":"https://api.github.com/repos/kl2806/calendar","forks_url":"https://api.github.com/repos/kl2806/calendar/forks","keys_url":"https://api.github.com/repos/kl2806/calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kl2806/calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kl2806/calendar/teams","hooks_url":"https://api.github.com/repos/kl2806/calendar/hooks","issue_events_url":"https://api.github.com/repos/kl2806/calendar/issues/events{/number}","events_url":"https://api.github.com/repos/kl2806/calendar/events","assignees_url":"https://api.github.com/repos/kl2806/calendar/assignees{/user}","branches_url":"https://api.github.com/repos/kl2806/calendar/branches{/branch}","tags_url":"https://api.github.com/repos/kl2806/calendar/tags","blobs_url":"https://api.github.com/repos/kl2806/calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kl2806/calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kl2806/calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/kl2806/calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kl2806/calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/kl2806/calendar/languages","stargazers_url":"https://api.github.com/repos/kl2806/calendar/stargazers","contributors_url":"https://api.github.com/repos/kl2806/calendar/contributors","subscribers_url":"https://api.github.com/repos/kl2806/calendar/subscribers","subscription_url":"https://api.github.com/repos/kl2806/calendar/subscription","commits_url":"https://api.github.com/repos/kl2806/calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/kl2806/calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/kl2806/calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/kl2806/calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/kl2806/calendar/contents/{+path}","compare_url":"https://api.github.com/repos/kl2806/calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kl2806/calendar/merges","archive_url":"https://api.github.com/repos/kl2806/calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kl2806/calendar/downloads","issues_url":"https://api.github.com/repos/kl2806/calendar/issues{/number}","pulls_url":"https://api.github.com/repos/kl2806/calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/kl2806/calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/kl2806/calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kl2806/calendar/labels{/name}","releases_url":"https://api.github.com/repos/kl2806/calendar/releases{/id}","created_at":"2015-02-13T19:06:56Z","updated_at":"2015-04-17T21:24:14Z","pushed_at":"2015-04-17T21:24:14Z","git_url":"git://github.com/kl2806/calendar.git","ssh_url":"git@github.com:kl2806/calendar.git","clone_url":"https://github.com/kl2806/calendar.git","svn_url":"https://github.com/kl2806/calendar","homepage":null,"size":640,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"adicu:master","ref":"master","sha":"450b3aa4ab97cd045d8e5ab1ec511137b2dcf8fe","user":{"login":"adicu","id":987267,"avatar_url":"https://avatars.githubusercontent.com/u/987267?v=3","gravatar_id":"","url":"https://api.github.com/users/adicu","html_url":"https://github.com/adicu","followers_url":"https://api.github.com/users/adicu/followers","following_url":"https://api.github.com/users/adicu/following{/other_user}","gists_url":"https://api.github.com/users/adicu/gists{/gist_id}","starred_url":"https://api.github.com/users/adicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adicu/subscriptions","organizations_url":"https://api.github.com/users/adicu/orgs","repos_url":"https://api.github.com/users/adicu/repos","events_url":"https://api.github.com/users/adicu/events{/privacy}","received_events_url":"https://api.github.com/users/adicu/received_events","type":"Organization","site_admin":false},"repo":{"id":30770949,"name":"calendar","full_name":"adicu/calendar","owner":{"login":"adicu","id":987267,"avatar_url":"https://avatars.githubusercontent.com/u/987267?v=3","gravatar_id":"","url":"https://api.github.com/users/adicu","html_url":"https://github.com/adicu","followers_url":"https://api.github.com/users/adicu/followers","following_url":"https://api.github.com/users/adicu/following{/other_user}","gists_url":"https://api.github.com/users/adicu/gists{/gist_id}","starred_url":"https://api.github.com/users/adicu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adicu/subscriptions","organizations_url":"https://api.github.com/users/adicu/orgs","repos_url":"https://api.github.com/users/adicu/repos","events_url":"https://api.github.com/users/adicu/events{/privacy}","received_events_url":"https://api.github.com/users/adicu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adicu/calendar","description":"","fork":false,"url":"https://api.github.com/repos/adicu/calendar","forks_url":"https://api.github.com/repos/adicu/calendar/forks","keys_url":"https://api.github.com/repos/adicu/calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adicu/calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adicu/calendar/teams","hooks_url":"https://api.github.com/repos/adicu/calendar/hooks","issue_events_url":"https://api.github.com/repos/adicu/calendar/issues/events{/number}","events_url":"https://api.github.com/repos/adicu/calendar/events","assignees_url":"https://api.github.com/repos/adicu/calendar/assignees{/user}","branches_url":"https://api.github.com/repos/adicu/calendar/branches{/branch}","tags_url":"https://api.github.com/repos/adicu/calendar/tags","blobs_url":"https://api.github.com/repos/adicu/calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adicu/calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adicu/calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/adicu/calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adicu/calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/adicu/calendar/languages","stargazers_url":"https://api.github.com/repos/adicu/calendar/stargazers","contributors_url":"https://api.github.com/repos/adicu/calendar/contributors","subscribers_url":"https://api.github.com/repos/adicu/calendar/subscribers","subscription_url":"https://api.github.com/repos/adicu/calendar/subscription","commits_url":"https://api.github.com/repos/adicu/calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/adicu/calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/adicu/calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/adicu/calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/adicu/calendar/contents/{+path}","compare_url":"https://api.github.com/repos/adicu/calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adicu/calendar/merges","archive_url":"https://api.github.com/repos/adicu/calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adicu/calendar/downloads","issues_url":"https://api.github.com/repos/adicu/calendar/issues{/number}","pulls_url":"https://api.github.com/repos/adicu/calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/adicu/calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/adicu/calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adicu/calendar/labels{/name}","releases_url":"https://api.github.com/repos/adicu/calendar/releases{/id}","created_at":"2015-02-13T18:59:17Z","updated_at":"2015-04-18T00:34:01Z","pushed_at":"2015-04-18T15:37:16Z","git_url":"git://github.com/adicu/calendar.git","ssh_url":"git@github.com:adicu/calendar.git","clone_url":"https://github.com/adicu/calendar.git","svn_url":"https://github.com/adicu/calendar","homepage":null,"size":1421,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adicu/calendar/pulls/79"},"html":{"href":"https://github.com/adicu/calendar/pull/79"},"issue":{"href":"https://api.github.com/repos/adicu/calendar/issues/79"},"comments":{"href":"https://api.github.com/repos/adicu/calendar/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/adicu/calendar/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/adicu/calendar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adicu/calendar/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/adicu/calendar/statuses/a7b14bf973ecd532f6e2f20a433aecf1255607d9"}}}}