View youtube.gs
/**
* Google Apps Script Library for the youtube API
*
* Documentation can be found:
* https://developers.google.com/youtube/v3
*
* OAuth2 Scopes
* https://www.googleapis.com/auth/youtube
* https://www.googleapis.com/auth/youtube.force-ssl
View Code.gs
// Grabs my latest tweet favorited using the handy TwtrService wrapper by +MartinHawksey - https://goo.gl/2it7yb
function getLatestTweet() {
var data = TwtrService.get("statuses/user_timeline", {screen_name: /*"YourTwitterHandle(without the @)"*/, count: 1});
var id = false;
for (var i = 0; i < data.length; i++){
if (data[i].favorited) {
id = data[i].id_str;
break;
}
}
View slide_template.gs
// Port of Slides API demo by Wesley Chun to Google Apps Script
// Source: http://wescpy.blogspot.co.uk/2016/11/using-google-slides-api-with-python.html
function slides_template() {
/*
from apiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
*/
View code(onOpen).gs
function showRow(doc){
var cache = getCache_();
try {
// if cache is set and id matches handle open row for editing
if (cache.id && cache.id === doc.getId()){
doc.toast("Opened on row for editing...");
var sheet = doc.getSheetByName(cache.sheet);
if (sheet != null) {
if(cache.row){
View code.gs
function doGet(e) {
var html = HtmlService.createTemplateFromFile('index');
html.e = e.parameter;
return html.evaluate().setTitle('Opening a row...');
}
function setCache(parameter){
var values = {
'row': parameter.row,
'header':parameter.header,
View index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script>
var e = <?!= JSON.stringify(e) ?>;
google.script.run.withSuccessHandler(onSuccess).setCache(e);
function onSuccess(url){
window.top.location.href = url;
View sendvotes.gs
function myFunction() {
try {
var out = [];
if (GmailApp.getInboxUnreadCount() > 0 ){
var threads = GmailApp.getInboxThreads();
for (var i = 0; i < threads.length; i++) {
out.push([threads[i].getMessages()[0].getFrom(), threads[i].getFirstMessageSubject(), threads[i].getMessages()[0].getDate()]);
threads[i].moveToArchive();
}
View application.js
var Grailbird = function (type, date, data) {
Grailbird.data = Grailbird.data || {};
Grailbird.data[type+'_'+date] = data;
};
(function(exports) {
"use strict";
var User = {},
Tweets = {},
View GoogleAppsScript2GitHub.gs
/*
To use you need to create an application on Github at https://github.com/settings/developers
The callback in this needs to be set to https://script.google.com/macros/d/{SCRIPT ID}/usercallback
Where {SCRIPT ID} is the ID of the script that is using this library. You can find your script's ID in the Apps Script code editor by clicking on the menu item "File > Project properties".
In this example code I've stored the apllicaitons clientId and clientSecret in the Script Properties:
- git_clientId
- git_clientSecret
View FL Data Processing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.