<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>terriko</title>
  <link>https://terriko.dreamwidth.org/</link>
  <description>terriko - Dreamwidth Studios</description>
  <lastBuildDate>Thu, 17 Oct 2013 23:33:27 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>terriko</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/164493/266577</url>
    <title>terriko</title>
    <link>https://terriko.dreamwidth.org/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>https://terriko.dreamwidth.org/138949.html</guid>
  <pubDate>Thu, 17 Oct 2013 23:33:27 GMT</pubDate>
  <title>Book review code</title>
  <link>https://terriko.dreamwidth.org/138949.html</link>
  <description>One of the things that bugs me when I&apos;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&apos;t love the output from Amazon&apos;s referal link generator, which would have been the easiest solution.  I&apos;ve been doing it manually, but that&apos;s a lot of cut and pasting and I kind of abhor doing tasks that are easy to automate.&lt;br /&gt;&lt;br /&gt;Thankfully, I&apos;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.  &lt;br /&gt;&lt;br /&gt;In the spirit of sharing, here&apos;s the script I&apos;m using to generate the code I wanted for my reviews using the book page on LibraryThing:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;color:#000000;background:#ffffff;&quot;&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// ==UserScript==&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @name        Book review header generator&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @namespace   tko-bookreview&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @description Takes any librarything book page and gives me a nice link to the book with cover and author details&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @include     &lt;/span&gt;&lt;span style=&quot;color:#3f3fbf; &quot;&gt;http://www.librarything.com/work/&lt;/span&gt;&lt;span style=&quot;color:#3f7f59; &quot;&gt;*&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @version     1&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// @grant       none&lt;/span&gt;
&lt;span style=&quot;color:#3f7f59; &quot;&gt;// ==/UserScript==&lt;/span&gt;

&lt;span style=&quot;color:#3f7f59; &quot;&gt;// Get all the data we&apos;d like to display at the top of a review&lt;/span&gt;
var coverimage = document.getElementById(&lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;mainCover&apos;&lt;/span&gt;).outerHTML;
var title = document.getElementsByTagName(&lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;h1&apos;&lt;/span&gt;)[0].innerHTML;
var author = document.getElementsByTagName(&lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;h2&apos;&lt;/span&gt;)[0].innerHTML;
var librarythinglink = document.URL; 


&lt;span style=&quot;color:#3f7f59; &quot;&gt;// Trim down the title and author info&lt;/span&gt;
title = title.&lt;span style=&quot;color:#7f0055; font-weight:bold; &quot;&gt;replace&lt;/span&gt;(/ *&amp;lt;span .*&amp;lt;\/span&amp;gt;/, &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&apos;&lt;/span&gt;);

author = author.&lt;span style=&quot;color:#7f0055; font-weight:bold; &quot;&gt;replace&lt;/span&gt;(/href=&lt;span style=&quot;color:#2a00ff; &quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color:#2a00ff; &quot;&gt;/, &apos;href=&lt;/span&gt;&lt;span style=&quot;color:#2a00ff; &quot;&gt;&quot;&lt;/span&gt;http:&lt;span style=&quot;color:#3f7f59; &quot;&gt;//&lt;/span&gt;&lt;span style=&quot;color:#3f3fbf; &quot;&gt;www.librarything.com&lt;/span&gt;&lt;span style=&quot;color:#3f7f59; &quot;&gt;&apos;);&lt;/span&gt;
author = author.&lt;span style=&quot;color:#7f0055; font-weight:bold; &quot;&gt;replace&lt;/span&gt;(/&amp;lt;hr&amp;gt;/, &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&apos;&lt;/span&gt;);

&lt;span style=&quot;color:#3f7f59; &quot;&gt;// Generate the code for this book&lt;/span&gt;
var reviewheader = &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;a href=&quot;&apos;&lt;/span&gt; + librarythinglink + &lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;&quot;&amp;gt;&apos;&lt;/span&gt; + 
   coverimage + &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;br /&amp;gt;&apos;&lt;/span&gt; +
   &lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;&amp;lt;b&amp;gt;&apos;&lt;/span&gt; + title + &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt; &apos;&lt;/span&gt; +
   &lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;&amp;lt;em&amp;gt;&apos;&lt;/span&gt; + author + &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;/em&amp;gt;&apos;&lt;/span&gt;;

