{"id":13463430,"url":"https://github.com/northworld/google_calendar","last_synced_at":"2025-03-25T06:31:58.030Z","repository":{"id":1237268,"uuid":"1175281","full_name":"northworld/google_calendar","owner":"northworld","description":"A minimal wrapper around the Google Calendar API","archived":false,"fork":false,"pushed_at":"2022-09-28T17:31:24.000Z","size":495,"stargazers_count":315,"open_issues_count":4,"forks_count":134,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-29T13:50:57.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://northworld.github.io/google_calendar","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"johnpapa/generator-hottowel","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/northworld.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-16T20:57:23.000Z","updated_at":"2024-09-13T20:19:32.000Z","dependencies_parsed_at":"2022-07-06T13:51:59.513Z","dependency_job_id":null,"html_url":"https://github.com/northworld/google_calendar","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/northworld%2Fgoogle_calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/northworld%2Fgoogle_calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/northworld%2Fgoogle_calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/northworld%2Fgoogle_calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/northworld","download_url":"https://codeload.github.com/northworld/google_calendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414332,"owners_count":20611357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-07-31T13:00:53.312Z","updated_at":"2025-03-25T06:31:57.719Z","avatar_url":"https://github.com/northworld.png","language":"Ruby","funding_links":[],"categories":["Web Apps, Services \u0026 Interaction","Ruby"],"sub_categories":["API Clients"],"readme":"= Google Calendar\n\nA fast lightweight and minimalist wrapper around the {Google Calendar}[https://www.google.com/calendar/] api.\n\n{\u003cimg src=\"https://badge.fury.io/rb/google_calendar.svg\" alt=\"Gem Version\" /\u003e}[http://badge.fury.io/rb/google_calendar] {\u003cimg src=\"https://travis-ci.org/northworld/google_calendar.png?branch=master\" alt=\"Build Status\" /\u003e}[https://travis-ci.org/northworld/google_calendar] {\u003cimg src=\"https://codeclimate.com/github/northworld/google_calendar/badges/gpa.svg\" /\u003e}[https://codeclimate.com/github/northworld/google_calendar] {\u003cimg src=\"https://codeclimate.com/github/northworld/google_calendar/badges/coverage.svg\" /\u003e}[https://codeclimate.com/github/northworld/google_calendar]\n== Install\n  [sudo] gem install 'google_calendar'\n\n== Setup\n\n\u003cb\u003eImportant Changes: Google no longer supports the 'urn:ietf:wg:oauth:2.0:oob' out-of-band OAuth method.  You must setup your OAuth Credentials with a publically accessible URL where you can grab your code from the URL paramaters after approving the OAuth request.  If your product is a Web Application, you can automate this set up by pointing the redirect_url to the appropriate method of your application.\u003c/b\u003e\n\n\u003cb\u003eObtain a Client ID and Secret\u003c/b\u003e\n\n1. Go to the {Google Developers Console}[https://console.developers.google.com/].\n1. Select a project, or create a new one (at the top of the page).\n1. In the sidebar on the left, select Library.\n1. Type in 'Google Calendar' in the search box and click on 'Google Calendar API' in the results.\n1. Click on the 'Enable' link at the top of the page.\n1. In the sidebar on the left, select Credentials.\n1. If you haven't done so already, create your 'OAuth client ID' by clicking 'Create Credentials -\u003e OAuth client ID'.  Choose Web Application as the type.  \n1. You must also provide an \"Authorized redirect URIs\" which is a publically reachable URL where google will redirect to after the OAuth approval.  Google will append the paramater 'code=\u003cyour auth code\u003e' to this URL during redirection which will include the necessary code to authenticate the usage of this application.\n1. \u003cem\u003eTake note of the Client ID and Client Secret as you'll need to add it to your code later.\u003c/em\u003e\n1. In the sidebar on the left, select \"OAuth consent screen\".  You must setup your Application Name, and add \"Test users\" if this is for personal use (i.e. you are setting up links to at limited set of known users' calendars), or \"Publish\" your app if this is for public use.\n\n\u003cb\u003eFind your calendar ID\u003c/b\u003e\n\n1. Visit {Google Calendar}[https://www.google.com/calendar/] in your web browser.\n1. In the calendar list on the left, click the three vertical dots next to the appropriate calendar, then select 'Settings and sharing'.\n1. From the left toolbar, choose 'Integrate Calendar'.  \n1. In the Integrate Calendar section, locate the Calendar ID at the top of the section.\n1. Copy the Calendar ID.\n\n== Usage (readme_code.rb)\n  require 'rubygems'\n  require 'google_calendar'\n\n  # Create an instance of the calendar.\n  cal = Google::Calendar.new(:client_id     =\u003e YOUR_CLIENT_ID,\n                             :client_secret =\u003e YOUR_SECRET,\n                             :calendar      =\u003e YOUR_CALENDAR_ID,\n                             :redirect_url  =\u003e YOUR_REDIRECT_URL # This must match a url you permitted in your OAuth setting\n                             )\n\n  puts \"Do you already have a refresh token? (y/n)\"\n  has_token = $stdin.gets.chomp\n\n  if has_token.downcase != 'y'\n\n    # A user needs to approve access in order to work with their calendars.\n    puts \"Visit the following web page in your browser and approve access.\"\n    puts cal.authorize_url\n    puts \"\\nCopy the code out of the paramters after Google redirects you to your provided redirect_url\"\n\n    # Pass the ONE TIME USE access code here to login and get a refresh token that you can use for access from now on.\n    refresh_token = cal.login_with_auth_code( $stdin.gets.chomp )\n\n    puts \"\\nMake sure you SAVE YOUR REFRESH TOKEN so you don't have to prompt the user to approve access again.\"\n    puts \"your refresh token is:\\n\\t#{refresh_token}\\n\"\n    puts \"Press return to continue\"\n    $stdin.gets.chomp\n\n  else\n\n    puts \"Enter your refresh token\"\n    refresh_token = $stdin.gets.chomp\n    cal.login_with_refresh_token(refresh_token)\n\n    # Note: You can also pass your refresh_token to the constructor and it will login at that time.\n\n  end\n\n  event = cal.create_event do |e|\n    e.title = 'A Cool Event'\n    e.start_time = Time.now\n    e.end_time = Time.now + (60 * 60) # seconds * min\n  end\n\n  puts event\n\n  event = cal.find_or_create_event_by_id(event.id) do |e|\n    e.title = 'An Updated Cool Event'\n    e.end_time = Time.now + (60 * 60 * 2) # seconds * min * hours\n  end\n\n  puts event\n\n  # All events\n  puts cal.events\n\n  # Query events\n  puts cal.find_events('your search string')\n\nThis sample code is located in readme_code.rb in the root folder.\n\n== Ruby Support\nThe current google_calendar gem supports Ruby 2.1 and higher -- because of the json gem dependency.  We maintain support for Ruby 1.8.7, 1.9.3 and 2.0 on different branches.\n\n== Notes\n* This is not a complete implementation of the calendar api, it just includes the features we needed to support our internal calendar integration. Feel free to add additional features and we will happily integrate them.\n* Did you get an SSL exception?  If so take a look at this: https://gist.github.com/fnichol/867550\n\n== Contributing to google_calendar\n\n* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet\n* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it\n* Fork the project\n* Start a feature/bugfix branch\n* Commit and push until you are happy with your contribution\n* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.\n* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.\n\n== Running Tests\nThe first time you run +rake+ +test+ Rake will copy over +.env.test+\nto +.env+ for use by Dotenv.  You can also use +.env.default+ as your\nown starting point, just remember to copy it over to +.env+ before\nrunning tests.\n\nYou can modify +.env+ with your own credentials and don't worry about\naccidentally committing to the repo as +.env+ is in the +.gitignore+.\n\n== Copyright\n\nCopyright (c) 2010-2022 Northworld, LLC. See LICENSE.txt for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorthworld%2Fgoogle_calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorthworld%2Fgoogle_calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorthworld%2Fgoogle_calendar/lists"}