RailsGirls and the Trove API

Over the weekend I was fortunate enough to attend #RailsGirlsPerth. This was an opportunity for girls to learn about Ruby on Rails, a web programming framework. It was a free event organised by the wonderful Darcy and Marcus, held at Spacecubed.

It kicked off on Friday night with an installfest. I had already installed Rails on Craig’s laptop (which I borrowed for the event) but I went along to meet people and take in the vibe. There were a few people I knew there, but many more that I hadn’t met yet. It was great to see so many women keen to learn how to program in Ruby and so many guys there to help get them started. Railsgirls events were also happening in Brisbane and Sydney. We caught up with them on Skype and I spied a @web_goddess at the Sydney event.

Me and Jo (@history_punk) coding all the things (via @history_punk)

The coding started in earnest on Saturday. Before I knew it, I was up over my head in the niceties of Ruby with the very capable help of Myles and the assistance of some excellent coffee that Darcy had organised. I had decided that I wanted to use the Trove API after being inspired by the wonderful things created by @wragge.

I’ve been hearing about APIs for a few years now but had never used one and I wanted to change that. I also wanted to do something with Twitter. I came up with the idea of extracting vintage knitting patterns from Trove using the API and visualising them in such a way that they can be tweeted.

Initially I was really confused. It had been 12 years since I’d done any really serious programming (in my undergraduate degree) or even used the Windows terminal. I was grouped with three girls who had experience programming in .NET which was a bit intimidating. By lunchtime I was feeling like a rather dim bulb and doubting that I’d have any finished code to show by the end of the day.

Things started coming together as I began to map Rails terms to concepts I’d learned when programming previously (e.g. gems == libraries). It also helped that the Rails framework does a lot of stuff for you (a bit confusing at first if you’re not used to it) and the Ruby syntax is very clean and easy to read. This made it possible to get working stuff together in a day.

I was also grappling with the Trove API and trying to make it output what I wanted. Getting an API key for Trove was super simple and took a few minutes. Coming to terms with the syntax of the API was harder. What I really wanted was an output of the contents of this list. After quite a bit of fiddling, I ended up compromising with a list of the newspaper articles tagged with ‘knitting’. Then it was a matter of harmonising my variables with the metadata I wanted to capture in my database and adding the ability to tweet items. As Myles promised and I had trouble believing, the Twitter part was very easy (about 2 lines of code). It produced tweets like this:

So now I had a working chunk of code that could grab specific content from Trove, display the metadata I was interested in and give the ability to tweet it. However it was only running locally on my laptop. The next challenge was porting it to Heroku, a cloud based service for hosting web apps, so that other people could see it and interact with it. Fortunately, the documentation for setting up Rails on Heroku was top notch and I was mostly able to follow it without hitch. It involved using my first Postgres database which was cool as Postgres helps pay my mortgage (via Craig who is a Postgres developer/consultant).

After some work and a bit of fiddling, I had a working Rails web app hosted on Heroku, pulling in information from Trove and allowing people to tweet items from it. You can see it here. Not bad when I’d just started learning Ruby on Rails that day! Much kudos must go to Myles who talked me through quite a lot of it (and had great patience with me). I don’t fully understand the code I wrote, but I can revisit it and hopefully get my head around it better. I’d like to clean it up a bit, make it more visual and iterate through the Trove output so I can capture and display all 700+ records (rather than just the first page). Still, it’s a great start and far more than I thought I’d be able to get done in one (admittedly 10 hour) day.

I really can’t thank the organisers and sponsors of RailsGirlsPerth enough. It was an amazing and inspirational event. I met a number of really interesting people who I’m hoping to stay in touch with and learned an enormous amount. It’s given me a whole lot more confidence about playing with APIs and coding in general and it provided a very welcome distraction in what was a really hard week.

If you’re interested in trying something like this, keep an eye on the RailsGirls website and Twitter feed to find out when more events are happening (they are worldwide). You can also get a taste of Ruby at the TryRuby website. I’d highly recommend giving Ruby on Rails a try if you’re interested in playing with APIs or increasing your tech knowledge in general.

The Rails Girls Perth crew and participants (via @GentlemanTech)

Advertisements

Relay Wrapup

Well it’s been an insanely busy week between preparing for the trip and finishing things off at work. I wanted to put up a quick post about the relay on the weekend however. I really REALLY appreciate the support I received and want to sincerely thank everyone who sponsored me and/or sent supportive messages.

The relay went really well. The promised rain mostly stayed away and the weather was warm enough during the day to be pleasant to walk in but cool enough to not be unpleasant. It got cooler in the evening and the onesies started coming out. I almost wished I’d brought mine along.

There was a great turn out for my team, Knitters for a Cure. We had a fabulous tent site on the far corner of the oak lawn from the main stage. This was good as the music blasting out from there was loud. Walking past it was quite unpleasant at times, but it was muted at that distance. For the third year running, we won best decorated tent site. This was largely due to the efforts of Nanna Ruth who always puts in a great effort.

Knitmashup

As you can see, our theme this year was ‘We knit so we don’t kill people’. There were a few times I wanted to use my needles to deadly effect when people who were running the course dodged past without giving warning. One even ran into me. On the whole though, the walking was great. I got to walk with a number of my teammates including the wonderful Julie who I’d wanted to chat to last year and didn’t have a chance.

