Weekly Web Harvest for 2019-07-14

  • teenage engineering – PO-32 tonic
    never before has a drum machine that sounds this good
    with literally endless sound capabilities been set at a price this low.
    meet PO-32 tonic, the new gold standard drum machine.
    and yes, it comes in a gold plated cardboard box.

  • Haruspex – Wikipedia
    In the religion of Ancient Rome, a haruspex (plural haruspices; also called aruspex) was a person trained to practice a form of divination called haruspicy (haruspicina), the inspection of the entrails (exta—hence also extispicy (extispicium)) of sacrificed animals, especially the livers of sacrificed sheep and poultry. The reading of omens specifically from the liver is also known by the Greek term hepatoscopy (also hepatomancy).
  • “Effectiveness of Animation in Trend Visualization,” ten years later
    Our results found that animation is a paradox.
    It certainly wasn’t very effective for solving our tasks. Whether they had interactivity or not, users in the animation condition were less accurate than small multiples. Users took a very long time to answer questions when given an interactive animation, scrolling back and forth. When we took that control away, they’d quickly make their best guess. Despite that, interactive animation wasn’t much more accurate then non-interactive!
    But we also found that users really liked the animation view: Study participants described it as “fun”, “exciting”, and even “emotionally touching.” At the same time, though, some participants found it confusing: “the dots flew everywhere.”

  • An (anti) audioblogging manifesto
    Consider also this – the average person speaks at one hundred, perhaps
    one hundred fifty words per minute. Meanwhile, an accomplished reader
    can read ten times faster – up to a thousand words a minute, and that’s
    straight-up reading, not even skimming. You’re forcing people to listen
    to you at a speed that’s barely faster than the speed at which they can
    type. Why are you wasting their time? Is your voice really that
    beautiful?

  • FaceApp: Is The Russian Face-Aging App A Danger To Your Privacy?
    Feels like the intro paragraph is too pat but the full article shows the complexity of all this stuff and if facial recognition gets you into devices then thinking more about where your face is online will likely matter more and more.

    The weird decision in the article to focus on where a server is physically also makes no sense to me.

    What a mess.

  • [Folio] The Last Frontier, by Ted Conover | Harper’s Magazine
    In good weather, the large area between the mountain ranges has many appeals: incredible views, eagles and other wildlife, and land you can buy for a song. Five-acre lots on the prairie are typically priced at $3,000 to $5,000. (Land costs a lot more around the mountainous edges or in towns, where more people live.) But only the hardy can make it here year-round. The cheap land is almost all treeless and miles from anywhere, and the valley is famously windy.

    The McDonalds, the father still in jail awaiting trial for child abuse, were thinking hard about leaving the area before school started in the fall—possibly for Alabama, where they had come from years before. Another neighbor told me her cousin was visiting to withdraw from her addictions to meth and heroin. Paul was planting a garden and thinking of getting his last teeth pulled. Rick, also in the area, had sent out a group message on Facebook warning of the mountain lion he had seen on his property. Rhonda and Ke’Attrice, before long, would report that Rhonda’s house had been robbed while she was away; disillusioned, they said they might put it up for sale and move to Alaska.

Sliders as Inputs

Origin Story

There once was a worksheet that was meant to be used in a face-to-face scenario. The goal was indicate where you fell on a spectrum across a number cultural orientation of measures. The challenge was to transform that into something digital that could then be part of a larger conversations.

Watch the video above to get an idea of what the experience is like or this will make even less sense.

The Sliders

I like sliders as interface elements for things like these.1 You can see the HTML below that builds them or check out the Codepen for more CSS etc. That’s all pretty straight forward.

<div class="slider-container">
<div class="slide-label left">Direct Communication</div>
<div class="slide-label right">Indirect Communication</div>
<input id="directness" class="slider" max="100" min="0" type="range" value="50" />
</div>

I did have to add the input tag to the KSES allowed list to keep WordPress from stripping it out. To do that I added the following to our KSES modifier file.

$allowedposttags["input"] = array(
 "type" => array(),
 "range" => array(),
 "min" => array(),
 "max" => array(),
 "value" => array(),
 "id" => array(),
 "class" => array(),
);

Getting the Values

Now I needed some javascript to look at these sliders and record the values as the sliders were . . . slid in various directions. This little bit gets our values once we loop through the sliders that exist. Simple.

function sliderAmount(slider){
	 sliderValue = slider.value;
	return sliderValue;
}

Gravity Forms Integration

I did this via Gravity Forms because it’s fast and I’m overly comfortable with it. This is where things get a bit weird. We’re using a typical Gravity Forms to post scenario. Nothing odd there but I ended up building a shortcode to let me build the post content which is not as typical.

