MasterWish WordPress Plugin v1.5 Released!

MasterWish is happy to announce that there is a new version of the MasterWish WordPress Plugin available for download! Get it here.

Bug Fixes:

  • Images now display in lists
  • Currency symbols now match what the list owner chooses in MasterWish

New Features/General Updates:

  • Works in WordPress v2.1.2
  • Plugin now uses MasterWish List XML rather than the List RSS to separate out elements (like Description, Price, Priority, etc) rather than piling them all in the RSS Description tag.
  • MasterWish options menu has be relocated from the WordPress Options menu to the WordPress Plugins menu to allow for easier use for those without full Admin (i.e. in WordPress Mu)
  • www.masterwish.com URL has been updated to masterwish.com

Speeding Up Prototype’s $$ Selector

prototype.gif Prototype, as I’ve stated in the past, is our Javascript library of choice for Ajax at Plymouth State University and in the current re-writing of MasterWish. As of version 1.5 of Prototype there has been a sweet Selector function $$ which is best used when manipulating more than one dom element of the same type…i.e. updating all buddies in a buddy list at MasterWish with some property.

Here’s a simple example that we use at MasterWish:

mw_b.prototype.checkAll = function()
  {
    $$('.buddy_checkbox').each(function(e){e.checked=true;});
  };

All that example does is iterates over all elements in the DOM that have the class buddy_checkbox and sets their checked value to true. Short and sweet. However, with version 1.5 of Prototype, it could be dog slow at times with more complex selector queries.

I was ecstatic when I found (via Ajaxian) that Sylvain Zimmer has sped up the $$ function quite a bit. I implemented it in the test area of MasterWish and have been very pleased with the results! Here’s what Sylvain has to say on his mod:

Prototype’s current code is quite elegant (as always!) but very slow, so I wrote an add-on that makes this function up to 20 times faster in most usual cases (tested on IE6, Firefox 1.5 and Opera).

[…]

Here are the main ideas of this add-on :

  • Forwarding the call to the old $$ if the selector expression is too complicated (currently : if it uses attributes)
  • Replacing regular expressions with a simple parser
  • Minimizing the number of operations done on each iteration.
  • Trying to use getDocumentById() instead of getDocumentByTagName() when possible.
  • Avoiding recursive functions with return values.
  • Not being afraid of some “old-style” code if it speeds up the execution ;-)

All you need do is get his mod and include it in a script tag after the Prototype inclusion. Simple as that!

MasterWish – Practicing What I Preach

masterwish MasterWish, my labor of love (created with my friends Zach Tirrell and Jon Emmons) is my playground for Ajax and Web 2.0 experiments.

If you haven’t been acquainted with the site, its a wishlist site with a schlew of features. The high point is the ability to secure down lists and grant access to specific buddy groups. I’m pleased to say that we have gained a decent member base in the past 8 months and I am also happy to say that things are going to change around shortly!

MasterWish was built using SAJAX as the tool of choice for Ajax communication but as I’ve mentioned in the past, I am a Prototype convert. My knowledge of Ajax, JSON, and general application structure has been morphing so much in recent weeks that I have held off in completely revamping the wish list site.

Things are changing. I have begun the work to implement the following:

  • Creation of more “hackable” Web Service APIs using SOAP and REST
  • Representation of data using both XML and JSON
  • Ajax powered by Prototype
  • Sweet DOM manipulation powered by Script.aculo.us
  • Separation of Layout and Logic with event:Selectors
  • and of course, we’re already doing: Server-Side Templating for greater separation of Layout and Logic.

Sign up. Stay tuned. Get gifts.

Script.aculo.us Is My New Best Friend

Ajax is great. DOM manipulation is sexy. I’m fairly new to the Ajax world having only developed with with it since July. MasterWish was my guinea pig and continues to be my playground for all things Web 2.0. Luckily, my manager Ken is pumped up about this whole Web 2.0/Ajax thing which has allowed me to experiment with my projects at work as well and PSU should expect to see some sweet apps roll out over the next year!

Since July, I’ve been developing my Ajax applications and examples using SAJAX (Simple Ajax), a PHP/Javascript framework for Ajax development. It was great at first glance…a lot easier than building Asynchronous Javascript transactions from scratch. But despite its ease, it was a bit clunky. Last week I was stumbling around the web looking for anything new to suck up and found a beauty of a tool. Script.aculo.us.

