Tag Archives: javascript

Fixing the Links⤴

from @ wwwd – John's World Wide Wall Display

I love the record of thinking and linking that now stretches back 12 years, 5 months, 4 days on this blog.

I don’t like the breakages.

A lot of the links on this blog are to the blogs of the school I used to work in in Glasgow, Sandaig Primary. The site is now gone. A lot of it is in the internet archive. I had hoped that the Amber plugin would sort that, but since the domain is now up for sale, the links lead to the sale page.

I could go through the posts and fix all the links. I guess someone with more understanding than me could do it in the database. I’ve opted for a cruder solution. I’ve added a bit of JavaScript to the blog which changes all links to Sandaig to the archive.

jQuery(document).ready(function() {
// Stuff to do as soon as the DOM is ready;

jQuery( "a[href^='http://www.sandaigprimary.co.uk']" )
.each(function()
{
this.href = this.href.replace(/^http:\/\/www.sandaigprimary.co.uk/, "https://web.archive.org/web/http://www.sandaigprimary.co.uk/");
});

});

This has probably broken something else and certainly is adding to the pile of oddities that I’ve added to the blog. But hopefully It means that links on posts like this: Impermanence and Comments will work.

Frozen Words⤴

from @ John's World Wide Wall Display

I’ve had a long term interest in digital ‘fridge’ poetry, making my first efforts with Flash around 15 years ago. A year or so ago I was excited by Fridge Poetry – Google Sheets as Database by Tom Woodward. There were a couple of goodies in that post, getting the word list from a google sheet and a nifty way to allow folk to easily make their own. I made a sheet and a poem and slotted the idea away.

I’ve revisited Tom’s post (and others) a few times, gathering tools 1 and wondering.

On the holiday weekend, given poor weather and a head cold, I revisited the idea and made my own Fridge.

This riffs & extends the idea a wee bit:

  1. You can add a background image to the poem, either from a built in flickr search or a local one.
  2. There is a standard common word list and a topical one from the google sheet.
  3. The words in the lists can be used more than once.
  4. I used JavaScript as opposed to php (except for proxying images to allow you to export).
  5. You can export the poem as an image.

I’ve edited Tom’s template a little, the new one:

  • Automatically generated a link to use. Tom got you to copy paste in the sheets own url and parsed that.
  • Adds a field for the image search.

Make a List this link should get you to create a copy of the list spreadsheet. You can edit the words (on the 2nd worksheet) and change the image search,  more info: Fridge Poetry.

Learning

I’ve gained a wee bit more JavaScript and jQuery. The idea of using Google sheets to populate a webpage or to display info from a sheet in a template is interesting. html2canvas is another tool that has interesting potential for storytelling on the web.

Using /copy at the end of a google sheet to allow anyone to make a copy is useful too.

Finally the ability of google sheets to get the id of the current sheet is really handy in simplifying the creation of links. This relies on a very simple script:

function getSheetID() {
  var r = SpreadsheetApp.getActiveSpreadsheet().getId();
return r;

}

you can then get the id by typing =getSheetID() in a cell.

Next

There is more help on how to make and use a wordlist here: Fridge Poetry.

Hopefully someone will find this fun of useful, if you do and create new wordlists please let me know.

Raspberry River⤴

from @ John's World Wide Wall Display

Image cropped from public domain flickr image: Raspberry (Rubus idaeus) ...

I’ve been following the work of Dave Winer for a while now. His pioneering work with RSS, blogging and podcasting is central to my use of the web. I’ve even dipped my toes into and blogged about Fargo his outliner tool a few times, I tried myword.io a couple too.

The product I am most interested in was the Rivers project. This is a take on RSS readers, where you view collections of RSS in a stream, rather than a folder structure.

In the past I set up River3 and River4. These products really need a server that goes a bit further than web hosting. I had some working locally but this was not ideal. The instructions for using the previous version of River tended to involve Amazon Web Services and a server elsewhere.

River5

River5 changes all of this, it is designed to keep everything in the same place, one server. The only difficulty is that it requires a server running node.

This is pretty simple to set up locally on a mac. You need to use the terminal. You install node. Then you follow the instructions on the River5 github page and you are away.

What is very nice indeed is that you can add feeds you want to read in several different formats opml (handy for export from other RSS readers), json and plain text. There is a set of example feeds provided that will let you see everything is working.

I wanted to be able to have the rivers running all the time and be accessible from other computers. For that I need a server that I could install and run node on. Turns out I have one, john’s pi server. That sits on my window sill mostly taking pictures of the sky. It was running a twitter bot but that is broken at the moment.

Setting up River5 on a Raspberry Pi

I do most things on my pi via the terminal on a mac or iPad, suing ssh to logon.

I had installed node on the pi a while back.

Download the latest:
wget http://node-arm.herokuapp.com/node_latest_armhf.deb

then install:

sudo dpkg -i node_latest_armhf.deb

I seem to have done that a while back when I was failing to get something else up and running.

All I need to do to get River5 installed was to download the files from github and upload them to the pi with scp.
I then unzipped them went into the folder and ran these two commands:

npm install

node river5.js