The javascript below is looking for our form and then writing various variables to the fields (which are hidden by CSS). The shortcode ends up looking like [dih-graph scores=”50,50,50,50,50″] with the 50s being replaced by whatever scores are recorded.

if (document.getElementById('gform_wrapper_6'))//change for prod
{
	let values = [50,50,50,50,50];
	let sliders = Array.from(document.getElementsByClassName('slider'));
	let field = document.getElementById('input_6_4');
	let title = document.getElementById('input_6_1');	
	sliders.forEach(function(slider, index) {
		slider.oninput = function (){				
				values[index] = sliderAmount(slider);
				field.value = '[dih-graph scores="'+values.join(',')+'"]';
				title.value = values.join('/');
		}

	})
}

The Shortcode

The shortcode is pretty ugly but it works. It loops through the data provided and generates the necessary HTML.

function dih_grapher_sc( $atts ) {
	$a = shortcode_atts( array(
		'scores' => '1,2,3,4,5',
	), $atts );
    $graphs = '';
    $lefts = ['Direct Communication','Monochronic','Low Power Distance','Individualism','Task Focus'];
    $rights = ['Indirect Communication','Polychronic','High Power Distance','Collectivism','Relationship Focus'];
    $scores = explode(",", $a['scores']);
    foreach ($scores as $key => $score) {
	   $graphs .= graph_builder($score, $lefts[$key], $rights[$key]);
	}
	
	return $graphs;
}
add_shortcode( 'dih-graph', 'dih_grapher_sc' );

function graph_builder($score, $left, $right){
	return '<div class="slider-container">
<div class="slide-label left">'.$left.'</div>
<div class="slide-label right">'.$right.'</div>
<p><input type="range" min="0" max="100" value="'.$score.'" class="slider" id="directness">
</p></div>';

}

Now because Gravity Forms kept insisting on running filters I didn’t want on the content, I just stuck the data in a custom post field and then appended it to the post via a filter. That seems weird now that I write it but whatever.

function filterPostForTBL($content){
    global $post;	
	if (get_post_meta( $post->ID, 'tbl_score', true )){
	  return $content . get_post_meta( $post->ID, 'tbl_score', true ) . get_post_meta($post->ID, 'discussion-prompt', true);
	} else {
		return $content;
	}
}

add_filter( 'the_content', 'filterPostForTBL');

Scroll to Entries

With our entries showing up on the same page as the form, I wanted to make sure that the person was redirected back to where they’d see other people’s entries. I did this by adding an id to the confirmation message and adding a bit of javascript to scroll to that ID.


function scrollToThanks(){
	console.log('scroll ran')
	if(document.getElementById("thanks")){
		console.log('scroll found thanks')
	  let thanks = document.getElementById("thanks");
	  let topThanks = thanks.offsetTop;
	  window.scrollTo({
		  top: topThanks,
		  left: 0,
		  behavior: 'smooth'
		});
	}
}

var callback = function(){
  // Handler when the DOM is fully loaded
  scrollToThanks();
};

if (
    document.readyState === "complete" ||
    (document.readyState !== "loading" && !document.documentElement.doScroll)
) {
  callback();
} else {
  document.addEventListener("DOMContentLoaded", callback);
}

Filter WordPress Title but Only in Admin Area

I am playing around with unfurling1 open graph data in the WordPress TinyMCE editor. You can see what that looks like in the video above. It’s a lot like the oEmbed experience in WordPress but with the open graph information driving it.

I want the data to go into the post body but I don’t want a title that links to a post because these types of posts are more about getting people out to that original content. People could still manually enter a title and that’d work but if they choose not to I thought it’d be nice if it was just removed from the equation.

That’s pretty nice on the front end but on the backend you end up with a maze of posts with the title (no title). That seemed irritating so I cobbled together the following function which creates a mini excerpt from the post content but only applies the filter when you’re in the backend/dashboard. Nothing fancy but a nice little pattern that I expect I’ll use again.

add_filter('the_title', 'new_short_admin_title', 10, 2);
function new_short_admin_title($title, $id) {
	if ( is_admin() ) {
	    if ($title === null || $title == '' || $title == '(no title)'){
	    	$title = super_short_excerpt();
		}
	}
    return $title;
}

function super_short_excerpt() {
    return wp_trim_words(get_the_excerpt(), 5);
}

via GIPHY


1 I like how furl and url have similar sounds but it is a ridiculous term.