The relay started at midday on Saturday and went for 24 hours. Craig and I couldn’t stay for the full time because we had a lot of packing and trip prep to do, but we were there until 9pm Saturday. In that time I smashed my previous fitbit stepcount bests, getting my 20,000, 25,000 and 30,000 step badges all in the one afternoon. 😀 I walked over 20km (in bursts of 40 mins or so) knitting the whole time. We ordered pizza for dinner and it disappeared in a hurry after all of that walking!

The best news of all  is that Knitters for a Cure raised over $7,000 for cancer research. We were the second highest fund raising team at the UWA event and exceeded our team goal. Thanks to you guys, I raised nearly $400. 😀

I look forward to doing it again next year. The epic blood blister on my right foot should have healed by then. 😉

Knitting for Lily

I have a niece, her name is Lily* and she’s one year old.  I knit her things.

She’s kinda lucky since I don’t knit things for many people, I’m a fairly selfish knitter for reasons that I’ll write about another time. But she’s gorgeous and I like to make cardigans for her. The first one was a teeny tiny BSJ which she wore on her way home from the hospital:

The second was a lovely and very bright Scrappy Socky Stripey Cardi that I made out of various colours of Wollmeise:

I’ve just finished the latest and I’m really quite proud of it. I started it in some colourful handspun that I bought at this year’s knitting retreat. Unfortunately it was very dense and was knitting up more like body armour than a child’s cardigan so I started again in a random ball of Bendigo Alpaca Rich that I had kicking around. I’m really glad that I did, the yarn and pattern go very well together. The pattern incidentally is Granny’s favourite. I’ve named mine ‘Little Red‘:

Image

The yarn is less pink and more red than these photos would indicate (taken in a hurry with my iPhone) and has knitted up beautifully.  I like it so much that I’ve ordered more in cobalt to knit myself Iona.

Aren’t the buttons adorable? A friend from work took me to a great little shop in the city where I found them. I’ll be sending this labour of love off to my sister on Monday and I’m already looking forward to some photos of Lily in it. I hope it fits for a while.

* Photos of Lily have been used with her parents permission.

And the winner is…

Thanks to everyone who helped give their opinion on my last blog post.  I tallied up the results from the blog, Twitter, Facebook and offered in person and the winner (by a decent margin) is Walk on the Moon, the first option.

So on Friday night I cast it on and I’m making good progress. I’ve finished the first chart and am up to row 54 currently. It’s an interesting pattern.

I haven’t forgotten about the other options however. I’m planning to re-chart the Sierpinski gasket shawl and choose some yarn to use to take on holiday with me. I’m also contemplating colours for the Colour Affliction.

In the meantime, I’ve also discovered this amazing Escher fish blanket that I also want to knit (from Wollmeise):

@ Jana Huck

Isn’t it incredible! It’s available on Ravelry as Tiling Fish.

Knitting, it’s not just for Julia…

So the current media circus swirling around Julia Gillard is to do with an article for the Women’s Weekly showing her knitting. Now it’s not exactly a secret that she knits, this has been known for some time. Yet suddenly she’s being attacked all over the place for it. Mainly old white men are calling her ridiculous for showing off a hobby popularised by 50’s housewives. Like this trite example:

She is giving encouragement to young female politicians by plying a hobby now synonymous with mad old aunts – Andrew Bolt

Like he’s such an expert!?

So, is knitting such an olde worlde hobby that it will lead Julia further from the voters?

The more than three million users of Ravelry, a knitting website, are sure to disagree.

Also, I personally disagree. I like the idea of Julia knitting in her spare time. It’s something I totally relate to. I’m a rather busy person and it’s great to have a hobby that you can do while you do other things. I can knit while I read, watch tv or have a conversation with friends. I also get to know people through knitting, I can totally imagine having a chat with Julia about her favourite type of yarn and trying to persuade her to use circular needles.

Tony Abbott grinning inanely from his bike however leaves me cold.

So why is knitting so excellent? My friend @bekswhoknits has already written a great post about this topic and I thought I’d add my 2 cents.

Knitting allows you to make pretty things. Since I started knitting in late 2007, I have made the following items (and many many more):

Celestarium

I love it for the beautiful colours. A good skein of yarn is a wonderful thing, it feels delightful in your hands and has colours to die for. Having a house full of yarn means having a house full of warmth and colour. Better yet, you can make it yourself. Chris Pyne may make cracks about spinning a yarn (yeah, never heard that one before), but it’s an amazing thing to be able to do. How many people do you know who can take a sheep and use it to clothe their family?

One thing you may notice about most of the knitted things above is that I like to knit lace. It’s a bit weird since I don’t often wear lace, but following a lace knitting pattern seems to itch my brain in a really satisfying way. I do make practical things like jumpers, hats and fingerless gloves but I always come back to lace.

I also like having a productive hobby. I’m not good at doing nothing or even doing one thing at a time and even when I’m relaxing I am driven to create. Knitting means that I can relax and have something to show for it. If I’m really tired, I just pick up an easier project. Knitting is portable as well, I can do it on the train and on planes. I would knit in meetings at work if I could get away with it.

But how many others share this hobby? Well you might be surprised. In my city I know of about six knitting groups that happen at least once a fortnight. I also do some social knitting at work during Wednesday lunchtimes. Some people at my work who knit don’t come along to this, but do show me their projects or ask for opinions about patterns.

There are a lot of us and we’re a diverse range of ages. A knitting retreat that I helped organise recently had people aged from their mid 20s to nearly 80. The mean age would have been mid to late 30s.

My point is that knitting is awesome, funky and it’s not going away in a hurry. The usual mansplainers should check their facts before they run off at the mouth. I don’t love everything Julia does, but I thoroughly approve of the knitting.