« July 2009 | Main | September 2009 »

August 31, 2009

Kynetx Endpoints and Linux

Kynetx Logo

Over the weekend, Travis Hartwell tweeted "I would try out Kynetx, but it appears the required plug-in Azigo is not available for Linux." Alas, It's true that Azigo doesn't support Linux. Still, there are some ways to use Linux to develop and deploy Kynetx apps. In fact, I do all my development on Linux.

We call the way that a Kynetx app is deployed an "endpoint." The endpoint is responsible for initiating the call to KNS and mediating the interaction with the client. The details of the execution model are available online.

There are several ways that Kynetx apps can be deployed beyond an information card selector and associated browser extension:

  • Direct embedding - The tags to call KNS can be directly embedded within a Web site. That's what I do on this blog. I use directly embedded tags to run rules for everything from managing the block that shows my last tweet to posting the dates of the CTO breakfast from Google Calendar. The advantages of direct embedding are that its simple, fast, and require no user download. The disadvantage is that directly embedded tags can only mediate contextual experiences across coperating Web sites.
  • KIX bookmarklet - As I mentioned in this post about Sweetter, Kynetx apps can be deployed through a bookmarklet endpoint. The advantage of a bookmarklet is that the applications is only executed when the user wants. There are applications--like Sweetter--where this is precisely the right behavior. For some applications that would also be a disadvantage.
  • Proxy Endpoint - Kynetx apps can be deployed by a proxy. In this style of endpoint, a proxy server--like Squid--is used to insert the tags. This is advantageous when all the interactions of a group of network users are to be augmented. Think "free Wi-Fi at the coffee shop" for an example.
  • Single purpose BX - KNS can be called by a single purpose browser extension (BX). We've built these on a custom basis for clients and will soon support automatic BX builds in AppBuilder. The advantage of a single purpose BX is simplicity, but you give up the flexibility and security of the selector and information cards.
  • Selector-based BX - Finally, there's the method we've been pushing: using information cards in a selector as keys for a BX acting as endpoint to call KNS. There are significant security advantages to this endpoint strategy and it's extremely flexible for the user. I think this will be the primary endpoint type for KNS, but by no means the only one.

In addition to these endpoints, we also still support Kynetx Pilot, a Firefox extension for running Kynetx applications. Pilot isn't something you'd ask your users to use, but it works for development.

Still, I believe that deploying through an information card selector is the most secure and flexible way to use KNS. I'm hopeful that we'll be able to support a Linux selector (like DigitalMe) with an open source browser extension. This is important to us and will happen as we get more resources.

In the meantime, it's reasonable to develop applications on Linux using AppBuilder and Pilot that can be distributed using any of the endpoints I've discussed above, or using information cards.

8:49 AM | Comments () | Recommend This | Print This

August 24, 2009

Why Use the Kynetx Rule Language Instead of Javascript?

Kynetx Logo

Last Friday I blogged about using Kynetx to put my latest tweet on my blog. Joseph Scott asked "Why would this be better than just using Javascript plus the Twitter API to show your last tweet?" The answer is a little longer than I wanted to put in a comment, so here goes.

KRL has a number of advantages over Javascript talking to the Twitter API:

  • KRL, the Kynetx Rule Language, provides a closer abstraction to the task than Javascript does as a general purpose language. This is, of course, something that could be subject to debate--if you're already familiar with Javascript the way to accomplish this task would be clear and seem easier than something written in an unfamiliar language. Still, I believe this to be true.
  • You could make Javascript more suitable to the task by loading a library like jQuery. This is exactly what KRL does. KRL uses a runtime library that is based on jQuery. So when you load a KRL ruleset, you're getting jQuery for free.
  • Getting to the Twitter API from Javascript running in the browser requires some tricks since browsers don't just load third party Javascript directly. KRL datasources are automatically loaded by the KRL servers, cached according to programmer specification, and available for use inside the ruleset.
  • KRL rulesets are served from the cloud. Consequently updates to the functionality of the application are immediately see by all users without updates or downloads.
  • Unlike scripts downloaded and run on a blog page, KRL security can be addressed in a systematic manner. For example, if a ruleset was found to present a security threat it can be shutdown in one place.
  • Finally, Kynetx applications, or KIX, are designed to be distributed, so there's no need to set up a server for users to download your library or install your application. Once built, KIX are ready to use and distribute.

If you'd like to try out KRL yourself, you can signup for an account and try it yourself. It's free. Also, you might want to register for Kynetx Impact, our developer conference in November.

9:20 AM | Comments () | Recommend This | Print This

August 21, 2009

My Last Tweet...Powered by Kynetx

Kynetx Logo

I've had a box on the right-hand side of this blog showing my lastest tweet. Today I realized that it would be better powered by Kynetx. I took a few minutes and wrote one up. You can see it on the right-hand side of this page.

