Skip to content

Instantly share code, notes, and snippets.

function checkURLs() {
var errors = [];
var ss = SpreadsheetApp.getActiveSpreadsheet();
var rows = ss.getDataRange().getValues();
for (i in rows) {
var url = rows[i][0];
try {
UrlFetchApp.fetch(url);
} catch (e) {
// This error message parsing is gross, but it looks like
function myFunction() {
//oauth の設定
var oauth = UrlFetchApp.addOAuthService(Session.getActiveUser().getEmail());
oauth.setConsumerKey("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ
oauth.setConsumerSecret("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ
oauth.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F");
oauth.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
oauth.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
// TJ Houston tjhouston.com (tj@tjhouston.com)
// Bus Conduct Report
// Get template from Google Docs and name it
var docTemplate = ""; // this is what you want to change for your version
var docName = "BusConductReport";
// When Form Gets submitted
function onFormSubmit(e) {
function removeDuplicates() {
var sheet = SpreadsheetApp.getActiveSheet();
var data = sheet.getDataRange().getValues();
var newData = new Array();
for(i in data){
var row = data[i];
var duplicate = false;
for(j in newData){
if(row.join() == newData[j].join()){
duplicate = true;
function myFunction() {
rss = '<?xml version="1.0"?><rss version="2.0">';
rss += ' <channel><title>Twitter ' + type + ': ' + key + '</title>';
rss += ' <link>' + htmlentities ( json ) + '</link>';
rss += ' <pubDate>' + new Date() + '</pubDate>';
for (var i=0; i<len; i++) {
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = Utilities.jsonParse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
javascript:location.href='http://google.co.uk/search'+location.search
// script used in http://mashe.hawksey.info/google-refine-apps-script-integration
function setup(){
ScriptProperties.setProperty('active', SpreadsheetApp.getActiveSpreadsheet().getId());
}
function doGet(e){
var secret ="lemons"; //must match secret in Google Refine
if (e.parameter.secret == secret){
var ss = SpreadsheetApp.openById(ScriptProperties.getProperty('active'));
var sheet = ss.getSheetByName("Vertices"); // sheet name of where you want the data to go
var idx = parseInt(e.parameter.idx); // I had an idx column sequentially numbered to give me a row index
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software