30

Google Spreadsheet Unique Item Count

Google sheets can do some neat tricks. Here’s how you can generate a chart of unique words submitted and their counts. The form for collecting a single word. Loading… The formula to paste in column C. All credit to this Stack Overflow post. =QUERY({B:B,B:B},”select Col1, count(Col2) where Col1 != ” group by Col1 label count(Col2) ‘Count’”,1) The embedded chart. In messing around with options around this, I was also looking at getting JSON data out of Google sheets. https://spreadsheets.google.com/feeds/list/1gwiU0j-o50m1L5yEU7OR-v9GSuxNyQeD5_zosjBpYvE/1/public/values?alt=json To break that down https://spreadsheets.google.com/feeds/list/YOUR_SHEETS_UNIQUE_ID/THE_NO_1_FOR_THE_FIRST_SHEET/public/values?alt=json It works with Benson as seen over here which is pretty neat. Although I haven’t gotten search working.

Benson, Discourse, and WordPress

It sounds like an exciting new buddy movie . . . but it’s an attempt to better integrate elements of our Discourse install in WordPress using Benson (a neat plugin Mark made that lets you use Angular w/in WordPress). I decided to look into this after seeing this example using Twig. Ordinarily, I’d do something like this using Discourse’s RSS feeds and probably manipulating it with FacetWP. I’m opting to look at these other options for a few reasons. One, with WordPress expanding JSON I want a better idea of how all that works in comparison to RSS. Two, I don’t really like duplicating all this content through the syndication option if I can achieve the same effect in other ways. I’m not so worried about space (although I don’t like to waste it) but there are occasionally issues with updates and duplications using RSS the way we do. I wonder if JSON will straighten some of that out. Angular also opens up a realm of options as you get closer to writing code rather than relying on plugins. And finally, I want to knit Discourse more tightly to WordPress. That’ll matter because of the strong resistance to “another site?” responses. What can you get out of Discourse via JSON? Short answer- lots of stuff. Much like WordPress you can […]

Flickr Group Widget – Round 1

flickr photo shared by Little Orange Crow under a Creative Commons ( BY-NC ) license The goal here was simply to take the Flickr API knowledge I’d gained earlier and apply it within a WordPress widget. In doing so, I learned a few things. The primary one being that I often harm myself by being fairly good at making stuff work rather than understanding what I’m doing. That’s what I did here. The Flickr API thing was pretty legitimate. I knew what I was doing there but I pretty much crammed it into a widget plugin template without really understanding the whole thing. That led to more confusion around print

25

Weekly Web Harvest (weekly)

Sea level study: James Hansen issues dire climate warning. “: Hansen’s study comes via a nontraditional publishing decision by its authors. The study will be published in Atmospheric Chemistry and Physics, an open-access “discussion” journal, and will not have formal peer review prior to its appearance online later this week. [Update, July 23: The paper is now available.] The complete discussion draft circulated to journalists was 66 pages long, and included more than 300 references. The peer review will take place in real time, with responses to the work by other scientists also published online. Hansen said this publishing timeline was necessary to make the work public as soon as possible before global negotiators meet in Paris later this year. Still, the lack of traditional peer review and the fact that this study’s results go far beyond what’s been previously published will likely bring increased scrutiny. On Twitter, Ruth Mottram, a climate scientist whose work focuses on Greenland and the Arctic, was skeptical of such enormous rates of near-term sea level rise, though she defended Hansen’s decision to publish in a nontraditional way.” tags: weekly socialmedia twitter peerreview research Rachel Berwick – may-por-é “During the attack, the Carib tribe had taken parrots which the Maypure’ people had kept as pets.  Von Humboldt noted that the parrots were speaking words, not […]

results of Flickr api group request

Flickr API Basics – Pulling a Group Feed