To do this, I used the Twitter API to grab my tweets and then replaced an empty div on my page with it. Since Kynetx rules run each time the page is loaded, it's constantly updated.

The first step was to declare a datasource to read my tweets:

global {
 datasource tweets <-
   "http://<username>:<password>@twitter.com/statuses/user_timeline.json"
}

I've redacted my username and password for obvious reasons. If you substitute yours there, this rule will work for you (including getting your profile image).

The rule is pretty simple too:

  rule publish_tweets is active {
    select using ".*" setting ()

    pre {
      tweets = datasource:tweets("?a");
      res = tweets.pick("$.[0]..text");
      img = tweets.pick("$.[0]..profile_image_url");
      twit_res = <<
  <div style="width:165px;background-color:#39F;...
  <div style="height:47px;margin:3px;padding:3px;...    
        <a href="http://twtter.com/windley">
	<img align="left" border="0" width="40px" src="#{img}"> 
        Phil on Twitter</a> </div>
   <div style="background-color:#039;margin:3px;...
    #{res}
   <div>
   <div style="text-align:right">
       <a style="text-size:7px;color:#AAA" 
          href="http://www.kynetx.com">
       Powered by Kynetx</a></div>
  </div>
  >>
    }
    replace_html("#tweets", twit_res);
  }

This grabs the latest tweets from the datasource that was declared, manipulates the JSON usingthee pick operator and JSONPath, the sticks it into an HTML template (everything between the << and the >> is the template). Finally, the action replaces an element with the ID tweets on my blog with the instantiated template.

One improvement to make to this rule would be to get the name and twitter URL from the tweetstream so that it's completely independent of me. Another would be to process the text to make the URLs live. More work for Jessie.

You might be thinking, "so how many people are going to go in and write this rule just to get a tweetbox on their blog?" That misses the point. The idea is that you could build an application like TwitStamp on top of Kynetx. We have an API for building rules so that your code could just generate the rule for someone and then give them the tags to put on their blog given a little information (like the Twitter name and password). Kynetx is a platform for building context automation applications.

If you'd like to play around with Kynetx, signup for a developer account...it's free. Contact me with any questions.

4:51 PM | Comments () | Recommend This | Print This

August 19, 2009

CTO Breakfast this Friday

Sorry for the short notice, but it turns out that I'm going to be out of town on Thursday and Friday next week. Consequently, I'm going to have the CTO breakfast this Friday in the usual place: Mountain View room, Novell Cafeteria (Building G) in Provo. We'll start at 8am and go until everyone is bored.

Here are the upcoming breakfasts:

  • August 19, 2009 (Friday)
  • September 24, 2009 (Thursday)
  • October 30, 2009 (Friday)
  • December 3, 2008 (Thursday) - combined November & December breakfast

I hope you can make it. Contact me with any questions.

4:47 PM | Comments () | Recommend This | Print This

August 18, 2009

Silona Bonewald Week on IT Conversations

If you visit IT Conversations you'd be forgiven for thinking that it's Silona Bonewald week. Completely independently Jon Udell and I both decided to have her on our shows and scheduled her for the same week. View that as an indication of the fact that she's an interesting person.

Jon talked to Silona about Citability.org, an effort to get permalinks in government documents. Scott and I talk to Silona about open banking, an effort to make banking more open and accountable.

So, pop on over to IT Conversations and help us celebrate Silona Bonewald Week!

7:55 AM | Comments () | Recommend This | Print This

August 13, 2009

Converting QIF Files to CSV

Perl

Image via Wikipedia

I haven't updated Quicken on my Mac since 2006. Yeah, I know, but it does what I want. The program is that my version of Quicken only export QIF format files and Quicken on Windows apparently hasn't supported importing those since 2005 or something.

The problem was that I needed to get some information about my credit card account to my accountant. If you google around, you'll find people who sell programs that convert QIF files to Excel that they want real money for (like $60). Forget that. Especially when I've got Perl at my beck and call.

I found a Perl module called Finance::QIF that seemed to do the trick. There's also a Text::CSV module, as you'd expect. In 10 minutes I had the following little script that did just what I wanted:

#!/usr/bin/perl -w

use Getopt::Std;
use Text::CSV;
use Finance::QIF;

# global options
use vars qw/ %opt /;
my $opt_string = 'h?f:';
getopts( "$opt_string", \%opt );

my $input_file = "";
if ($opt{'f'} ) {
    $input_file = $opt{'f'} ;
} else {
    die "You must specify an input file with the -f switch.\n";
}
  
my $qif = Finance::QIF->new( file => $input_file, 
			     record_separator => "\r"  );

my $csv = Text::CSV->new(); 
 
print '"Date","Payee","Transaction","Category"', "\n";

while ( my $record = $qif->next ) {
  next unless ($record->{'header'} eq 'Type:CCard' );

  $csv->combine($record->{'date'},
		$record->{'payee'},
		$record->{'transaction'},
		$record->{'category'});
  print $csv->string(), "\n";
}