&lt;span style=&quot;color:#3f7f59; &quot;&gt;// Add code around this for embedding it into the page&lt;/span&gt;
var textbox = &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;h4&amp;gt;Review Code&amp;lt;/h4&amp;gt;&apos;&lt;/span&gt; +
	&lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;textarea name=&quot;embedHTML&quot; onFocus=&quot;this.select();&quot; rows=&quot;5&quot; &apos;&lt;/span&gt; + 
	&lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;style=&quot;width: 250px;&quot; wrap=&quot;virtual&quot;&amp;gt;&apos;&lt;/span&gt; + reviewheader + &lt;span style=&quot;color:#ffffff; background:#660099; font-weight:bold; font-style:italic; &quot;&gt;&apos;&amp;lt;/textarea&amp;gt;&apos;&lt;/span&gt;;


&lt;span style=&quot;color:#3f7f59; &quot;&gt;// Find a good spot and add it to the page&lt;/span&gt;
var insert = document.getElementsByClassName(&lt;span style=&quot;color:#2a00ff; &quot;&gt;&apos;gap&apos;&lt;/span&gt;)[0];
insert.outerHTML =  textbox + insert.outerHTML;
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Please feel free to consider this open sourced and free for any type of use: alter it to suit your needs as you will!&lt;br /&gt;&lt;br /&gt;Edit: &lt;a href=&quot;https://github.com/terriko/webscripts&quot;&gt;Github link&lt;/a&gt;, for those so inclined.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=138949&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://terriko.dreamwidth.org/138949.html</comments>
  <category>homepage</category>
  <category>code</category>
  <category>book</category>
  <category>hack</category>
  <category>javascript</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://terriko.dreamwidth.org/13657.html</guid>
  <pubDate>Wed, 14 Oct 2009 04:17:21 GMT</pubDate>
  <title>Coding brain != reading brain?</title>
  <link>https://terriko.dreamwidth.org/13657.html</link>
  <description>The exhaustion/stress from fixing crud and trying to get my thesis done at the same time hit me hard today, so I came home at 4pm and immediately fell asleep. &lt;br /&gt;&lt;br /&gt;As these things usually go, this resulted in me awakening sometime later, still feeling like a zombie, but unable to go back to sleep.  I completely failed to read a magazine because I found myself skimming before I&apos;d read a couple of sentences.  So I figured I&apos;d go mess about with flickr... time flies, and I find I&apos;ve written a greasemonkey script making it easier for me to blog photos.  Which is fine, except how the heck does it work that I can&apos;t concentrate long enough to read two sentences, yet I can write JavaScript code just fine?&lt;br /&gt;&lt;br /&gt;I am concerned that in the dystopian future, some evil megacorp will take advantage of this and generate worker drones who are incapable of reading but perfectly good at writing code.&lt;br /&gt;&lt;br /&gt;No, wait, that&apos;s just the exhaustion talking.  In that spirit, though... Have some tentacles, and I&apos;m going back to bed:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;margin: 10px;&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/terrio/4004840733/&quot; title=&quot;Tentacles&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3525/4004840733_bc375a792a.jpg&quot; alt=&quot;Tentacles&quot; style=&quot;border: solid 2px #000000;&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;span style=&quot;font-size: 0.9em; margin-top: 0px;&quot;&gt;&lt;a href=&quot;http://www.flickr.com/photos/terrio/4004840733/&quot;&gt;Tentacles&lt;/a&gt;&lt;br /&gt;by &lt;a href=&quot;http://www.flickr.com/photos/terrio/&quot;&gt;Terriko&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;br clear=&quot;all&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=terriko&amp;ditemid=13657&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://terriko.dreamwidth.org/13657.html</comments>
  <category>javascript</category>
  <category>code</category>
  <category>photo</category>
  <category>geek</category>
  <lj:security>public</lj:security>
  <lj:reply-count>12</lj:reply-count>
</item>
</channel>
</rss>