Someone at work mentioned that the Flickr WordPress widget didn’t work with group photos. We use this group as part of our (sort of just getting started) Friday photo walks. Since I’m trying to learn stuff I figured I’d play a bit with the Flickr API and see how that worked. After getting an API key, my first stop was at URLs. I thought that’d mean endpoints like on Instagram but it was the URL structures for photos. Useful and needed but not what I thought it’d be. I then saw in the right hand sidebar groups and browse. That turned out to be a list of groups. I ended up finding what I wanted at groups.pools get photos. I planned to get the information in json if I could given I’d just spent some time figuring out how that worked so I went back to the main index thinking the json response format would show me how to ask for json data given the variables I’d seen as options in groups.pools.getphotos. It didn’t. This section shows the structure of the json response. Which makes sense it just wasn’t what I was looking for. I found what I was looking for under request.formats which makes sense. This shows the URL structure. https://api.flickr.com/services/rest/?method=flickr.test.echo&name=value is the basic URL. Method is the thing […]

He stood so still

He stood so still while the world moved on around him. Just a little animated gif made from two shots I took walking past this gentleman staring so intently at his phone. He didn’t move a bit but because I was walking the shot shifted some allowing me to animate it and give you this 3D feel. I know I’ve seen this before but my memory of the name for it is hazy. It did lead me to stereoscopy, stereo photography and animated stereograms so sometimes a bad memory leads to good things. And it turns out at least one person would call this a stereoscopic animated gif. I also figured this was a #ds106 assignment and was not disappointed. Since this was the first #ds106 assignment I’ve done in a long while, I threw in a tutorial as a form of tithing. I do all of this of my own free will and in spite of Jim Groom’s personality rather than because of it.

Scraping Instagram – Take 3

flickr photo shared by JeepersMedia under a Creative Commons ( BY ) license I started to apologize for writing three posts on this and promising not to do any more but I reconsidered. This is my site. I’ll write whatever I want. Skip it if it bores you or exile me from your feed reader.1 Alan’s comment got me thinking that using spreadsheet formulas was not necessary and it felt awkward to me anyway. So I figured out how to do it all in the php. I’ll include the relevant portion of the code below. You can get the whole thing here. The key is substr_count which will find stuff in a string and count it. The other little piece is boolval which returns true if it’s greater than 0. 1 Plus no one reads blogs any more. Shouldn’t you be on Twitter or vaping?

Scraping Instagram #2

flickr photo shared by Marco Gomes under a Creative Commons ( BY ) license Remember last night when I posted about scraping data from Instagram? I woke up this morning about 5:30 (literally with a start) astounded by how easy the solution to archiving the pagination returns was. So before I even left for work I managed to get this working so much better than my previous attempt. I stripped out all of the previous GitHub stuff as I realized I didn’t really need it. It had provided a nice crutch and let me know I sort of knew what I was doing. The explanation of what’s going on is in the comments interspersed in the code below. There’s a much cleaner way to do this where I don’t duplicate so much code. I could just call the part that builds the csv1 twice. I may do that at some point but I think having it all in one place will help people new to this sort of thing see what’s going on more clearly. This is fun stuff. I need to do more of it and more consistently. In the past, I’d do some programming for a few days and then not do any for a number of months. That makes for slow progress and frustration. I’m going to […]

Scraping Instagram

flickr photo shared by ajmexico under a Creative Commons ( BY ) license I’m trying to step up my programming game a bit.1 APIs are also getting more and more accessible to jokers like myself.2 (In this case I also use php, cron, and some regex.) All of this should make Alan very proud. But I’m relatively terrible at doing things without a purpose. Luckily one wandered in on Tuesday. A faculty member who I’ve worked with a few times before came in and asked if there was any way to grab Instagram data for a project on social media and health that focused on vaping and ecigs. I’m not one to look a gift project in the mouth so I said I’d take a stab at it. Step one was to check out Instagram’s API3– in particular I wanted to see the tag endpoints. Those are URLs that give you access to JSON data. To get at these you need to register as an Instagram developer and register a client. This is a pretty straightforward process. After that I browsed around GitHub to see what might already exist. This got me to the Instagram PHP API. I always start by wandering GitHub much like I start my WordPress work by looking at plugins first. It took me a long […]