Skip to content

Instantly share code, notes, and snippets.

var CLIENT_ID = '[%client_id%]';
var SCOPES = 'https://www.googleapis.com/auth/drive';
/**
* Called when the client library is loaded to start the auth flow.
*/
function handleClientLoad() {
window.setTimeout(checkAuth, 1);
}
var http = require("http");
http.createServer(function(request, response){
response.writeHead(200, {
"Content-Type": "text/html"
});
response.write("Hello World");
response.end();
var page = require('webpage').create();
page.onLoadFinished = function (status) {
page.render("cv.pdf");
phantom.exit();
}
page.open("http://yrezgui.phpfogapp.com/cv/index.html");
var bb, reader;
var meta = {
"title": "mozilla.png",
"mimeType": "image/png",
"description": "Mozilla Official logo"
};
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://developer.mozilla.org/media/img/mdn-logo-sm.png', true);
// Part of this code up to END OF (c) is:
/*
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
function getLotsOfFriendAndFo(){
// NOTE: before using running this script clear any existing data (apart from the header row) from the target sheet
var sheetName = "Followers"; // enter the sheet name to update
var friendOrFo = "followers"; // options 'friends' or 'followers
var optScreenName = "mhawksey"; // if you are getting someone elses friends or followers enter their screen name here
var statusString = "";
var your_screen_name = tw_request("GET", "account/verify_credentials.json").screen_name;
if (typeof optScreenName != "undefined") {
statusString = "&screen_name="+optScreenName;

#Part 1 - Setting up the Google Document

  • Go to Google Docs and create your spreadsheet
  • Give column names and make note of them as they become the names of your input fields
  • Give the spreadsheet the tab name of "DATA"
  • Click Tools > Script Editor
  • Choose 'Spreadsheet' under 'Create Script for'
  • Paste the following code at the bottom of the Code.gs file
/*
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
// Copyleft (ɔ) Ben Collerson {benc::benc::cc}
// Last modified 2012-10-10 14:17+10
// This code is based on this Google Apps scripting tutorial written by Romain Vialard.
// https://developers.google.com/apps-script/articles/gmail_filter_sms
// Notes on getting this code to work..
//
// In addition to following the steps from the link above the following steps must be done:
//
// The rest of this code is currently (c) Google Inc.
// setRowsData fills in one row of data per object defined in the objects Array.
// For every Column, it checks if data objects define a value for it.
// Arguments:
// - sheet: the Sheet Object where the data will be written
// - objects: an Array of Objects, each of which contains data for a row
// - optHeadersRange: a Range of cells where the column headers are defined. This
// defaults to the entire first row in sheet.
// - optFirstDataRowIndex: index of the first row where data should be written. This