Weekly Web Harvest for 2019-07-07

  • At VidCon, Influencers, Fans, And Brands Seemed Ready To Leave YouTube Behind
    At one point, the party converged around an Instagram-famous Pomeranian wearing a leather jacket and sunglasses. The dog’s owner was trying to yell out the dog’s Instagram handle over the sound of guests singing Kelly Clarkson’s “Since U Been Gone” on a karaoke machine on the other side of the room.
  • TheyDrawIt!: An Authoring Tool for Belief-Driven Visualization
    This is really solid.

    Need to look at the privacy stuff but an awesome thing to exist.

  • EarthRoamer – The Global Leader in Luxury Expedition Vehicles
    Since 1998, EarthRoamer has been redefining luxury camping and overland travel with our solar/diesel hybrid, four-wheel drive Xpedition Vehicles (XVs).
  • Old Weather
    Help scientists transcribe Arctic and worldwide weather observations recorded in ship’s logs since the mid-19th century.
  • You Can Apply to Hunt Pythons With Shotguns in Florida
    There are currently 40 paid snake hunters who hunt pythons in the Everglades. Remarkably, they earn anywhere from $8.25-$15 an hour, plus an additional $50 for each python. They also get $25 for every foot of length beyond four feet, as well as a $200 bonus for each nest. This new shotgun initiative will bump the number of hunters to 120.
  • The Navy’s USS Gabrielle Giffords and the Future of Work – The Atlantic
    Unbeknownst to the participants, the scoring rules changed partway through the game. When this happened, he noticed that players who scored high on conscientiousness did worse. Instead of adapting to the new rules, they kept doing what they were doing, only more intently, and this impeded their performance. They were the victims of their own dogged persistence.

    –not sure how much of this whole thing makes sense but interesting to see how people think about it

Weekly Web Harvest for 2019-06-30

Yet Another Wood Pen Gift Story

Can one every have enough hand made wood pens made by friends from wood you have given them? I bet most to all of you never pondered this question.

Cori and I are currently sitting on the deck of the house in Strawberry, our first visit back since a year ago April when I left to live/love in Saskatchewan.

We have enjoyed doing next to nothing but relaxing. When we arrived Wednesday night, on the front deck was a small wooden box with the pen you see in the image for this post. The return address told me where the box came from. I knew it because Howard Rheingold had emailed a few weeks ago that he had finished this pen from a chunk of spalted Arizona Oak I brought him when I visited in December, 2018.

He had explained the reason it took long (sorry for the extra critters that came with the log, Howard). But what a gift to have this in my hand. It’s not even the first one he sent, I still use one he sent me in 2014– if I recall, it was some of my previous pen stories that inspired him to start making them himself (I hope I remember that correctly, Howard!).

This wood mailing thing goes back to 2010, when I had posted to flickr a photo of some wood I had cut up form an oak tree that I had taken down here in Strawberry.

The story plays out in the comments… but an educator I had known mostly through flickr comments as “Windsor Di” was horrified I would burn the wood when she thought they would be great for doing wood projects. So the natural thing was to get in touch… and I mailed a log to Windsor, Ontario. Yes it’s possible to mail a piece of wood. Or it was then.

Anyhow, months later I got in the mail a collection of the wood pens she turned.

Pens

Pens flickr photo by cogdogblog shared under a Creative Commons (BY) license

There was more to it, as in 2011 when I made my round the US and Across Canada road trip, I made a stop to visit Windsor, and in the back of my truck was a box full of this wood for her (again, I am not sure how it passed the thorough inspection the border agents did in Victoria).

The story played out again in 2013- some messages back and forth with Andy McKiel who had posted photos of Arbutus trees he saw in Vancouver island and had reminded me of the Arizona manzanita. On learning Andy worked too with wood (you should check him out on instagram for his images of the wood bowls he turns)… it happened again. I mailed a chunk of manzanita to Andy in Winnipeg, and eventually got back pens and an ipad stylus.

My brother-in-law Skip picked up the habit too, and so I end up with a collection of Pens From Friends (and stories).

And I guess it keeps going with this newest one from Howard.

I guess I ought to be writing something pen-worthy. It’s on the “list”. But thanks again Howard, what a treat.


Featured Image:

YouTube Full Screen – Javascript & CSS

I’m sticking this js/css combo in a number of the WordPress themes we’re building.

It’s two pieces, a javascript piece that finds the YouTube videos and wraps them in a div and a CSS Piece that makes the videos full size for the enclosing div. It stops overflows from getting ugly and expands small embeds (via oembed or embed code).

I think it’s handy and I keep having to go to codepen to find it. So now it’s here.

See the Pen
full size youtube/vimeo
by Tom (@twwoodward)
on CodePen.

Weekly Web Harvest for 2019-06-23