I’ve been beta testing micro.blog. There is a new page here for status type posts, these get sent to micro.blog/johnjohnston and to twitter.

This has renewed my interest in finding different ways to post to the blog especially for short posts that would have previously gone straight to twitter.

Continue reading

Pinboard

I’ve been using pinboard for collecting links for five years now. I like it a lot, it feeds the Links page here and most of the enviable stuff.

One of the main things I like about it is its simplicity. Pinboard lists the links, titles, and descriptions without any images or fancy stuff. Adding links via the bookmarklet is simple. It supports the delicious API and has RSS so you can pull sets of links onto blogs and webpages easily enough.

Last week I used the service to play around with python a little. To produce a more visual representation of my recent links. I appreciate the irony. This was an excuse to play with several technologies that I do not know much about.

Last month I had read: this post Homemade RSS aggregator followup by Dr Drang. This shows how to make an RSS reader with python.

I’ve very occasionally played with python for an hour or two but do not really understand the basics. I can however try things repeatedly until they worked.

Planing and playing

My plan was to use the code from Dr Drang, simplifying it to deal with just one RSS feed. Using my pinboard links to produce a webpage. I also wanted to make thumbnails of the websites linked and play with CSS and JavaScript a bit.

The idea was to create the webpage in my dropbox. This could be updated automatically by the script running on my mac. I’ve had dropbox long enough to have a Public folder that is very handy for publishing webpages. This is now a pro and business option only.

Here is the script: pinboardrecent.py and the current output: Recent Pinboard.

Problems

The interesting thing about all of this is the several problems I hit and their solution.

The problem included:

  • Not know how to do something
  • Errors in the code I wrote
  • Errors with webkit2png 1 which I was using to produce the thumbnails.

The answers all involved google and testing and re-testing until things worked. In some all cases I am sure my answers were not the best way of doing things but they worked. I’ve noted most of these in the source. The other think I see in my code is lots of print statements that are commented out. I deleted lots more. There are surely better ways to find out what is going on/going wrong with a script but this works for me.

I am never going to be a programmer, but I get a lot of fun and occasional utility out of playing around like this.

There is a huge push to teach coding to pupils in school going on at the moment. A major reason for this is getting the right skills for employment. I hope a small side benefit will be giving learners the chance to have fun. Producing things for themselves rather than just use services and applications produced for them.

Tinkering with code that you do not understand may not be the best way to get a deep understanding of a language. It may not even help with learning the fundamental concepts. It does in my experience hook you into engaging with learning.

This term at work I’ll be involved in providing training in starting primary pupils coding. I’ll be recommending tinkering as one possible way of getting started and engaing pupils. I am sure some will be as fascinated as me.

  1. webkit2png has problems when trying to get thumbnails of non https sites on El Capitan (Mac OS X 10.11) google allowed me to find a fix and edit the source of webkit2png (which turned out to be python for extra learning).
Also on:

Lame Encoding

Part of the setup for Radio EDUtalk consists of AutoDJ where various rotations of mp3s are automatically played on the Live shows and stream EDUtalk page. We have now got about 4GB of audio from the broadcasts and podcast. These files are uploaded to the Radio server. As we pay for storage I cycle through a few sets from time to time.
When we set this up initially it involved converting all of the mp3 files to 64kbps and mono. I posted a description of the workflow I used to do this here: Summer pt 1: Radio EDUtalk.

Since then I’ve been gathering all the audio added by simply subscribing to the Edutalk podcast in iTunes. Today I thought I’d sort out the most recent files (104 episodes had build up) and add them into the mix. The last time out I used id3tool to add tags to the audio. Unfortunately this uses a old version of id3 tags which means some of the titles are truncated. I decided to look for a new workflow.
I found ID3 Editor which has mac, windows and linux versions, costs £10 and comes with a commandline utility.

This means I can use LAME to make 64kbps mono versions of the files and then just copy the tags across from the original files. I think, in theory, I could extract the original tags with exiftool and pass them to LAME to write them to the new file, but that seems far to hard for me to work out.

So in the terminal I move into the Edutak directory and convert all files to 64 mono in new folder with:

mkdir save && for f in *.mp3; do lame -m m -b 64 --resample 44.1 "$f" ./save/"${f%.mp3}.mp3"; done

This takes a wee while, and then this copies the id3 tags:

for f in *.mp3; do /Volumes/ID3 Editor/Extras/id3edcmd -import "$f" ./save/"${f%.mp3}.mp3"; done

I have a folder full of files to upload to the server (which looks like taking a few hours).