These utilities are grouped into related files, for simpler copy & paste to your scripts.
A couple of helper functions to convert to & from A1 notation.
| import urllib | |
| from wordpress_xmlrpc import Client, WordPressPost | |
| from wordpress_xmlrpc.methods import posts | |
| import xmlrpclib | |
| from wordpress_xmlrpc.compat import xmlrpc_client | |
| from wordpress_xmlrpc.methods import media, posts | |
| import os | |
| ########################### Read Me First ############################### | |
| ''' | |
| ------------------------------------------In DETAIL-------------------------------- |
| user www-data; | |
| worker_processes auto; | |
| pid /run/nginx.pid; | |
| ## based on https://gist.github.com/cboettig/8643341bd3c93b62b5c2 | |
| events { | |
| worker_connections 1024; | |
| } |
| // | |
| // Create a PDF by merging values from a Google spreadsheet into a Google Doc | |
| // ========================================================================== | |
| // | |
| // Demo GSheet & script - http://bit.ly/createPDF | |
| // Demo GDoc template - 1QnWfeGrZ-86zY_Z7gPwbLoEx-m9YreFb7fc9XPWkwDw | |
| // | |
| // Config | |
| // ====== |
| /* | |
| 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 |
| function onOpen() { | |
| var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}]; | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| ss.addMenu("Fitness Diaries", menuEntries); | |
| } | |
| function createDocFromSheet(){ | |
| var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id | |
| var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries | |
| // get the data from an individual user |
| #!/usr/bin/python | |
| import sys | |
| import os | |
| import pprint | |
| import subprocess | |
| import pickle | |
| import atexit | |
| import simplejson as json | |
| sys.path.insert(0, "../API") |