All | 43 Folders | Accessibility | BoingBoing | Books | Computer Related | Family | Films | General | Hacking | Hobbies | Humor | Java | Links | Omni | OpenSolaris | Puzzles and Games

« Previous page | Main | Next page »
20071119 Monday November 19, 2007

Coloring Your Own Roller Blog Comments

Somebody was asking today on our internal blog users alias, on how they could color their own comments to make them stick out more. Seems that this is a built-in feature for WordPress. Here's an example (see comment #11).

GreaseMonkey to the rescue. If you are running Firefox and have GreaseMonkey installed, then install this script.

Unfortunately this isn't one of those script's that'll "just work". Each blog owner is going to have to customize it for their blog. There are two lines to change:

Now (hopefully), when you display one of your blog entries and there are comments by you, then you should see them with a light blue background and black text. If somebody can come up with some better CSS (which shouldn't be too hard), then they need to just adjust these lines:

        div.style.backgroundColor = "CEEBEB";
        div.style.color = "black";

But this was a thirty minute hack so that's what you get for a first version.

Hopefully a future version of the roller software will have a feature that just does this automatically.

[]

[]

[]

[]

( Nov 19 2007, 09:02:41 PM PST ) [Listen] Permalink Comments [5]

20071107 Wednesday November 07, 2007

Working GreaseMonkey Script For Expanding All Hackszine Categories

With great help again from Tyler Trafford (thanks!), there is now a GreaseMonkey script that will automatically expand all the categories on the Hackszine website, even those that have several pages worth.

This is useful to see all the posts they've created in the past, if you aren't exactly sure what you are looking for.

If you are running Firefox and have GreaseMonkey installed, then just install this script

Now if you go to the Hackszine website, it'll automatically reconfigure the page for you. Note that this is doing the equivalent of loading over 120 more web pages, so be patient with it.

If you just want the normal behavior when you visit the Hackszine site, then just disable the script (right click on the monkey icon on the right hand side of the Firefox status bar).

[]

[]

[]

[]

[]

( Nov 07 2007, 03:58:06 PM PST ) [Listen] Permalink

20071016 Tuesday October 16, 2007

GreaseMonkey Script To Improve Blogs.sun.com Recent Posts Display

Like several other people, I find that the current design of the blogs.sun.com home page frustrating, when it comes to trying to read the summaries of recent posted entries.

It initially only shows you ten entries, but you can click on a "See All" link, then you get the most recent 25 entries. If you want to see (say) the most recent 500 entries, you have to page through 19 more pages.

GreaseMonkey to the rescue. If you are running Firefox and have GreaseMonkey installed, then install this script

Now when you click on "See All", you will see the most recent 500 entries. Note that it'll take a few moments to construct the new page. It's interactively adding in the other 19 pages.

I'm sure this can be improved, but it was a quick-n-dirty hack.

Hopefully the blogs.sun.com people will come up with a proper fix.

[]

[]

[]

[]

( Oct 16 2007, 09:44:43 AM PDT ) [Listen] Permalink

20071007 Sunday October 07, 2007

Improved Lists Of Bests Book List To HTML Script

See yesterday's post for the background on this.

There is now an improved version of the script. See the Change Log at the end of the script for the changes made.

I've used it to regenerated the Pulitzer list. I then set it loose on the 1001 Books You Must Read Before You Die list. I've no idea who put this together, but it really needs work. Entries were incomplete or incorrect. Most promoted a specific version of the book. It's Persuasion by Jana Austen not Persuasion (Penguin Modern Classics). And so on...

After I did extensive editing of the list, and multiple runnings of the script to adjust the entries to make it quicker to select the correct title, I ended up with this text version, which created this HTML version. Even now, it's not always picking the best Amazon entry. Sometimes it selects one that doesn't have a book cover image.

It can process this list in about 32 minutes. Most of that time is spent doing the Amazon lookups to get the ISBNs. Even now there are still seven books on the list that I can't find:

  1. Adjunct: An Undigest - Peter Manson
  2. The Taebek Mountains - Jo Jung-Rae
  3. Disobedience - Alberto Moravia
  4. A Day Off - Storm Jameson
  5. The Last Days of Humanity
  6. The Stechlin - Theodore Fontane
  7. On the eve - Ivan S. Turgenev

I'll need to borrow Boxall's book from the library again to see if I can work out what they really should be.

[]

[]

[]

[]

( Oct 07 2007, 02:40:39 PM PDT ) [Listen] Permalink Comments [7]

20071006 Saturday October 06, 2007

Convert Your Lists Of Bests Book Lists To HTML Web Pages With Amazon Links

I've created a Python script that will take one of the Lists of Bests book lists generated by my GreaseMonkey script (see a previous post for more details on this), and convert it to an HTML web page with Amazon links for each book.

To use it you will need to have installed the Lists of Bests GreaseMonkey script. Then go to the Lists Of Bests book list you are interested in. The GreaseMonkey script will automatically convert it to a simple text-like list. You should then cut and paste it into a text file and save it.

You will also need to edit the make_HTML_list.py script and adjust the amazonAccessKey line to your Amazon Access License Key.

To use it simple run:

  % python make_HTML_list.py < <your-book-list.txt> > <your-book-list.html>

The script uses the Amazon web services to try to work out the book's ISBN from the title and the author. It tries to do as much as it can to make sure this works, but the simple fact is that some of the entries in these lists are incorrect or incomplete. If it can't find the ISBN, it uses the standard Amazon "no image available" image and doesn't generate a link.

Here's an example. Taking the Pulitzer prize list in text form, it generates this HTML web page.

There is a debug flag near the beginning of the script, that if set to True, will generate copious debug messages that should help you determine what the book title in the list should have been.

I have a problem with this script that I haven't been able to solve yet. Pointers on how to fix it would be most appreciated.

Tips on how to improve the script and/or the Python code are most welcome too.

[]

[]

[]

[]

( Oct 06 2007, 12:07:59 PM PDT ) [Listen] Permalink Comments [4]

20070614 Thursday June 14, 2007

An Alternate Del.icio.us Export / Backup Webpage

del.ic.ious allows you to export / backup your bookmarks to an HTML file. That file is just one long list of links.

What I wanted was a web page with my tagcloud at the top, and each tag in the tagcloud taking me to a section of the same web page which contained all my bookmarks with that tag. I realize that del.icio.us sort of gives you this with the tag cloud on the righthand side of their web site, but having a local copy would be much faster.

So I wrote a small Python script that does this. It writes the new web page to standard out. You can then just view it in your web browser.

If others want to use it, you'll need to adjust the delBookmarkFile definition of line 33 to point to the location of your exported del.icio.us bookmark file before you run it.

It doesn't save or use all the information that del.icio.us exports, but it does generate a smaller faster web page.

The look & feel could be improved with some nicer CSS.

Suggestions welcome.

[]

[]

[]

( Jun 14 2007, 07:45:08 AM PDT ) [Listen] Permalink

20070418 Wednesday April 18, 2007

New Version Of the Get TV Listings Script

For background on this, see a previous post.

I've adjusted the Python script to now automatically email you the results rather than pump the results out to standard output which then had to be piped to the mailx program.

If you are interested in using this script, you will first need to do the setup as described in the previous post. You will also need to adjust the emailAddr variable in the script (as well as the TV_GRAB, XMLTV_FILE and programs ones), to suit your needs.

[]

[]

[]

( Apr 18 2007, 11:29:10 AM PDT ) [Listen] Permalink

20070402 Monday April 02, 2007

Finding Out When Your Library Has New Books You Are Interested In

I've been meaning to do this for a while, and it wasn't until I discovered that my local library now has the new Robert Crais Joe Pike novel in, and there are already 87 people who have requested it, that I forced myself to work out what needed to be done.

Here was a the goal. I wanted to be automatically informed via email, when my library had available any of the new books that I'm interested in.

Here's how I did it. First of all I created a new wish list at Amazon specifically for this list of books. You've probably seen that Amazon have a web page that will allow you to find newly released (or soon to be released books). From these lists, I populated that new wish list.

I know the web address of my libraries online web catalog. (See a previous post on this). I also have an access code to allow me to use the Amazon Web Services API.

I wrote a simple Python script that would do the following:

You'll see from the beginning of the script, that if you want to use this, there are four things you are going to need to adjust:

You might also have to customize the magic string to look for to indicate whether the book was found at the library.

As books become available at my local library, I will request them, using the URL's provided automatically in the email, and remove them from my Amazon wish list so they don't get triggered again. Every two or three weeks, I plan to go back to the Amazon new books lists, and see if there are any more books that I want to add to my wish list.

I've already added this script as a cron job so that it runs every night.

It's already discovered that my library has pre-ordered the new book by John Scalzi, and I'm now #2 on the request list.

What would be even better was if there was an RSS feed I could subscribe to that would automatically tell me new books as they came out, maybe even filtering the results based on my interests. If anybody knows how to do this last part, please comment.

[]

[]

[]

[]

( Apr 02 2007, 07:36:38 AM PDT ) [Listen] Permalink

20070309 Friday March 09, 2007

Your TV Program Listings Via Email

Yesterday, I setup xmltv and OnTV to hopefully give me reminders of when my TV programs were coming on. Although I found several problems with OnTV, I thought I'd give it a try.

There were two shows I watch on a Thursday; one of them had a new episode last night. How did OnTV do in telling me this? Nothing. Nada. Zip. Zilch. No reminders whatsoever. Even if it had reminded me, I'm convinced from looking at the ontv v2.6.0 source code that it can't:

So OnTV is gone. Package removed. It's outta here!

Friday is hacking day. Time to put something together myself that meets my requirements.

Luckily the xmltv package has a couple of really cool extra scripts that help me here:

I put together get_listings.py, a simple Python script that will automatically download my latest TV listings, check for programs I'm interested in, and generate on stdout, a list of programs that have new episodes today.

Hopefully the script is fairly obvious and if you are interested in using it, that it's easy to see what you need to change to customize it for yourself. Don't forget you need to have created an account with Zap2It Labs and installed and configured xmltv. See yesterday's blog entry for more details on that.

The last part of the puzzle was working out how to mail the output from the script to myself. This involves installing the GNU mailutils package, then reconfiguring exim4 to allow me to send remote emails (the default is just to allow local delivery). The former was just a few clicks away via Synaptic Package Manager. The latter involved running:

  % sudo dpkg-reconfigure exim4-config

So now I can do:

  % python get_listings.py | mailx -s "TV Programs" -t my-email-address@sun.com

and a listing of the TV programs I'm interested in for today with be mailed to me. I'm now about to stuff it in a cron job so it's totally automatic.

[]

[]

[]

( Mar 09 2007, 09:06:38 AM PST ) [Listen] Permalink Comments [2]

20060807 Monday August 07, 2006

Adding "Like this post?" links to your Blog


Yesterday, I experimented with what it would take to add a "Digg it" link to each blog post I publish, so that my loyal readers can tell others how wonderful it is and spread the word.

After looking at the Digg URL Submission Specifications that are almost buried away on the Integrating Digg within your website page, I realized that it could be done, but I wasn't sure exactly how to get all the information I needed.

So I emailed The Man. Dave Johnson. Mr Roller (whose book has just come out this last week).

Coincidentally Dave had just added some code to his _day template to automatically add a nice little strip along the bottom of each of his blog posts. This will easily allow you to:

This was almost what I needed. From my reading of the Digg URL Submission Specifications, I knew that I could make submitting a story so that it could be dugg, a little easier. What I did was adjust his "Digg it" code to go to phase 2 and automatically use the blog summary (if there is one) and the blog category name (this assumes that your category names match the ones that digg.com uses which is probably unlikely). If you don't use a summary or have a valid category, then the first person to "Digg it" will have to fill them in. If the story has already been dugg, then all others who "Digg it" will just get taken to the filled digg entry where they just have to hit the "Digg it" button. Very nice.

If you want to do something similar, and you are using Roller, then you will need to add some code to your _day template. Here's what mine now looks like.

Also, as there doesn't seem to be a global resources repository within Roller for images that a lot of us would each like to use in their blogs, I suggest taking copies of the four small icons, and adding them to your own resources area.

It's probable that the Del.icio.us, SlashDot and Technorati postings could be further automated too. I'll have to investigate that.

As I've done minimal experimenting with this new setup, please let me know if you find any problems.

[]

[]

[]

[]

( Aug 07 2006, 07:46:54 AM PDT ) [Listen] Permalink Comments [1]

20060626 Monday June 26, 2006

Listen to Your Blog - Part 2

On Friday, I wrote about how you can listen to your blog using Talkr and commented that it "sure would be nice if Roller could automatically do something like this."

Well it can. After talking with Dave Johnson (Mr. Roller), I found out the magic.

You need to adjust your Roller _day template and add in a line of the form:

<a href="http://www.talkr.com/app/fetch.app?feed_id=nnnnn&perma_link=$absBaseURL$entry.permaLink">[Listen]</a>

where nnnnn is the feed I.D. you got when you signed up at Talkr.

I put mine between the following two lines:

<span class="dateStamp">(#showTimestamp($entry.pubTime))</span>
#showEntryPermalink( $entry ) 

Save away the modified template and Robert's your mothers brother.

As excentral mentioned, Talkr "needs work" speaking the Technical Stuff. This is not an easy problem to solve, so it's very understandable. It does an excellent job of "normal" English though.

[]

[]

( Jun 26 2006, 08:29:54 AM PDT ) [Listen] Permalink Comments [3]

20060623 Friday June 23, 2006

Listen to Your Blog

I was recently reading the Cult of the Dead Cow web site. For each post on their blog, they've added a Listen link that will play the audio equivalent of that entry. Nice voice too.

Cool. Your own instant podcasts. They use Talkr to do this. I signed up with them, and got a feed I.D. I then looked at the format of the Dead Cow "Listen" links to see what I'd need. I've added a "Listen" link of my own at the bottom of this post.

Now I suppose I'll have to go back and retrofit my previous 700 posts...

Sure would be nice if Roller could automatically do something like this.

Update: Roller can. See here for all the details.

[]

[]

[Listen]

( Jun 23 2006, 07:56:18 PM PDT ) [Listen] Permalink Comments [2]

Links for 23rd June 2006

A hacking set this time. Use responsibly.

[]

[]

( Jun 23 2006, 10:10:59 AM PDT ) [Listen] Permalink

20060601 Thursday June 01, 2006

Check your Library from Google Book Search

Another Lifehacker link from March 2006. This points to an article on Edward Vielmetti's, Superpatron web site where he shows how to use a Greasemonkey script from within Google Book Search to see if the Ann Arbor District Library has a copy of the book.

That's neat I thought. Let's see if I can get it working for my local library.

For those of you who aren't familiar with Greasemonkey, it's a Firefox extension which lets you to add bits of DHTML ("user scripts") to any web page to change its behavior.

In this case Edward's Greasemonkey script is tweaking the Google Book Search web page and adding a line that tells you the availability of the current book you are searching (see snapshot above).

His script is based on a similar Amazon hack from Jon Udell which I've blogged about before

I couldn't find any details on how to adjust Edward's script for a different library, so I ended up copying the script to my computer and looking it over in an editor. It's clear that the lines that need adjusting are all grouped together near the beginning:

var libraryUrlPattern = 'http://www.aadl.org/cat/seek/search/i?SEARCH=';
var libraryUrlPatternTrailer = '&submit=Search&searchscope=26&x=0&y=0';
var libraryName = 'the Ann Arbor District';
var libraryAvailability = /AVAILABLE/;
var libraryOnOrder = /ordered for Library System/;
var libraryInProcess = /being processed for Library System/;
var libraryHolds = /(\d+) holds on First Copy Returned/;
var libraryDue = /DUE (\d\d\-\d\d\-\d\d)/;
var notFound = /No matches found; nearby STANDARD NOS are/

The first two are easy to understand. It's the "before" part of the URL that you will send to your library and the "after" part, with the ISBN number for the book getting wedged in the middle. In my case, for the Santa Clara County library, these two are:

var libraryUrlPattern = 'http://146.74.92.11/ipac20/ipac.jsp?index=ISBNEX&term=';
var libraryUrlPatternTrailer = '';

The next one is the name of the library, and this is used on the line of text that's embedded in the Google Book Search web page.

The remainder I determined by a process of trial and error. They are unique text patterns that are present on the web page returned from the library for the book search, that tell you whether the book is available, on order, in process (currently being added to the library), on hold, due or just not found.

For the Santa Clara County library, I was able to fairly easily come up with:

var libraryAvailability = /In/;
var notFound = /Sorry, could not find anything/

For the others I would need to try to find books that are in that state and adjust my script accordingly.

Part of this was just seeing whether it could be done. Whether Greasemonkey worked with Firefox on Solaris and whether it was possible to adjust the script for my own local library.

As Greasemonkey makes Firefox run really sluggishly on my Solaris box (which is not a slow machine by any means), and as I don't often do a Google Book Search, I uninstalled the Greasemonkey extension after I'd got it all working.

I'll stick with Jon's way cool Amazon library hack instead.

[]

[]

[]

( Jun 01 2006, 07:57:18 AM PDT ) [Listen] Permalink

20060209 Thursday February 09, 2006

My Own Tag Cloud (Now With Links)

I've been working on my tag cloud script. Each of the tag words now has a dynamic layer associated with it which contains a list of hypertext links for all of the blog posts that have that tag.

I tried munging the output generated by the new version of the Python script (you'll need the JavaScript file too), so that it'll fit in a paragraph below. That seemed to blow roller's mind, (with some really weird formatting), so I've made it available via this link. It's also down in the miscellaneous section at the bottom of the right sidebar.

When you are over the tag you are interested in, click on it and a layer will appear containing links to all of my blog posts that have this Technorati tag in them.

There's still a few problems I need to fixup. (I'm still learning how this code works). For example, if not all the links are showing, you will need to use the keyboard arrow keys to bring the rest of the layer onto the screen.

Also note that currently the best I can do is provide a link to the day that that blog post was posted. If there was only one post per day then that's fine, but otherwise you'll have to possibly scroll down to find the relevant one. I'm working with Dave Johnson to hopefully improve this.

I've noticed that my previous tag cloud didn't show up correctly when I looked at it at BlogLines. I'm guessing they are striping out some of the HTML tags as they repost them. To get the best effect, you've have to look at the tag cloud directly from my blog.

The JavaScript code at the heart of this (which I've reformatted and hacked on a bit), came from a co-worker who thinks it originally came from a DHTML tips website. If anybody knows exactly where this originally came from, please let me know as I'd like to give credit to the appropriate people.

In the process of doing all of this, I also found a couple of my tags that were incorrectly spelt and fixed them up.

The next task is to improve the CSS to make the tag cloud appearance (and the popup link layer) look better and to improve the JavaScript so that the layer appears on the screen without having to scroll using the keyboard arrow keys and doesn't go away at inappropriate times (such as when you move the mouse out of it).

Hopefully there will be another version in the future that makes all of those changes.

[]

[]

[]

( Feb 09 2006, 12:25:26 PM PST ) [Listen] Permalink