1;

This is only converting credit card register data because that's all I needed, but it wouldn't be hard to modify it to do something else. If you run this on Windows, you'll likely want the record separator to be "\n" instead of "\r";

How do people who can't program get by in life? I really don't know what I'd do.

9:36 PM | Comments () | Recommend This | Print This

August 12, 2009

Registration Open for Kynetx Impact Conference

Kynetx Impact 2009

We've opened registration for Kynetx Impact 2009, our developer's conference. You can register here for the event. We've changed the dates to November 18-19th (I previously announced dates in October) to better fit with some other conference schedules. We're charging a small fee to cover food, but if that's problem for you contact me about a scholarship.

Doc Searls will give the opening keynote and Craig Burton will give the closing keynote. Here is a list of topics we'll cover:

  • Building Apps with KRL (Kynetx Rule Language)
  • Advanced Rule Writing
  • Introduction to Action & Information Cards
  • Leveraging Data sets with Kynetx Apps
  • Kynetx Network Services API
  • End points and Context Automation

There will also be a reception, dinner, lunches, and so on. I'm a big believer that a good conference is one with good food. We're holding the conference at the Open Source Technology Center on the Novell Campus in Provo.

We'd love to have you come.

4:01 PM | Comments () | Recommend This | Print This

August 11, 2009

Sweetter in Ubiquity

Kynetx Logo

If you're a Ubiquity user, Mike Grace has created a Ubiquity script to run Sweetter. Note that regardless of whether this is running as a bookmarklet or a Ubiquity script, it's still executing KRL in the cloud which delivers Javascript to the browser. All the bookmarklet or Ubiquity script is doing is planting tags to make the call to KNS.

9:31 AM | Comments () | Recommend This | Print This

August 10, 2009

What are People Tweeting About this Site?

Kynetx Logo

One of the ways that you can use Kynetx rules is to create powerful bookmarklets that modify the current page in some way. In order to demonstrate this, I asked our intern, Jessie Morris, to create a ruleset that displays the last 10 tweets about a Web site. We call this little App "Sweetter."

Sam has already built a feature for generating a bookmarket that is tied to a ruleset into Kynetx AppBuilder, our ruleset building tool. So once you've got a ruleset, creating a bookmarklet is as easy as pushing a button.

To see it in action, just drag this link: Sweetter onto your bookmark toolbar on your browser and then click it. You should see a box appear that looks something like this:

Sweeter screenshot

This works for any site you happen to be on. Just go to the site and click on the bookmark in your toolbar to see what people are saying about that site.

We're making use of Backtweets, a search service that let's you find tweets about, among other things, URLs in the Tweetstream. They have an API that returns JSON, so using them inside the ruleset was as simple as declaring a datasource as follows:

datasource searchBackTweets 
             <- "http://backtweets.com/search.json?key=...&q=" 
                 cachable for 5 minutes;

And then using the datasource to get the data like so:

url = page:env("caller");
domain = url.replace(/http:\/\/([A-Za-z0-9.-]+)\/.*/,"$1");

backTweetsData = datasource:searchBackTweets(domain);
results = backTweetsData.pick("$..totalresults");
tweetImages = backTweetsData.pick("$..tweet_profile_image_url");
tweetUsers = backTweetsData.pick("$..tweet_from_user");
tweetText = backTweetsData.pick("$..tweet_text");

This code gets the domain of the current page, calls the Backtweets datasource with that domain, and then uses the pick operator and JSONPath (think XPath for JSON) to grab relevant data from the results. The rest is just display and is being done with a combination of KRL actions (specifically notify) and some Javascript.

As I mentioned, our intern Jessie--a high school student--built this for me. It took him an hour to get something going that we could see once he found Backtweet and then another day to refine it--most of that was UI work.

Kynetx Apps are deployed using what we call "endpoints" and a bookmarklet is one of the easiest endpoints for users since there's almost nothing to install--just drag a link. Bookmarklet-based Kynetx Apps are great for applications where you want the ruleset to apply across a broad range of Web sites and can--or should--be user activated. Sweetter is a perfect example of that kind of app.

KRL is a great way to build bookmarklet deployed applications because it

  • Provides a nice abstraction for exactly what most people want to do in a bookmarket
  • Overcomes the inherent limitation of bookmarklets (like limitations on length)
  • Allows the bookmarklet to be updated in the cloud without users having to reinstall the bookmarklet

If you're interested in playing with KRL and building Kynetx Apps, you can signup for an account and try it out for free. We'd love to get your feedback.

Note: The API key we're using from Backtweet has a limitation of 1000 calls/day, so if it doesn't give you back results on a site you know has been tweeted, then that's the likely reason. We've asked them to bump up the limit, but haven't heard back from them.

9:45 AM | Comments () | Recommend This | Print This