{"id":19156998,"url":"https://github.com/bertrandmartel/gcalendar-notification-server","last_synced_at":"2026-06-03T16:31:38.163Z","repository":{"id":36144124,"uuid":"40448130","full_name":"bertrandmartel/gcalendar-notification-server","owner":"bertrandmartel","description":"Google calendar embedded notification server","archived":false,"fork":false,"pushed_at":"2016-12-25T23:38:40.000Z","size":1568,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T21:43:21.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertrandmartel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-09T19:41:39.000Z","updated_at":"2019-10-19T08:32:50.000Z","dependencies_parsed_at":"2022-09-05T18:02:02.098Z","dependency_job_id":null,"html_url":"https://github.com/bertrandmartel/gcalendar-notification-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bertrandmartel/gcalendar-notification-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fgcalendar-notification-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fgcalendar-notification-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fgcalendar-notification-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fgcalendar-notification-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertrandmartel","download_url":"https://codeload.github.com/bertrandmartel/gcalendar-notification-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fgcalendar-notification-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33874679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T08:36:54.275Z","updated_at":"2026-06-03T16:31:38.145Z","avatar_url":"https://github.com/bertrandmartel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Calendar event notification server #\nhttp://bertrandmartel.github.io/gcalendar-notification-server\n\n\u003ci\u003eLast update on 09/08/2015\u003c/i\u003e\n\nEmbedded google calendar event notification server through Google Calendar API (Oauth2.0)\n\nThis project is an alternative for \"end device\" to Google Calendar push notification (https://developers.google.com/google-apps/calendar/v3/push?hl=en) where you need to have a domain receiving your notifications which force your application to have a back end realizing the job for your client.\n\n2 parts are featured :\n* gcalendar-notification-lib which is library you would used to manage Google Calendar API and process events notifications\n* gcalendar-notification-webserver which is a server implementation and message process management which expose its API for a web client\n\nIf you have your own server implementation, you can integrate gcalendar-notification-lib separately without the server part\n\n\u003ch3\u003eWhat does it do ?\u003c/h3\u003e\n\n* receive notifications of all events you have subscribed through gcalendar-notification-lib APIs that are pushed to a web client\n* subscribe/unsubscribe to a precise event\n* create an event (with date start, date end and summary)\n* delete an event\n* retrieve list of Google calendar events for a specific date time range and optionnal text filter\n* retrieve basic user profile information\n* request an access token that will be used to request Google API for the scope Profile and Calendar\n* revoke an access token (if you want to)\n* register through Oauth2.0\n\n[ ! ] Event creation is very basic for now (date start / date begin and summary) but is a good medium to test notifications\n\n\u003ch3\u003eRun the testing server app\u003c/h3\u003e\n\n``git clone git@github.com:bertrandmartel/gcalendar-notification-server.git``\n\n``cd gcalendar-notification-server/gcalendar-notification-webserver/release``\n\n``java -jar gcalendar-notification-client-webserver-1.0.jar webPath=\u003cyour_absolute_path\u003e/gcalendar-notification-server/web clientId=\u003cyour_client_id\u003e clientSecret=\u003cyour_client_secret\u003e``\n\n_ replace \u003cyour_absolute_path\u003e with your path prior to gcalendar-notification-webserver \n_ replace \u003cyour_client_id\u003e and \u003cyour_client_secret\u003e with the ones you got from google developper console\n\n* go to you browser : \u003ca\u003ehttp://localhost:4242/gcalendar\u003c/a\u003e\n\n* now you can click on \"start registration\" button to request registration. You will see a verification url appear and a user code.\n\n\u003ci\u003eIf you dont see these two features appear maybe you have a problem with your client id / client secret\u003c/i\u003e\n\n* go to specified URL and authorize access from Google API.\n\n* once it is done, you can click on \"request token\" button, and shortly a token will appear\n\n![screenshot](https://raw.github.com/bertrandmartel/gcalendar-notification-server/master/sh.png)\n\n* From this moment you will have access to \"user profile\", \"calendar events\", \"create event\" and \"delete event\" buttons\n\n* You can create a fake event of your own with \"create event\" button putting the date time range of your choice\n\n* You can subscribe to events to come (even events already existing) and you will see a notification coming to your window when event will be about to start (60 seconds befor event) or when the event has actually started\n\nIn your console you can see talk between client and server :\n![screenshot](https://raw.github.com/bertrandmartel/gcalendar-notification-server/master/sh2.png)\n\n\u003ch3\u003eOauth2.0 for device registration\u003c/h3\u003e\n\n```\nString yourOwnClientId=\"812741506391-h38jh0j4fv0ce1krdkiq0hfvt6n5amrf.apps.googleusercontent.com\";\nString yourClientSecret=\"1912308409123890\";\n```\n\nNow you can  instantiate ``AuthenticationManager`` class :\n\n```\nCalendarNotifManager calendarNotifManager = new CalendarNotifManager(yourOwnClientId, yourClientSecret);\n```\n\nThen you can request authentication :\n\n```\ncalendarNotifManager.requestDeviceAuth(new IOauthDeviceResponseListener() {\n\n\t@Override\n\tpublic void onResponseReceived(OauthForDeviceResponse response) {\n\t\t\n\t\t/* callback called when response is received from server*/\n\n\t}\n});\n```\n\nDescription of ``OauthForDeviceResponse`` :\n* ``getVerificationUrl()`` : url from which user will log and therefore authorize your server to request token\n* ``getUserCode()`` : code that user will reproduce exactly in the latter verification url\n* ``getDeviceCode()`` : code identifying your server which is viewed as an end device requesting google api\n* ``getExpiringBefore()`` : life time of your usercode in seconds\n* ``getInterval()`` : time interval between a next attempt in seconds\n\nThe verification url is displayed to the user via a web client.\nThe user will reproduce the user code from the same web client and authorize the server to request token.\nFrom this point you will be able to request token.\n\nThe whole authentication process is described in https://developers.google.com/identity/protocols/OAuth2ForDevices\n\n\u003ch3\u003eRequest for access token\u003c/h3\u003e\n\n```\ncalendarNotifManager.requestToken(new IRequestTokenListener() {\n\n\t@Override\n\tpublic void onRequestTokenReceived(OauthToken token) {\n\t\t//access token is received\n\t}\n\n\t@Override\n\tpublic void onRequestTokenError(String description) {\n\t\t//an error occured requesting access token\n\t}\n});\n```\n\nOnce you have received a token you can access Google calendar API and profile.\n\n\u003ch3\u003eRequest user profile\u003c/h3\u003e\n\n```\ncalendarNotifManager.getUserProfileManager().getUserProfile(new IUserProfileListener() {\n\n\t@Override\n\tpublic void onSuccess(UserProfile userProfile) {\n\n\t\t// user profile received succcessfully :\n\n\t\t//userProfile.getGender()\n\t\t//userProfile.getDisplayName()\n\t\t//userProfile.getFamilyName()\n\t\t//userProfile.getGivenName()\n\t\t//userProfile.getLanguage()\n\t}\n\n\t@Override\n\tpublic void onError(String description) {\n\t\t//an error occured requesting user profile\n\t}\n});\n```\n\n\u003ch3\u003eRequest calendar events\u003c/h3\u003e\n\nYou can request event with date time range from ``dateBegin`` to ``dateEnd`` with these two values in String timestamp format according RFC 3339 (ex: 2015-08-06T23:30:20+02:00)\nYou can optionnaly add a text filter\n\n```\ncalendarNotifManager.getCalendarManager().getEventList(dateBegin, dateEnd, searchText, new IEventListListener() {\n\n\t@Override\n\tpublic void onEventListReceived(List\u003cCalendarEvents\u003e calendarEventList) {\n\t\t//list of calendar events retrieved\n\t}\n\n\t@Override\n\tpublic void onError(String description) {\n\t\t//an error occured requesting calendar events\n\t}\n});\n```\n\nHere is description of one event in List\u003cCalendarEvents\u003e retrieved :\n* ``String getEventId()`` : event identifier\n* ``String getStatus()``: event status\n* ``String getDateCreated()`` : creation date of the event\n* ``String getDateUpdated()`` : date of event udpate\n* ``String getSummary()`` : event summary\n* ``String getCreatorEmail()`` : event creator email\n* ``String getCreatorDisplayName()`` : event creator display name\n* ``boolean isCreatorSelf()`` : true if the event was created by calendar's owner\n* ``String getOrganizerEmail()`` : event organizer email\n* ``String getOrganizerDisplayName()`` : event organizer display name\n* ``boolean isOrganizerSelf()`` : true if event organizer is calendar's owner\n* ``String getDateStart()`` : event date start \n* ``String getDateEnd()`` : event date end \n* ``String getDateTimeStart()`` : event date and time start\n* ``String getDateTimeEnd()`` : event date and time end\n* ``boolean isSubscribed()`` : define if this event is subscribed or not (you will receive notification if true)\n\n\u003ch3\u003eCreate event\u003c/h3\u003e\n\nYou can create an event with begin and end date time of this event in String timestamp format according to RFC 3339 (ex: 2015-08-06T23:30:20+02:00) and precise a summary for this event.\n\n```\ncalendarNotifManager.getCalendarManager().createEvent(dateBegin, dateEnd, summary, new ICreateEventListener() {\n\n\t@Override\n\tpublic void onCreateSuccess(String id) {\n\t\t// event has been successfully created. The event id is returned on creation success\n\t}\n\n\t@Override\n\tpublic void onError(String description) {\n\t\t//an error occured during event creation\n\t}\n\n});\n```\n\n\u003ch3\u003eDelete event\u003c/h3\u003e\n\nYou can delete an evetn by ``eventId`` \n\n```\ncalendarNotifManager.getCalendarManager().deleteEvent(eventId, new IDeleteEventListener() {\n\n\t@Override\n\tpublic void onSuccess() {\n\t\t//event has been deleted\n\t}\n\n\t@Override\n\tpublic void onError(String description) {\n\t\t//an error occured during deletion process\n\t}\n});\n```\n\n\u003ch3\u003eEvent notification : subscription\u003c/h3\u003e\n\nYou can be notified for a specified event referenced by its ``eventId``. You will be notified when the event start and you can parameter the time in seconds before it actually starts when you want to be notified.\n\nIf you want to be notified one minute before the event start replace ``timeAboutToStart`` by 60\n\n```\ncalendarNotifManager.getNotificationManager().subscribeEvent(eventId, timeAboutToStart, new IEventListener() {\n\n\t@Override\n\tpublic void onEventStart(String eventId, String summary) {\n\t\t//called when the event start\n\t}\n\n\t@Override\n\tpublic void onEventAboutToStart(String eventId, String summary) {\n\t\t//called when the event is about to start (if you put a value \u003e0 for timeAboutToStart parameter)\n\t}\n});\n```\n\n\u003ch3\u003eUnsubscribtion\u003c/h3\u003e\n\n```\ncalendarNotifManager.getNotificationManager().unsubscribeEvent(eventId);\n```\n\n\u003ch3\u003eGet an Oauth2.0 token from Google developper console\u003c/h3\u003e\n\nFor your application to be abled to request token for Oauth2.0 google API, you have to get one Oauth2.0 token from https://console.developers.google.com\n\n* First create a project\n* in \"credentials\" tab \"create a new client ID\" choose \"installed application\",quote \"other\" and \"create client ID\"\n* in \"consent screen\" tab choose tour email address and a product name (it should apparently match your project id name but I may be wrong here)\n\nNow in \"crendentials\" tab you should have an Oauth2.0 token client ID that looks like :\u003cbr/\u003e\n``812741506391-h38jh0j4fv0ce1krdkiq0hfvt6n5amrf.apps.googleusercontent.com``\n\n* In \"API\" tab select \"Google + API\" and enable it\n* In \"API\" tab select \"Calendar API\" and enable it\n\n\u003cb\u003eExternal JAVA Library\u003c/b\u003e\n\n* json-simple  : http://code.google.com/p/json-simple/\n\n* clientsocket : https://github.com/bertrandmartel/socket-multiplatform/tree/master/client/socket-client/java\n\n* http-endec   : https://github.com/bertrandmartel/http-endec-java\n\n* serversocket : https://github.com/bertrandmartel/socket-multiplatform/tree/master/server/server-socket/blocking/java\n\n* websocket-java : https://github.com/bertrandmartel/websocket-java\n\n\u003cb\u003eExternal UI features\u003c/b\u003e\n\n* datetimepicker : https://github.com/xdan/datetimepicker by Chupurnov Valeriy\n\n* notification message using css3 : https://dhirajkumarsingh.wordpress.com/2012/05/06/cool-notification-messages-with-css3-jquery/\n\n\u003cb\u003eTODO\u003c/b\u003e\n\n* stock raw configuration of events subscribed\n* improve \"create event\" input arguments (attendees / place ...)\n* configurable polling of \"getEventList\" API in case of concurrent modifications\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fgcalendar-notification-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertrandmartel%2Fgcalendar-notification-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fgcalendar-notification-server/lists"}