October 2, 2019

Google Form to Script to Make Folder, Document, Share it etc.

My click bait titles are so powerful! This isn’t anything special but it does show a couple of Google Script patterns that we reuse all the time. Folders are made in other folders! Documents are made in those folders. Things are shared. Ownership is assigned! So many things. The following script takes a form submission and then . . . makes a folder in a particular folder, shares it with particular people, sets the ownership makes a document within that sub-folder, shares it with particular people, sets the ownership adds them as a viewer on a different folder deals with some issues VCU has with students having both @vcu.edu and @mymail.vcu.edu email addresses but without them behaving as if they are the same in Google Details are in the comments. The trigger is on form submission.

Wonderous at the Human Scale

I should not have to list out the things that can make one feel weary after a few (hours? minutes?) of opening an internet device. Is anyone else worn out? Thankfully, enough things happen, without seeing them coming, to- at least for now– counter the flood. And invariably for me, these are at the individual […]

Photography #172

Not that I usually have a theme but this is a stranger mix than normal. Helping teach a photography class while my oldest son takes a photography class has led to interesting opportunities.

Duplicating Posts from One Site to Another in Multisite

Origin Story We had two sites on a multisite installation. The desire was for site A (or any number of sites) to have posts in a certain category duplicated to site B. In many scenarios we’d just use Feed WordPress but in this case both sites were private. There may be a way to get that working in FeedWordPress but I am not aware of it. These two functions will copy content from one site to another when it is published. It won’t sync up editing or anything like that but it’s a decent start for doing that if it was desired. The explanation is mainly in the code comments. I’m not sure if that’s useful but I also realize that the audience for what I write1 is mostly me and I’m ok with it. Now you could change add_action( ‘publish_post’, ‘copy_post_replicator’, 10, 2 ); to add_action( ‘update_post’, ‘copy_post_replicator’, 10, 2 ); and it’ll run on any post update. The problem there is that edits to the posts will result in duplicates on the destination site. If we wanted to get fancy, we could record the post ID of the duplicate post as a custom field on the original and do some updating function based on that but this was a very fast response rather than a full blown project. […]

Freewriting Fun: A Comic of Musical Notes

While my students were freewriting stories, poems, play skits, comics and other ideas, I was working on this comic in my notebook about a staff that has lots its notes, and the notes who come to the rescue. I got a kick out of making the notes with faces and expressions. Peace (in tiny boxes), […]