Giter VIP home page Giter VIP logo

google-apps-script-library's Introduction

GoogleAppsScriptLibrary

This repository is a collection of documents written in Google Apps Script. Google Apps Script allows you to write scripts in Google Drive (very similar to how you might make a document in Google Drive) that interacts natively with a variety of Google services (e.g. Sheets, Docs, Drive, Gmail, Calendar, Contacts, etc). Not only that, but there are also ways to have your script interact with full APIs of those services (e.g. YouTube, Maps, etc) or even external services (in this repository I have examples for Trello, Plivo, & Twilio)

For developing in Google Apps Script, I definitely recommend extensions listed here: https://github.com/derekantrican/Google-Apps-Script-Library/wiki/Developing-in-Google-Apps-Script

Please use the issues page here to report issues with these scripts. You can also contact me at [email protected] and I can help you troubleshoot a problem


Programs Overviews:

External APIs

  • Plivo.gs: An example of how to use Google Apps Script to send & recieve text messages through Plivo
  • Set Slack Status.gs: An example of how to set Slack status (i.e. https://api.slack.com/docs/presence-and-status#custom_status)
  • Set Trello FollowUps.gs: With this example, you can create a new label on any card on any board (that you have access to) in Trello with the FollowUpThen format (e.g. [email protected]). This script is designed to run on a time basis (e.g. every 15 minutes) and will create a FollowUpThen reminder for those cards and delete that temporary label from the board
  • Twilio.gs: An example of how to use Google Apps Script to send & recieve text messages through Twilio

Google Calendar

  • Change Event Color.gs: This script uses the Official Google Calendar API to change the color of events in Google Calendar
  • Check for overlapping events.gs: This script will check multiple Google Calendars and check for conflicting (overlapping) events and alert the user to any such cases
  • Convert Event to All-Day.gs: This script will simply convert any event into an all-day event
  • Delete Event From Multiple Calendars.gs: The title is pretty self-explanatory here
  • Move events to calendar.gs: Can move (or just copy) events from one calendar to another
  • Set Invite Status.gs: This script will set your status on events you are invited to (YES/NO/MAYBE/INVITED)
  • Split Multi-Day Event.gs: The purpose of this script is to split events that last more than 24 hrs into sections no more than 24 hrs (the reason being that Google Calendar shows events >24hrs in the "all-day section" at the top of the calendar - making them harder to spot). This makes it easier to see when a large event is planned. This script still has some development work to be done and has issues

ICS-ICAL Sync: https://github.com/derekantrican/GAS-ICS-Sync

Tasks- Forms- etc

  • Any.Do Port.gs: This script was never fully working and should only be used for reference on how to create Google Forms and interact with Google Tasks This was an attempt to recreate the Moment function of the task manager Any.Do

Interesting libraries/articles

Here are a variety of articles, libraries, tools, etc I have found related to Google Apps Script:

google-apps-script-library's People

Contributors

agentd00nut avatar derekantrican avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

google-apps-script-library's Issues

ICS/ICAL parsing issue (multiple lines, "\n" not being accounted for)

ICS link: http://msdwarren.blob.core.windows.net/calendar/sports-all.ics

Resulting event:
image

BEGIN:VEVENT
CREATED;VALUE=DATE:19000101
DESCRIPTION:Start Time: 5:30 PM\nEnd Time: 7:30 PM\nSport: Baseball\nGender
 : Male\nClass(es): V\nLocation: Lawrence North\nOpponent(s): Lawrence Nort
 h High School
DTEND:20190410T233000Z
DTSTART:20190410T213000Z
DTSTAMP:20180404T055405Z
LAST-MODIFIED;VALUE=DATE:19000101
LOCATION:Lawrence North
SEQUENCE:0
SUMMARY:Baseball\, Varsity @ Lawrence North
TRANSP:Transparent
UID:e3020681
END:VEVENT

My program parses the ics file line by line, so that's why the description is getting cut off (because the ics file here has the description split onto multiple lines). I can probably look into adjusting the program to account for this. I'll also look into why the \n isn't getting treated properly.

ICS/ICAL sync timezone issue

The following function is having trouble parsing timezones and needs to be improved:

function GetUTCTime(parameter){
  parameter = parameter.substr(1); //Remove leading ; or : character
  if (parameter.includes("TZID")){
    var tzid = parameter.split("TZID=")[1].split(":")[0];
    var time = parameter.split(":")[1];
    return Moment.moment.tz(time,tzid).tz("Etc/UTC").format("YYYYMMDDTHHmmss") + "Z";    
  }
  else
    return parameter;
}

The solution is to use regex to parse out the parts of the string. Here is documentation on how this parameter is formatted: https://www.kanzaki.com/docs/ical/dtstart.html

ical/ics url Caching issue

This is a great library to use for continuous sync with google calendar. I was using it and found few issues. Don't know whether these issues are general or only for me. One of these issues is : The URL that I am using to profile ical/ics file, got cached in this script. I noticed this issue while i was testing by adding new events in file and trying to sync it with Google Calendar. New events are not captured.

I found and applied a solution for this. I would like to share and discuss it with you. If you allow me to commit my updates to your repo that would be help full to someone too. And we can discuss and solve issues further. :)

Again this script is Nice and saved lots of my time. Thanks!

ical sync script for (webcal?) facebook on google cal?

Hello,

I'm trying to use the ics/ical sync script:
https://script.google.com/a/redhat.com/d/1QeZFLSM1EkuFvYcryECI_xH-IZVe1-IxGRq_n6OoXp1CmVtSeTeigEx4/edit?usp=drive_web

To sync my Facebook calendar (more frequently) into my google calendar. (atm it does it once every 6-12 hours).

From FB, I get a url like this:
webcal://www.facebook.com/ical/u.php?uid=1000......

But when I try to run the script with the above url, it tells me that it's not valid url.

Is there away to get this to work?

ICAL/ICS fails to parse some dates

Relevant file

Example VEVENT:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Teamup Solutions AG//Teamup Calendar//EN
METHOD:PUBLISH
X-WR-CALNAME:Sitona Management | Heleen
X-WR-CALDESC:Administrator-4696524
X-PUBLISHED-TTL:PT15M
BEGIN:VTIMEZONE
TZID:Africa/Johannesburg
TZURL:http://tzurl.org/zoneinfo-outlook/Africa/Johannesburg
X-LIC-LOCATION:Africa/Johannesburg
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0200
TZNAME:SAST
DTSTART:19700101T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:TU175134705
DTSTART;TZID=Africa/Johannesburg:20180314T100000
SEQUENCE:0
TRANSP:OPAQUE
DTEND;TZID=Africa/Johannesburg:20180314T120000
URL:https://teamup.com/event/show/key/ksh5ryh1avutrvp3ar/event_id/175134705
LOCATION:Head Office
SUMMARY:Disciplinary Hearings (Koos Prinsloo\, Archie August)
CLASS:PUBLIC
DESCRIPTION:Description: Drivers and operators\n---\n
CATEGORIES:Heleen
DTSTAMP:20180312T173247Z
CREATED:20180309T123514Z
X-TEAMUP-WHO:Koos Prinsloo\, Archie August
END:VEVENT

Notice how the DTSTART elements instead have a ; after them and contain the Timezone ID. This should be incorporated and fixed according to this documentation

Script timeout

The main function will always time-out (after around 360secs) once coming to this line:
var events = component.getAllSubcomponents("vevent").map(ConvertToCustomEvent);
Can you please help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.