Singpolyma

Archive for April, 2006

Archive for April, 2006

Three Things

Posted on

So Trev tagged me and I’m gonna do this thing:

3 things I want to do or see before I die

  1. Get married
  2. Have kids
  3. Bring glory to God through my life

3 things I can’t do

  1. I cannot do anything remotely athletic
  2. I cannot draw
  3. I cannot fly

3 things that attract me to the opposite sex

  1. Sense of humour
  2. Being accepting
  3. Holding fast to morals and integrity
  4. Only three? that’s nuts!
  5. Long hair (will people kill me if I list some physical stuff too? 😉 )

3 books and movies I love

  1. The Bible
  2. Byzantium and anything else by Stephen Lawhead
  3. Black, Red, White — Ted Dekker
  4. Many more 😉

3 things I say most often

  1. 😉
  2. What? Me?
  3. Chels

3 things you should know about me

  1. I speak French
  2. I don’t speak Latin (yet)
  3. I must be asked a more specific question to gain more insight ;P

And so I do tag my brother Daniel

coComment JSONP Native

Posted on

coComment has added native JSONP support. They seem to have worked out the bugs from their first implementation and I have reworked the code for my sidebar to use their system. Out of this has come two generic coCo JSON functions. One, coco_flat, takes their nested group-comments-by-article format and flattens it to one-element-per-comment with all the article and comment attributes intact:

function coco_flat(coco) {
var comments = [];
for(var i=0; i<coco.length; i++) {
for(var i2=0; i2<coco[i].comments.length; i2++) {
comments.push({
“blogID”:coco[i].blogID,
“blogTitle”:coco[i].blogTitle,
“blogURL”:coco[i].blogURL,
“blogURLCoco”:coco[i].blogURLCoco,
“articleID”:coco[i].articleID,
“articleTitle”:coco[i].articleTitle,
“articleURL”:coco[i].articleURL,
“articleURLCoco”:coco[i].articleURLCoco,
“id”:coco[i].comments[i2].id,
“author”:coco[i].comments[i2].author,
“authorURL”:coco[i].comments[i2].authorURL,
“authorAlias”:coco[i].comments[i2].authorAlias,
“comment”:coco[i].comments[i2].comment,
“commentURLCoco”:coco[i].comments[i2].commentURLCoco,
“dateISO”:coco[i].comments[i2].dateISO,
“date”:coco[i].comments[i2].date
});
}//end for cocommentResultSet[i].comments
}//end for cocommentResultSet
return comments;
}//end function coco_flat

The other, coco_compare, is for use in sorting so flattened results by date:

function coco_compare(a,b) {
if(a.date<b.date) return -1;
if(a.date>b.date) return 1;
return 0;
}//end function coco_compare

To use this function to sort a flattened array of coComment data oldest to newest call array.sort(coco_compare), and to sort by newest to oldest also call array.reverse() as well.

Here is an example piece of code putting together all that is above, an incidentally what I am using in my sidebar:

