Google Script Folder Copying Postmortem

Image from page 93 of “Elementary and dental radiography” (1813) flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) This is the blow-by-blow documentation of a failure of sorts. Nothing makes me angrier than failing to deliver on something I said I could/would do. I ended up delivering what was needed but the way I had to do it was ugly and time-intensive. All of this happened because of two things- insufficient initial testing and not enough knowledge on my end at a couple of key steps. I’ve got lots of ideas I need to test out now that I’ve learned a few things the hard way but I thought it’d be beneficial to see how I tried to think through this thing when various paths failed . . . and with that welcome to my postmortem. I thought we had the Social Work Google Docs Digital Portfolio thing figured out. I even wrote a blog post. Events coalesced to remind me that I do not know enough stuff. However, I do intend to learn from painful mistakes like this and give you my tears and frustration for you free of charge.1 Initial tests felt a bit slow but nothing too bad. Google Scripts will timeout after 6 minutes but I thought we’d be ok […]

WordPress – Comments to Spreadsheet

Image from page 981 of “A system of instruction in X-ray methods and medical uses of light, hot-air, vibration and high-frequency currents : a pictorial system of teaching by clinical instruction plates with explanatory text : a series of photographic cli flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) This is a bit odd but if you work in education it’s quite possible it’ll come up . . . Sometimes people just want the blog comments in a nice friendly CSV file. That might be for grading, it might be for further analysis in Voyant or something like that. What I need to do is write a little plugin for the export like Alan did for posts but until I get around to that I took advantage of another plugin Alan wrote to expand comments to the 100 most recent comments. So since I have lots of comments available in the feed, I can just use the =IMPORTXML function to port right into Google Sheets. There’s probably a smart way to parse out multiple XML fields at a time but this seems to work ok. All the functions I used are broken down in the sheet embedded below. Most are simply some version of IMPORTXML(b1,”//title”). B1 is the URL for the feed and the […]

Photography – Week 150-ish

I’ve missed a few weeks. No guilt. I am playing around with more phone photography. I doing some stuff on Instagram but have mixed feelings there. Lots of ‘likes’ and what not but I’m not sure what else. Given a chunk of the missed time was over break you’ll see a lot more nature shots in here. I’m also drawing more with the kids. Using only the finest Bic pens . . .

22

Weekly Web Harvest for 2017-01-15

Rogue Scientists Race to Save Climate Data from Trump | WIRED At Penn, a group of coders that called themselves “baggers” set upon these tougher sets immediately, writing scripts to scrape the data and collect them in data bundles to be uploaded to DataRefuge.org, an Amazon Web Services-hosted site which will serve as an alternate repository for government climate and environmental research during the Trump administration. (A digital “bag” is like a safe, which would alert the user if anything within it is changed.) It’s more than just the words Personal sites, our blogs, these were once our playgrounds. My own site was the first place I added rollover images, CSS for fonts, tried out a “table free” design. I wrote about the web, surrounded by my own experiments with the web. We all did, and it was only in reading those words from 1999 that I realised there was more to owning your own content than simply not publishing your words elsewhere.

Social Work Digital Portfolio – Google Docs Style

Image from page 589 of “Modern magic. : A practical treatise on the art of conjuring.” (1885) flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) Our Social Work program has traditionally done large paper-based student portfolios. They wanted to move to something digital. That led to some conversations about Google Docs and our options there. They needed the ability to- provision a set of folders and documents to individual students allow the students to edit/add to the folders stop editing rights at a certain date make the student folder anonymous for faculty reviewers The solution I ended up coming up with uses a Google Spreadsheet with some custom Google Script. It’s based on a spreadsheet with column A being the student email and column B being the anonymous number or name. You make a parent folder (Social Work 2017) and put the spreadsheet and the folder (student portfolio) you want to copy in the folder. You add the student emails and secret IDs to the spreadsheet. The script is activated via custom-menu element imaginatively entitled ‘Share Files’ and it copies the student portfolio for each student email listed, names it with the addition of the secret ID, and gives the student editor rights to their particular folder and its contents. It also writes the […]

15

Weekly Web Harvest for 2017-01-08