This set everything up, a plie of stuff streams by in the terminal and all looked ok. (I had problems the first time I tried but an update came out immediately that fixed things for Linux servers. I got a very quick response on the River5 Forum).

My Pi already has a sub domain so I visited http://pi.johnj.info:1337 and could see the rivers flowing with Dave’s Feeds.

I’ve now removed the original ones and replace them with lists of feeds of my own.

Rivers Forever

After that I went to bed, next morning I tried the link and it was down. The problem is I need to keep the application up and running even when I am not logged onto the server. I recalled reading on Dave’s blog about Forever. As usual google found the instructions to install and use: Keep a node.js server up with Forever.

This is pretty simple you install Forever with:

sudo npm install forever

npm is a package manager for JavaScript so it installs stuff.

After it is installed we can start up the river5 with:
forever start river5.js and it keeps going.

Mine has been running for a few days now on the pi without any problems.I’ve been enjoying an alternative view of some of my RSS feeds. My next steps are probably to move things around a bit so that I don’t relay on the built in node server, and can pull the river json over to here.

I am pretty amazed by the ease of doing this. The software has been made to be very easy to install and the Raspberry Pi turns out to be a very capable wee box.

Never aggregate ephemeral sheep⤴

from @ John's World Wide Wall Display

Liked Fridge Poetry – Google Sheets as Database on Bionic Teaching
Back in 2013 I built a refrigerator poetry page using javascript. I really wanted to make it so anyone could add any words they wanted in some easy way but didn’t have the skills to do that at the time. It’s been hanging out in the back of my mind since then and the bits and pieces I’ve learned since then now make it pretty straightforward.
Liked Fridge Poetry – Google Sheets as Database on Bionic Teaching
Back in 2013 I built a refrigerator poetry page using javascript. I really wanted to make it so anyone could add any words they wanted in some easy way but didn’t have the skills to do that at the time. It’s been hanging out in the back of my mind since then and the bits and pieces I’ve learned since then now make it pretty straightforward.

It is National Poetry Day. When I was in class I always wanted to do something for this, but only occasionally remembered. Although I don’t have a way with words I like working with poetry in the class. I also occasionally like twitter haiku and the like.

I read Tom Woodward’s blog regularly and yesterday I noticed Fridge Poetry – Google Sheets as Database in my RSS reader. Given that I’ve messed about with fridges before 1, I took a look: Google Sheets – Fridge Poetry.

The really interesting thing 2 about this is that Tom has set it up so that it is easy to make another fridge with different sets of words. He even has a link on his post to create a copy of the google spreadsheet to make your own copy (you need a google account, a low entry bar). The sheet itself has the instructions.

Here is one with a selection of words from Scotland small? by Hugh MacDiarmid.

How do you save something like this? Take a screenshot.

What I really love about this idea, besides the sharing of how to do it, it the easy way it can be extended and used with a different set of words.

  1. That was back in 2002 when I was playing with Flash
  2. The other interesting this is the JavaScript and php stuff.

Coding Glow #1: Reminder to Follow⤴

from @ Charlie Love.org | Charlie Love.org

Office 365 out of the box is neither intuitive or built for learning, but with some set up and direction it could be a very effective environment for online, blended and flipped models of learning. This post is number one of a series of posts I’ll me making on how to …

Coding Glow #1: Reminder to Follow⤴

from @ Charlie Love.org

Office 365 out of the box is neither intuitive or built for learning, but with some set up and direction it could be a very effective environment for online, blended and flipped models of learning. This post is number one of a series of posts I’ll me making on how to …

Javascript – Grades to Numbers⤴

from @ ICT & Education

A while ago I wrote about how I was able to (finally) get my Adobe Acrobat form to calculate grades. (You can read it here). I’ve finally (with the help of @PenmanRoss) been able to do it the other way around – to type in a grade (e.g., A3) and get the form to calculate the corresponding number.

Here’s the script

var og = this.getField("GA").value; 

if( og =="A1") 
event.value = og = 22; 

else if( og =="A2") 
event.value = og = 21; 
else if( og =="A3") 
event.value = og = 20; 
else if( og =="A4") 
event.value = og = 19; 
else if( og =="A5") 
event.value = og = 18; 
else if( og =="B1") 
event.value = og = 17; 
else if( og =="B2") 
event.value = og = 16; 
else if( og =="B3") 
event.value = og = 15; 
else if( og =="C1") 
event.value = og = 14; 
else if( og =="C2") 
event.value = og = 13; 
else if( og =="C3") 
event.value = og = 12; 
else if( og =="D1") 
event.value = og = 11; 
else if( og =="D2") 
event.value = og = 10; 
else if( og =="D3") 
event.value = og = 9; 
else if( og =="E1") 
event.value = og = 8; 
else if( og =="E2") 
event.value = og = 7; 
else if( og =="E3") 
event.value = og = 6; 
else if( og =="F1") 
event.value = og = 5; 
else if( og =="F2") 
event.value = og = 4; 
else if( og =="F3") 
event.value = og = 3; 
else if( og =="G1") 
event.value = og = 2; 
else if( og =="G2") 
event.value = og = 1; 
else if( og =="H") 
event.value = og = 0; 

else event.value = "";