Script.aculo.us is a Javascript Effects and Control framework developed by Thomas Fuchs, a software architect living in Vienna, Austria who, like me, was disappointed by current web application frameworks that made no sense to him. His framework is 3 things: Easy to Use, Simple, and Easy to Use. His libraries – built off of the Ajax framework, Prototype – blow SAJAX out of the water! Let me give you an example to, say, update a news title on an article (I won’t include the HTML markup as that is trivial):

Here’s what needs to be done to build a SAJAX call:

Step 1: Create a SAJAX Call Function

function x_updateTitle()
{
	sajax_do_call('/process_ajax.php',"x_updateTitle", x_updateTitle.arguments);
}

Step 2: Create a server side function to handle the update

< ?php
function x_updateTitle($news_id,$news_title)
{
	//do some database calls to update the title;
}
?>

Step 3: Edit the server side SAJAX file (process_ajax.php) and add x_updateTitle to the list of valid call functions

< ?php
include('sajax.php');
addFunctions('x_updateTitle');
handleClientRequest();
?>

Step 4: Call the SAJAX Javascript function from somewhere (in an onClick, onSubmit or something)

<a onClick="x_updateTitle(1, document.getElementById('news_title').value, 'callbackFunction');">asdfdf</a>

Here’s the equivalent in Script.aculo.us
Step 1: Create a server side function to handle the update

< ?php
function x_updateTitle($news_id,$news_title)
{
	//do some database calls to update the title;
}
?>

Step 2: Call the Script.aculo.us Javascript function from somewhere (in an onClick, onSubmit or something)

<a onClick="new Ajax.Request('/process_ajax.php', { asynchronous:true, parameters:'news_id=1&news_title=$(\'news_title\')', onSuccess:callbackFunction });">asdf</a>

Thats it! Its a big difference. Thats just the tip of the iceberg. Script.aculo.us has many features for implementing Drag and Drop with one line of Javascript code; fancy display/hide functions; dynamic DOM Element creation/deletion; field autocompletion; and various other visual effects. It slick. And to top it off, the Script.aculo.us website is pretty sweet! Luckily the documentation is excellent and is in wiki format. As Plymouth State moves into the Web 2.0 world, I’ll be pushing for Script.aculo.us/Prototype to be our Ajax standard. I have seen the light and it is good.

Ajax, More Than A Buzz Word

Ajax the development technique, not to be confused with Ajax the cleaning solution, is taking the web by storm. What is it?

Ajax stands for Asynchronous Javascript And XML. Its an architectural methodology on the interactions between a number of different technologies in a way that provides a more seamless user experience between user-to-server communication.

There are tons of blogs and articles out there that rant and rave of its use as savvy site designers implement Ajax into their web applications, and rightly so. However, through my blog skipping and digg watching I have seen numerous complaints of “OMG, Ajax is stupid….its just a fad/buzzword/etc” or “Ajax is just overhyped, don’t know why people use it!!” I have a couple words that describe those people: cynical, ignorant and, well…squirrel handed. Wake up people. Ajax isn’t a fad, its an architectural change in the way that web applications function. A focus on application speed and uninterrupted user interaction.

What’s so great about it? Why do I pee my pants with glee every time I use a web app that makes use of the technology?

I’m a developer. I’ve been developing database driven web applications for a number of years now and have seen the clear line between a desktop application and a web application. Desktop applications are highly interactive and responsive to the user, where web apps (in the past), were fairly static locations (however dynamic the content) to provide information/entertainment to the user, where user interaction required page loads in order to store information to a database/write to a file.

Next came Flash, an excellent tool but tends to require a much more artistic flare and is much more time consuming with general maintenance than its worth.

The reason Ajax is so sexy is that it bridges the gap.

The average-Joe browser may not be aware when they stumble upon a site that makes good use of Ajax, but that average Joe can feel something right about it. To the avid browser, however, an Ajax site is more readily obvious; you can interact with elements on a page and save settings without reloading; pages are highly resposive to user input with minimal wait times.

