npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

calendarth

v0.0.6

Published

Fetch a public Google Calendar using AJAX

Downloads

6

Readme

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