Peace sign selfies could let hackers copy your fingerprints Posing for a picture while holding your hands up in a peace sign could pose a security threat, with hackers able to recreate prints that are the key to phones, computers and tablets.  Researchers at Japan’s National Institute of Informatics (NII) have found that fingerprints can be easily recreated from photos taken up to three metres away without the need for advanced technology. So long as the picture is clear and well-lit, prints can be mimicked.  Richard Prince Disowns His Ivanka Trump Portrait, Possibly Increasing Its Value However, given the many layers of irony, filtering, and conceptual framing that characterize Prince’s oeuvre, it’s unclear whether his public disowning of the work will negatively affect its worth and status as an authentic Richard Prince, or, on the contrary, it will add to its resale value. Ram Pages Reflective Analysis | qwertyuiop While I have made efforts to improve my understanding of other ideas and beliefs, I don’t necessarily accept them as fact, but a possibility that should be considered.  RamPages has made me aware of the way I articulate my ideas and encouraged me to be careful when discussing controversial or sensitive topics.  It has also made me elaborate as to be sure my point came across the way it was intended.

13

500 Error on wp-admin after upgrade

This happened with one of our individual installs and it’s happened before (but I forgot the solution) so I’m writing it down. After the upgrade to 4.7.1, the front of the sight still worked but attempts to get to wp-admin failed with a 500 error and the URL was redirecting to something with upgrade.php? in the URL. Solution Change the name of the plugin folder (I just prepend an underscore). Revisit your login URL. Run the database upgrade as prompted. You should now be in the admin zone. Fix your plugin folder name. Easy but also easy to forget.

08

Weekly Web Harvest for 2017-01-01

I Can’t Answer These Texas Standardized Test Questions About My Own Poems | The Huffington Post How many stanzas are in this poem? Where are they located? I would appreciate your help. Thank you so much!” Oh, goody. I’m a benchmark. Only guess what? The test prep materials neglected to insert the stanza break. I texted him an image of how the poem appeared in the original publication. Problem one solved. But guess what else? I just put that stanza break in there because when I read it aloud (I’m a performance poet), I pause there. Note: that is not an option among the answers because no one ever asked me why I did it. h/t or blame for this extra does of sad goes to Enoch Hale Netflix/sketchy: A task based API for taking screenshots and scraping text from websites. A task based API for taking screenshots and scraping text from websites. h/t Kin Lane’s GitHub stars . . . Emmet — the essential toolkit for web-developers Taking the plunge with Emmet . . . we’ll see how it goes. Cosmic JS | Cloud-Hosted Content Management Platform, API-First CMS Cosmic JS offers an intuitive API that can deliver content to any website or application. This gives you the freedom to build your application using any programming language and allows […]

Bootstrap Collapsible Shortcode Plugin

There are a bunch of these out there but the ones I knew of didn’t quite do what was needed by the Focused Inquiry faculty involved in this project. They wanted a couple things to be possible. The ability to link to specific elements via URL and have them expand. The URL to those elements to remain consistent even if the order of the elements was changed. An “email this URL” link to enable faculty to send the URL to students Plus/Minus indicators based on expanded/collapsed. Most shortcode plugins I’ve seen either don’t have an ID for the collapse element or make it sequential (which changes if you shift the order). Neither works well for a URL that needs to be consistent. I’ve never seen one to do the email element. In my head, I made this way harder than it needed to be. It ends up being just two shortcodes- one for the collapsible container and one for the item-level elements. I found this Bootstrap snippet that did most of the functional Bootstrap stuff that I needed. I found a script to let me expand elements via URL parameters. I reminded myself what a freaking mailto link structure looked like. Now I just had to figure out what variables needed to be set in the shortcode and how the […]

Minimal WordPress

Sometimes people just want a little bit of WordPress. Before hanging a left with the anth101.com site, we pruned it waaaaay down and tried to make it as simple as possible. This is a pretty solid example that WordPress can be just about anything you want if you’re willing to put in a bit of time and effort. I figure having all these things in one place will help someone else (me most likely) at some point. Hide Posts from Other Authors If you have many authors, you often don’t want them seeing a bunch of posts in the admin area that they can’t edit. Make their lives easier and hide everything else. I believe this is where I found the code. Remove Sidebar Options To further clean up the sidebar for authors, the following code removes lots of things that you don’t want students bothering with anyway. You can get lots of details on this in the codex. Go to Directly to Post, Do Not Pass Dashboard This shunts people directly to the posts area rather than going to the dashboard on login. Posts in Single Column This sets the posts to single column display to simplify writing and was found here. Purify and Rename the Post Page This chunk removes certain meta boxes and restructures the language on […]