Gmail and Google Maps were the applications that really brought Ajax into the limelight. (They weren’t the first, just the first major apps). The world saw what Google could do and followed suit. The world saw that it was good. The Ajax revolution was born. It has birthed a whole new breed and boom on the internet, bringing forward a multitude Ajax enabled sites and applications:

And thats just the tip of the iceberg. I look forward to what will become of our expectations of web applications. You won’t see me sitting idle during this evolution. I will be innovating and participating all along the way.

MasterWish WordPress Plugin

I am pleased to announce the arrival of the MasterWish WordPress plugin! Anyone that has an account on MasterWish and runs a WordPress blog can aggregate their publicly viewable lists. For an example of how I have it set up, check here.

Get the MasterWish WordPress plugin v1.1!

Setup Instructions:
Installing the Plugin:

1. Download and unzip wp-masterwish.zip

2. Place masterwish.php in your wp-content/plugins directory
3. Log in to your WordPress admin panel and activate the plugin, then visit the MasterWish submenu of the options tab.
4. Enter your MasterWish username and click ‘Update Options’
5. If you want a default list to be selected, select a list from the List drop-down menu and click ‘Update Options.’
6. Create a new Template for your wishlist in your wp-content/themes directory.

In the body section of that template, we suggest you place the following function calls:

