Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

calendarth

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calendarth

Fetch a public Google Calendar using AJAX

  • 0.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Calendarth

Fetch a Public Google Calendar with AJAX

A helper library that fetches and parses a public Google Calendar using the Google API v3.

This package requires jQuery to exist in the global namespace as $, hopefully future versions will decouple this dependency, pull requests welcome.

Install

bower install calendarth --save

Documentation

You can access Calendarth using the globally available variable calendarth or as a browserify module. Here's how you can get a new Calendarth instance by invoking the global:

var calendarth = window.calendarth({
  calendarId: 'xxx',
  appId: 'xxx',
});

Look into the build/ folder for available modular and global exposing builds.

Calendarth Options

When initializing a new Calendarth Object you may pass the following options:

  • calendarId Type: string required The Calendar's Id, looks like this: djasldj23ljd23dj23ldj2%40group.calendar.google.com
  • appId Type: string required The Google API app id.
  • maxResults Type: number Default: 20 Maximum results to fetch.

Calendarth Methods

calendarth.fetch(cb)

Fetches the entries of the calendar. Accepts a node style callback:

var cal = calendarth();

cal.fetch(function(err, calendarObj) {
  err === null; // true
  typeof calendarObj === 'object'; // true
});

The returned Object is the raw Data Object as passed from the Google Calendar Api v3, you can view a beautified object in this wiki page.

calendarth.getEventUrl(eventItem)

Will return a url that can be used to add the event to a user's Google Calendar.

cal.fetch(function(err, calendarObj) {
  err === null; // true

  // get the first event item
  var eventItem = calendarObj.item.shift();

  var addEventToCal = cal.getEventUrl(eventItem);
  console.log(addEventToCal);
});

Release History

  • v0.0.6, 12 Apr 2014
    • Add getEventUrl() feature.
  • v0.0.3, 9 Apr 2014
    • Published to NPM.
    • Now exposes a modular build too.
  • v0.0.1, 8 Apr 2014
    • Big Bang

License

Copyright 2013 Thanasis Polychronakis

Licensed under the MIT License

FAQs

Package last updated on 11 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc