Oct. 17th, 2013

terriko: (Default)
One of the things that bugs me when I'm doing book reviews is that I prefer it when reviews have a picture of the cover and link to the book of some sort, but I didn't love the output from Amazon's referal link generator, which would have been the easiest solution. I've been doing it manually, but that's a lot of cut and pasting and I kind of abhor doing tasks that are easy to automate.

Thankfully, I'm a coder and a user of greasemonkey, so I have all the skills I need to automate it. Seriously, being able to tweak web pages to suit my own needs is the greatest thing.

In the spirit of sharing, here's the script I'm using to generate the code I wanted for my reviews using the book page on LibraryThing:

// ==UserScript==
// @name        Book review header generator
// @namespace   tko-bookreview
// @description Takes any librarything book page and gives me a nice link to the book with cover and author details
// @include     http://www.librarything.com/work/*
// @version     1
// @grant       none
// ==/UserScript==

// Get all the data we'd like to display at the top of a review
var coverimage = document.getElementById('mainCover').outerHTML;
var title = document.getElementsByTagName('h1')[0].innerHTML;
var author = document.getElementsByTagName('h2')[0].innerHTML;
var librarythinglink = document.URL; 


// Trim down the title and author info
title = title.replace(/ *<span .*<\/span>/, '');

author = author.replace(/href="/, 'href="http://www.librarything.com');
author = author.replace(/<hr>/, '');

// Generate the code for this book
var reviewheader = '<a href="' + librarythinglink + '">' + 
   coverimage + '<br />' +
   '<b>' + title + '</b></a> ' +
   '<em>' + author + '</em>';

// Add code around this for embedding it into the page
var textbox = '<h4>Review Code</h4>' +
	'<textarea name="embedHTML" onFocus="this.select();" rows="5" ' + 
	'style="width: 250px;" wrap="virtual">' + reviewheader + '</textarea>';


// Find a good spot and add it to the page
var insert = document.getElementsByClassName('gap')[0];
insert.outerHTML =  textbox + insert.outerHTML;


Please feel free to consider this open sourced and free for any type of use: alter it to suit your needs as you will!

Edit: Github link, for those so inclined.
terriko: (Default)
And now that I've got the new book review code, here's two book reviews! These are more young adult fiction, because I find it easier to have some shorter fiction when I'm traveling so much. At least this way I'm pretty sure I'll finish before the library reclaims my ebooks!

Rampant by Diana Peterfreund
Rampant
by Diana Peterfreund

This is a story about poisonous killer unicorns, and the virgin unicorn hunters who protect the human race from these monsters. If that's not enough hook to get you curious, I'm not sure you and I have even remotely the same taste so you're probably wasting your time reading a review from me.

This unusual concept brings you into a fairly typical young adult reluctant-hero narrative, something along the lines of Buffy the Vampire Slayer, only it's Astrid the Unicorn Hunter, whose mother is thrilled when a supposedly extinct unicorn shows up and gores Astrid's boyfriend, because she just knew her little girl had a destiny.

I enjoyed it, but I'm going to warn you right now that the series should be rated the same as Buffy: there's plenty of monster hunting violence as one would expect, but also much more intimate violence. No graphic glorifying descriptions and I don't think the treatment is awful, but I'm kind of sick of rape in half the fantasy I read, so consider yourself warned.

Overall, I didn't love this the way I loved "For the Darkness Shows the Stars" which is the novel that introduced me to author Diana Peterfreund, but "Rampant" was probably good enough for me to give the others in the series a try.


The Rise of Renegade X by Chelsea M.…
The Rise of Renegade X
by Chelsea M. Campbell

Damien is planning his life as a supervillain when his life is turned upside down by discovering that maybe he's not nearly as villainous as he thought...

Like a few other superhero/villain YA stories I've read, this focuses more on the characters and less on the powers. It's got snarky dialog, hijinks, sidekicks, gadgets, and some kind of dubious romance. Looking fowards to the next book!
terriko: (Default)
I'm pleased to announce that I will be joining Intel's Open Source Technology Center (OTC), starting October 21st.

This is a big transition for me: not only have I physically moved to the Portland area from Albuquerque, but I'm also moving from academia to industry. However, I'm not moving away from either security or research: my official job title is "Security Researcher - Software Security Engineer."

There are lots of crazy smart people at Intel, especially at OTC, and I'm really excited (and a little scared!) about joining their ranks. This is exactly the job I wanted: I'll be doing security in an open source context (not only behind closed doors!), working with interesting people on interesting projects, and I'll be positioned such that my work can have an impact on the state of computer security in a global sense. It sounds like I'll be working primarily on web and Android security, which is challenging, fascinating, intimidating, and highly important. Wish me luck!

Profile

terriko: (Default)
terriko

February 2017

S M T W T F S
   1234
567891011
12131415161718
192021 22232425
26 2728    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 23rd, 2017 04:24 am
Powered by Dreamwidth Studios