<h2><a href=”<?php masterwish_list_url($_GET[‘list_id’]); ?>”><?php masterwish_list_title($_GET[‘list_id’]); ?></a></h2>
<strong>My Lists</strong>: <?php masterwish_lists(”,'[‘,’] ‘); ?><br/><br/>
<?php masterwish_get_list(); ?>

7. Create a new Page in WordPress and set its template to the template you just created in the previous step!

MasterWish Plugin Functions:

  • masterwish_get_list

    retrieves items from a list

    Usage:

    masterwish_get_list({list_id},{display_images},{maxresults},{random});

    list_id is the wishlist id number that is being browsed. Leaving this with a blank string ” pulls the default list set in the MasterWish Plugin’s options tab.
    display_images specifies whether the item images are displayed. Default is false. Available options: (true/false).
    maxresults is the maximum number of items you want displayed in a given list. Setting this value to 0 displays all items in a list.
    random shuffles your item list around.

  • masterwish_list_title

    retrieves the current list title

    Usage:

    masterwish_list_title({list_id},{return},{before},{after});

    list_id is the wishlist id number that is being browsed. Leaving this with a blank string ” pulls the default list set in the MasterWish Plugin’s options tab.
    return specifies whether you want the title returned or echoed. Default value is false, available options (true/false).
    before is what you want prepended to the wishlist title.
    after is what you want appended to the wishlist title.

  • masterwish_list_url

    retrieves the current list url

    Usage:

    masterwish_list_url({list_id},{return});

    list_id is the wishlist id number that is being browsed. Leaving this with a blank string ” pulls the default list set in the MasterWish Plugin’s options tab.
    return specifies whether you want the title returned or printed on the screen. Default value is false, available options (true/false).

  • masterwish_lists

    retrieves the user’s publicly viewable lists

    Usage:

    masterwish_lists({list_id},{before},{after},{return});

    list_id is the wishlist id number that is being browsed. Leaving this with a blank string ” pulls the default list set in the MasterWish Plugin’s options tab.
    before is what you want prepended to each wishlist title.
    after is what you want appended to each wishlist title.

    return specifies whether you want the lists returned or printed on the screen. Default value is false, available options (true/false).

Amazon Tags!

About Time! According to CNet, Amazon is heading down the road of tagging. This is great news in my book. I’m a follower of the Web 2.0 movement and have really been turned onto the idea of folksonomy (tagging) by products like Flickr and thus have recently brought MasterWish on board with tagging.

While many people out there have used tagging in Flickr, Gmail, MasterWish and various other web 2.0 apps…there are still many out there that express their opinions on tagging as “Tagging…WTF is that?!”. Having a large web company such as Amazon with its HUGE following jump on the band wagon with tagging will help bring folksonomy to the masses.

While exciting that this is happening, Amazon is slowly rolling tags out to their users as evidenced in this excerpt of the CNet article:

The idea, apparently, is to slowly experiment with tags and to give users some power over how certain Amazon products–books, for example–are categorized.

For now […] only about half of Amazon’s users can even see tags on the site.

Its only a matter of time before folksonomy will cease to be a buzz word and start appearing in the english dictionary. Everybody and their brother will know of tagging and the world will be a happier, easier to search place. I can only hope

bstat Search Cloud

Casey over at MaisonBisson has developed a sweet WordPress plugin called bstat. I’ve been using it since I installed WordPress as my blog. Well, one thing that is missing from the plugin that I decided I wanted was a search cloud (like a tag cloud, only for incoming searches)… I recently created a tag cloud on MasterWish so decided to use that. Here’s the function.

Special Functions

  • bstat_search_cloud

Usage:

bstat_search_cloud(post_id, maxresults, days, starting_font_size);

  • post_id is the post_id for the story, usually provided by a WP variable. A value of 0 is used for grabbing all search terms from any post
  • maxresults is the number of search terms you wish to retrieve
  • days is the number of days back to look
  • starting_font_size is the starting font size of the smallest search term

Example:


<h3>All incoming search terms for this post</h3>
<small>< ?php bstat_search_cloud(0,50); ?></small>

MasterWish Enters the Web 2.0 World

MasterWish has been my labor of love for the past 6 months. The site – create by Zachary Tirrell, Jon Emmons, and myself – was opened to the public (in beta mode) in the middle of September.

Over the past month, we’ve been pretty excited about the whole Web 2.0 craze. The initial release was fairly solid but it lacked a few key elements to make it a 2.0 application. The three of us have wanted to bring MasterWish fully into the Web 2.0 world, so with a great deal of planning and even more coding, I am comfortable to say that MasterWish is now a fairly solid Web 2.0 application.

MasterWish has:

  • Folksonomy Features (tagging)
  • Easy item adds via a Favelet
  • Ajax for quick and easy assignments of items to lists, buddies to groups, buddies to your buddy list, copying items from other people, etc.
  • Buddies/Contacts
  • Group-Level access to Categorized Wish Lists
  • Fine-grained access control on your user information (so you can distribute information to people on a case by case basis). Here are some things you can distribute to other users:
    • Real Name
    • Address
    • E-mail
    • Many clothing sizes (shirt, bra, inseam, ring, head, etc)
    • Color Preference
    • etc.

Currently we are working on a very sweet feature to allow for collaborative lists. This will make wedding registries a LOT easier and my office at Plymouth State (which currently uses MasterWish for book orders) will be able to create an office wishlist and allow multiple users to contribute.

Christmas is coming around the corner, so if you haven’t checked it out for your wishlist needs, you should do so. You definately won’t regret it…and your family will thank you for it!

Juggling Knives

I used to juggle all the time. When I was a student at PSU, during the warm months I would hang out by Rounds Hall and juggle on the grass between classes simply as a fun, sometimes frustrating passtime. About a year ago I put my clubs an knives away and hadn’t touched them since. That changed this weekend.

My brother in law came to visit me this Sunday and through some random conversation I learned that he was interested in juggling! He told me that he juggles balls and clubs and has wanted to try knives and torches. Well, thats when I busted out with my juggling knives and clubs and we went to the park to goof around!

Man, I didn’t realize how much I missed juggling and just how fun it was (and tiring)! I’ve juggled off and on for a few years, so I’m not very good by any means…all the more reason for me to start up again.

If you are interested in juggling and you have a good grasp of the concept from juggling balls, then I would suggest trying out clubs. They are frustrating at first but once you get them, it opens a world of opportunity. You’d be able to juggle knives and torches, too! (If you can juggle clubs, knives and torches are just as easy…save for the scare factor)

Here’s what I suggest you get:

Clubs, I use Phatboyz. They are a little fatter than European style and MUCH better than American clubs.
For Torches, go with Dube Customs.
For other juggling supplies, check out Dube.

Oh…and check out my Juggling List on MasterWish.


MasterWish

If you have ever made an Amazon wish list (or any wish list feature from any store), then you know how handy it is…how easy it can be to add items. But, despite the wish lists’ ease of use, you typically end up with managing more than one list…which is an irritating task. Enter: MasterWish, a new kind of wish-list. For the better part of this year Jon Emmons, Zach Tirrell and I have been working hard on this site and we are happy to announce that it is now ready for prime-time.

Ok, so whats the deal with MasterWish? Why did we make it? What is its purpose? Well, our goal was to create a centralized wish list site to house your needs and desires (as most wishlists do)…but we wanted the wish lists to be store independant. With MasterWish, you are able to create lists of items from any site you want (heck, your items don’t even have to be from a website…you can add items that you want to pick up at the grocery store). My friend Jon said it best when he wrote:

MasterWish is a wish list site with a whole lot more. Items on MasterWish can be from anywhere. Make up your birthday list with items from your favorite online vendors, but don’t stop there… You want things that may not come from online vendors. How about that nice lilac you saw at the garden center? Or that circular saw from the hardware store? Add those too! You can list items from anywhere and enter a web URL, a description of where to find it, or both!

Once you have a bunch of items you can organize them into lists. I have lists for music, videos, kitchen toys, and more, but the great thing is items can belong to more than one list. My birthday is coming up so I created a birthday list and added items from all my categories to it. It’s that easy.

The other big difference with MasterWish is you can control who sees your wish lists. You can create a wish list of what you want from friends and one for family and control who can see them.

MasterWish is still in beta, so we’re still working on improving and streamlining the site. If you have any suggestions please leave them at the Bugs & Suggestions link. We’ll do our best to implement everyone’s suggestions.

I hope you enjoy the site, make lots of suggestions, and get everything you wish for.

Ducky Chicken Finger

Scout and Ducky My wife Abby and I have an old cat (Scout). She’s 13 years old and is a house cat-turned outdoor cat-turned house cat. With our new apartment on the third floor, Scout has to stay inside most of the time and seems fairly bored…even with people in the apartment. Abby and I have been discussing getting another cat but had been stalling for one reason or another…until tonight.

I went to Zach’s house with Jon and Zach (obviously) after work today to work on our sweet website MasterWish. While there, Sara (Zach’s wife), brought home three homeless kittens (Black, Red, and White-ish Red)! They were fairly dirty so promptly received baths and afterwards I held the black one in a towel to keep it warm. As it sat in my hands our eyes met, a flea jumped onto my hand (which I promptly killed), and it was meant to be. I grinned to my friends as I picked up the phone and called my wife. The conversation went something like this:

Me: “Hi Wife. I’m holding a wet kitten, can I keep it?”
Wife: “Um.”
Zach (in the background): “You should have said you had your hands on a wet pussy.”
Me: “Hi. I have my hands on a wet pussy. Can I keep it? Do you want to drive down to Z’s house to see these three kittens that Sara brought home so we can have one?”
Wife: “Sure. See you in a few minutes.”

Abby agreed that the black one was a keeper (the other two will find their way to a Humane Society) and we were left to think of a name. Now, when the kittens came out of their baths, Jon named them Chicken Finger (the black one), Duck Sauce (the red one), and Crab Rangoon (the whiteish red one)…well, we weren’t too keen on keeping Chicken Finger for our little black cat (save for making Chicken Finger its middle name) so debated all the way home on what the little fur ball’s name would be. Abby thought of the name ‘Ducky’ and it seemed to fit as the kitten has a gimpy left hind leg and waddles like a duck when it walks (sorta). So…the official name of the new cat is Ducky Chicken Finger

Domain Name Junkie

I’ll say it right out. I’m a domain name junkie. It didn’t start out that way…heck I owned only one or two domain names for my entire time at college. It was about a year ago that I began my problem. I’d get an idea, no matter how unbelievably stupid/odd/etc and then head straight to Go Daddy and buy one. Why? In case I’d ever have the urge to go forward with that idea and try to make a buck or have a few laughs. (watch for SeeMeGroan.com) I’ve purchased/renewed 19 domains this year costing my about $151.05…and the sad part is I use less than half of them. Here are the ones I use:

Abby Batchelder
BorkWeb
Crimson Eagles
Don’t Use the Internet (this one will be used by this weekend)
Master Wish
Matt Batchelder
Uber-Geeks

Is having so many domains a problem? Well, maybe. It hurts my wallet at times but on the flip side its nice to get an idea and grab my spot on the internet before someone else does. That way, if I ever get around to making something that makes me money…well, it’ll have a home!