function list_cocomment(blockid,username,charlimit,itemlimit,boxid) {
if(!charlimit) limit = 25;
if(!itemlimit) limit = 10;
if(!boxid) boxid = 0;
coco_callback = function(data) {
var block = document.getElementById(blockid);
var txt = ‘<ul class=”cocomment”>’;
comments = coco_flat(data);
comments.sort(coco_compare);
comments.reverse();
var elipsis = ”;
for(var i=0; i<comments.length && i<itemlimit; i++) {
elipsis = ”;
if(comments[i].comment.length > charlimit)
elipsis = ‘…’;
txt += ‘<li><a href=”‘+comments[i].articleURL+'” title=”Coment on ‘+comments[i].articleTitle+’ by ‘+comments[i].author+'”>’+striphtml(comments[i].comment).substr(0,charlimit)+elipsis+'</a> <a href=”‘+comments[i].articleURLCoco+'”><img src=”http://www.cocomment.com/images/logo-16 alt=”[co]” /></a></li>’;
}//end for comments
txt += ‘</ul>’;
txt += ‘<a href=”http://www.cocomment.com/comments src=”http://www.cocomment.com/dyn/images/buttons alt=”More &raquo;” /></a> ‘;
txt += ‘<a href=”http://www.cocomment.com/mybox-rss2 src=”http://wrinks.ning.com/feedicon12x12.png alt=”[feed]” /></a><br />’;
block.innerHTML = txt;
}//end function-var coco_callback
writeScript(‘http://www.cocomment.com/mybox-json?nick=singpolyma&box=1&callback=coco_callback;);
}//end function list_cocomment

An Update that Should be Long but may not be

Posted on

So I haven’t posted in awhile… since Chels was first grounded which makes about 16 days. So what’s been going on? Well the two primary recent events around here are the Heritage Fair and my brother’s birthday party.

Heritage Fair
The Heritage Fair was a lot of fun. I didn’t look at the projects much (I never do) but they looked alright. I got to hold Emme Ezel most of the day (I love babies, and she is soo cute! :D) she has got to be the best-mannered baby I’ve ever played with too, hehe 😀 We played a couple games, one where you had to do a sand painting as fast as you could, one where you wrapped your teammate up in toilet paper to make a ‘totem pole’, one where you carried a paper ‘kiwi’ to a bowl by sucking on it with a straw (if that makes any sense) and the o-so-traditional trivia game. Then we had the International Dinner, which was very interesting, as always. We had macaroni and cheese, cabbage rolls, some sort of german potatoe salad, cheddar scalloped potatoes, crépes, maple surup pie, and some other stuff. Really good stuff, and lots of it 😀 If you want a second opinion check out my bros blog.

Dan’s B-Day
Dan’s bday was yesterday, and that was a lot of fun too 😀 We had TWENTY people there! 😯 comes from his birthday coinciding with spring break for RFIS and Palmview, so we had the whole Hoyt family (well, ok, not the boys, they’re in college, but whatever), the Puhl kids and their caretaker (not their parents though, hehe), and various and sundry others voilà. We did a bonfire with pizza and cake and then we the lesser in age played a few rounds of Mafia. Then at about 9:30 we all came back to our house (not all twenty of us, but those of us that were still coherent enough by that point, mostly the moins-agé) and watched Cool Runnings (gotta love that movie! :D)

And that’s about a goodness for updating all of thou on my wonderful livings. On another note, for those of you who prefer the wonderfully useless and inferior (sorry, I’m biased ;P) Xanga subs mechanism I am now cross-posting all my personal blog posts to there.

YubNub Toolbar

Posted on

If you hadn’t heard of YubNub before, now you have. The basic concept is easy to grasp — typing “g test” takes you to a goole search for ‘test’ and “wink test” takes you to a wink search for test, etc. Although much more powerful than search engines, that’s a good place to start.

If you send YubNub a raw URL it will take you there without processing. This enables one to use YubNub as your location bar directly. Problems with this approach have been that the search box in firefox (where YubNub has traditionally resided for FF users) is very small and does not update on page load.

Solution? Write a new FireFox extension to replace the location bar with YubNub. Done. This is my first ever FireFox extension, so it may be a bit quirky. I’d appreciate feedback and bug reports, but cannot guarentee I can do anything about it, since my XUL etc knowledge is very limited at this point.

I have released version 0.11. Install or reinstall using instructions below, uninstall previous version first if updating. New features for this version include: integration with browser history, display of favicons, display of feed icon/security icon where applicable, alt+k selects textbox, icon on Go button same as standard Go button.

Steps to install plugin:

  1. Download the XPI file
  2. Open your Firefox ‘Extensions’ window and drag the XPI file on it
  3. Restart Firefox

Include Feeds / Reading Lists in Your Sidebar

Posted on

Including headlines in your sidebar is an old concept, one that can be very useful to both you and your readers. This post will by no means be a comprehensive list of methods, but I will outline what I feel are the ‘top 4’ ways to do this.

Peek-a-boo Headlines
Peek-a-boo headlines are a part of my version of FreshTags and may be coming to primary FreshTags eventually as well. I may soon be releasing a version of the hack that works well without a FreshTags installation. I really like this method because my blogroll still sends out link-love and for FreshTags users you get context-sensitive headlines.

FeedDigest
FeedDigest is an old friend of mine. The first-ever feed-to-script service I used was RSSDigest, the forerunner to FeedDigest. The service provides excellent features, including the ability to mix feeds together into a single digest, include scripts for JavaScript or PHP, and an RSS mashup feed of your digest. You get 100% code control over the output as well as the many prefab templates for newbies. The only problem here is that you can only run 5 digests — any more and you pay.

Feed-o-Style
Feed-o-Style is a newer cometitor to FeedDigest. You don’t get nearly the code control and there are no feed-mixing options, but their prefab templates are nice and customisable for most purposes. The only include option is JavaScript. There is also an ‘API’ by which you can generate feed-o-styles from a script.

Grazr
Grazr is a different sort of service. Their code is barely customisable and again the only include option is JavaScript, but that’s because the whole system runs using AJAX-style operation. Headlines from a feed can be included in your sidebar, or an entire OPML reading list can be rendered (XOXO not yet supported, see my sidebar for an example). ATOM feed support seems to be missing as of yet, and there are some other issues (mostly caused by the unreliability of implementations of the OPML ‘spec’) but overall it is a very interesting start.