When @cogdog & @twoodwar Were Building Websites From Google Spreadsheets Years Ago https://t.co/Im7oCecvpg — Keegan?Long-Wheeler (@KeeganSLW) February 28, 2018 This post from Keegan kicked of this demo.1 The goal is to create a pretty flexible template for using Google Forms to Google Sheets to simple website. I opted to do this one in Vue but may get around to doing it in plain JS or jquery if time allows. The first thing you need to do is make the form and put in some entries. You’ll be happier if your form prompts aren’t super long. Make them readable just keep them concise.2 Once you’ve made a few entries so you have some data to work with, publish your spreadsheet as HTML. File>Publish to the Web. Click OK and what not. Don’t bother going to that link as Google has made that a fake promise. You just need the ID of the document in your current view. It’ll be something painful like 12WsyLvtfIPJkCXgEXsRkrI6dS0_K6brJikZqzkQa8TU and is visible in the URL after the /d/ but before the /edit. You can see the spreadsheet here. It doesn’t really matter but !full transparency! With that ID in hand, you want to go to a URL like so. You could manipulate the number in the URL to hit different pages in the spreadsheet. https://spreadsheets.google.com/feeds/list/12WsyLvtfIPJkCXgEXsRkrI6dS0_K6brJikZqzkQa8TU/1/public/values?alt=json You should […]
I found myself in a strange situation where I needed to know if a page had a child. Natively the WP API lets you know if a page has a parent but not the reverse. First I had to write a function that writes some data to a custom field if a page has a child. Then I started writing this post and realized I needed to do the reverse and now I’ve written a function that writes data to a parent when the child is created. Now that I had the data being written to the custom field, I needed to make that data visible in the WP REST API. Luckily, Jeff put up a snippet for that not too long ago. Now I also wanted to be able to return data based on the contents of the has_children field. This filter1 does that. Now a URL like the one below will give me pages with children but without parents. /wp-json/wp/v2/pages?_embed&per_page=30&has_children=1&parent=0 This will help me make a fairly large menu structure more manageable and I figured having something like this all in one place might help someone else. 1 I usually call things ‘chunks’ of code but I’m trying to improve my vocab.
Playing “Mah-Jong” at the Clubhouse of the Century Village Retirement Community. flickr photo by The U.S. National Archives shared with no copyright restriction (Flickr Commons) Marie has nice post summarizing the Georgetown Community presentation at Domains. And nowEvelyn’s post reminded me to write a post on a site instead of just in my head. The title of the presentation ‘Just a Community Organizer’ is a nod to the fact that community is hard to do. It can be hard technically but it’s often even more difficult on the human side. As Evelyn brought up . . . community is not created by the technical ability to bring content together. There are lots of ways this can succeed technically but fail socially–> The stuff is there but no one cares. At the same time, technology failures can prevent community from forming where you have all the other factors–> People want to see what’s going on but can’t find and interact with the stuff they want in reasonable ways. There’s also the idea that people might not know what they want to see (or how they want to see it) until it’s given as an option or scaffolded into as an action. Can we present content in ways that are novel and interesting that inspires curiosity and interaction? You can’t do that […]
Image from page 96 of “St. Nicholas [serial]” (1873) flickr photo by Internet Archive Book Images shared with no copyright restriction (Flickr Commons) I’ve talked to a number of people a number of times about seeing faculty using Feed WordPress to syndicate content to a motherblog when they’d really be better served by using a feed reader like Feedly.1 Feed WordPress is great and very useful but if you don’t want to archive the content or take advantage of some of the more advanced options (auto-categorizing, auto-tagging, doing stuff with author pages etc.) then it usually is a bit more hassle than it’s worth. I thought it’d be pretty easy to build a little custom page to display a series feeds from sites in one place. It took me a bit to get it straight but it wasn’t too bad. This example loads 10 sites fairly quickly. I’m currently just showing the source site’s URL and the 5 most recent posts with titles and dates. It’d be easy enough to add other stuff – excerpt, full post content, featured image etc. It’d also be pretty easy to pass the URLs to the page from a Google Spreadsheet which I’ll probably do in the near future. See the Pen wp json api multi fetch by Tom (@twwoodward) on CodePen. 1 Obligatory […]
Cowboy Jason Stanley performing a riding trick at the Round-Up, Pendleton, Oregon flickr photo by UW Digital Collections shared with no copyright restriction (Flickr Commons) I’ve been doing quite a bit more with the WordPress Rest API lately. There’s plenty of documentation and tutorials out there but most of it still feels a bit scattered to me so I’m going to stick a few of the basics here and add a few things that have come up repeatedly that aren’t quite as basic. There’s an attempt here to move upwards in complexity with the examples but to keep them as clean as possible. This will deal entirely with getting the data. I haven’t done much with using the API to write or modify data. Get the Info There are many ways to get data depending on your library of choice or if you’re using vanilla JS. I’ve played with fetch and Axios on the lighter side and jQuery, Vue, and Angular (v1) on the heavier/more involved side of things. I’ll use jQuery in this version because it’s fairly popular but here’s a Vue example. The example below does a basic jQuery ajax call for the JSON associated with blog information. See the Pen simple jquery get of WP JSON for the site by Tom (@twwoodward) on CodePen. The URL Structure/Accessing […]
As part of some thoughts on building out a series of reflective views for student portfolio blogs, I thought seeing your WordPress posts in the TimelineJS view might be a useful way to look back over your progress. I intend to wrap this into a custom spreadsheet template and/or a plugin1 but figured I’d sketch out how it works so far in case anyone was interested. The WP Rest API makes it pretty easy to write the data via Google Script. I just want to cut out chunks of the data and put it in the right fields. The following script does that and writes it to a page named “wp.” 1 Or maybe just a page where you throw in a blog URL and get a bunch of alternate view/data options.