<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Kynetx App A Day</title>
	<atom:link href="http://kynetxappaday.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kynetxappaday.wordpress.com</link>
	<description>Learning KRL one day at a time</description>
	<lastBuildDate>Mon, 25 Jun 2012 13:47:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kynetxappaday.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Kynetx App A Day</title>
		<link>http://kynetxappaday.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kynetxappaday.wordpress.com/osd.xml" title="Kynetx App A Day" />
	<atom:link rel='hub' href='http://kynetxappaday.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Day 38 &#8211; Evolution Of Advanced Hello World App</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/28/day-38-evolution-of-advanced-hello-world-app/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/28/day-38-evolution-of-advanced-hello-world-app/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 03:54:01 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=494</guid>
		<description><![CDATA[Building just a simple Hello World app in KRL is fairly simple. There are only so many ways to put a notify on the page. Kicking it up a notch and adding in a form and some persistance really opens &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/28/day-38-evolution-of-advanced-hello-world-app/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=494&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Georgia, 'Bitstream Charter', serif;line-height:24px;font-size:16px;">Building just a simple Hello World app in KRL is fairly simple. There are only so many ways to put a notify on the page. Kicking it up a notch and adding in a form and some persistance really opens up the doors to a lot of possibilities and different ways of doing it. I thought it might be interesting to document the evolution as I attempt to create a good advanced Hello World example app for Kynetx.</span></p>
<p><strong>Version 0</strong></p>
<p><pre class="brush: jscript;">ruleset a60x557 {
  meta {
    name &quot;advanced-hello-world&quot;
    description &lt;&lt;
      advanced-hello-world
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  rule plain_krl_way {
    select when pageview &quot;example\.com&quot;
    pre {
      form =&lt;&lt;
        &lt;form id=&quot;my-form&quot;&gt;
          Your Name: &lt;input type=&quot;text&quot; name=&quot;user-name&quot;/&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;/&gt;
        &lt;/form&gt;
      &gt;&gt;;
    }
    {
      notify(&quot;Remembering your name&quot;,form) with sticky = true;
      watch(&quot;#my-form&quot;, &quot;submit&quot;);
    }
  }

  rule get_form {
    select when web submit &quot;#my-form&quot;
    pre {
      userName = event:param(&quot;user-name&quot;);
    }
    {
      notify(&quot;Thanks #{userName}!&quot;,&quot;&quot;) with sticky = true;
    }
  }
}</pre></p>
<ul>
<li>put form on page</li>
<li>watch form</li>
<li>respond to form submit with notify</li>
</ul>
<p>This is super simple but falls short in several areas</p>
<ul>
<li>nothing to let the user know that the server is currently working on processing the form submit</li>
<li>form can be submitted more than once</li>
<li>submitted name isn&#8217;t stored into persistance</li>
<li>interesting but not really useful in my opinion</li>
<li>this isn&#8217;t how I get data out of forms (will show later)</li>
</ul>
<p>Action shots:</p>
<p>running app for first time on example.com</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png"><img class="alignnone size-full wp-image-498" title="Screen shot 2011-01-27 at 5.51.54 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting form first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png"><img class="alignnone size-full wp-image-497" title="Screen shot 2011-01-27 at 5.52.04 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting form as many times as I want</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png"><img class="alignnone size-full wp-image-496" title="Screen shot 2011-01-27 at 5.52.11 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p><strong>Version 1</strong></p>
<p><pre class="brush: jscript;">ruleset a60x557 {
  meta {
    name &quot;advanced-hello-world&quot;
    description &lt;&lt;
      advanced-hello-world
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  rule what_should_i_do {
    select when pageview &quot;example\.com&quot;
    pre {
      userName = ent:userName || &quot;&quot;;
      form =&lt;&lt;
        &lt;form id=&quot;my-form&quot;&gt;
          Your Name: &lt;input type=&quot;text&quot; name=&quot;user-name&quot;/&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;/&gt;
        &lt;/form&gt;
      &gt;&gt;;
    }
    if (userName eq &quot;&quot;) then {
      notify(&quot;Remembering your name&quot;,form) with sticky = true;
      watch(&quot;#my-form&quot;, &quot;submit&quot;);
    }
    notfired {
      raise explicit event user_name_known with userName = userName;
    }
  }

  rule user_name_known {
    select when explicit user_name_known
    pre {
      userName = event:param(&quot;userName&quot;);
    }
    {
      notify(&quot;#{userName} is 'da bomb!&quot;,&quot;&quot;) with sticky = true;
    }
  }

  rule get_form {
    select when web submit &quot;#my-form&quot;
    pre {
      userName = event:param(&quot;user-name&quot;);
    }
    {
      notify(&quot;Thanks #{userName}!&quot;,&quot;&quot;) with sticky = true;
    }
    fired {
      set ent:userName userName;
    }
  }

}</pre></p>
<ul>
<li>14 get user&#8217;s name from persistance and set to blank string if not found</li>
<li>22 if the user&#8217;s name is not found in persistance then put the form up and watch for the form submit</li>
<li>26 if the user&#8217;s name was found in persistance then raise an explicit event to handle user&#8217;s name being found</li>
<li>34 get user&#8217;s name from passed parameters is raised explicit event. Could have just pulled it from persistance but then you wouldn&#8217;t have gotten to see how to pass parameters in explicit events.</li>
<li>50 set the user&#8217;s name into persistance when the rule runs responding to form submit event</li>
</ul>
<p>This example is much better but still leaves a lot out.</p>
<ul>
<li>no form validation</li>
<li>no way for user to change set user name once submitted</li>
<li>still no indication that form submission is &#8216;in progress&#8217;</li>
<li>still able to submit multiple times</li>
</ul>
<p>Action shots:</p>
<p>running app on example.com for the first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png"><img class="alignnone size-full wp-image-498" title="Screen shot 2011-01-27 at 5.51.54 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting form for the first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png"><img class="alignnone size-full wp-image-497" title="Screen shot 2011-01-27 at 5.52.04 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting the form as many times as I want</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png"><img class="alignnone size-full wp-image-496" title="Screen shot 2011-01-27 at 5.52.11 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>After page reload and running app again</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-05-00-pm.png"><img class="alignnone size-full wp-image-500" title="Screen shot 2011-01-27 at 6.05.00 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-05-00-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p><strong>Version 2</strong></p>
<p><pre class="brush: jscript;">ruleset a60x557 {
  meta {
    name &quot;advanced-hello-world&quot;
    description &lt;&lt;
      advanced-hello-world
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  global {
    css &lt;&lt;
      a {
        color: white;
      }
    &gt;&gt;;
  }

  rule what_should_i_do {
    select when pageview &quot;example\.com&quot;
    pre {
      userName = ent:userName || &quot;&quot;;
      form =&lt;&lt;
        &lt;form id=&quot;my-form&quot;&gt;
          Your Name: &lt;input type=&quot;text&quot; name=&quot;user-name&quot;/&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;/&gt;
        &lt;/form&gt;
      &gt;&gt;;
      greeting =&lt;&lt;
        &lt;p&gt;#{userName} is 'da bomb!'&lt;/p&gt;
        &lt;p&gt;Clear saved name by running the app on &lt;a href=&quot;http://example.com/?clear&quot;&gt;example.com/?clear&lt;/a&gt;&lt;/p&gt;
      &gt;&gt;;
      content = (userName eq &quot;&quot;) =&gt; form | greeting;
    }
    {
      notify(&quot;Hello World (advanced)&quot;, content) with sticky = true and opacity = 1;
      watch(&quot;#my-form&quot;, &quot;submit&quot;);
    }
  }

  rule get_form {
    select when web submit &quot;#my-form&quot;
    pre {
      userName = event:param(&quot;user-name&quot;);
    }
    {
      notify(&quot;Thanks #{userName}!&quot;,&quot;&quot;) with sticky = true;
    }
    fired {
      set ent:userName userName;
    }
  }

  rule clearing {
    select when pageview &quot;example\.com\/\?clear&quot;
    notify(&quot;Cleared&quot;,&quot;&quot;);
    fired {
      clear ent:userName;
    }
  }

}</pre></p>
<ul>
<li>12 set CSS so link on black background is visible</li>
<li>29 setup greeting HTML at the same time as the form</li>
<li>33 decide what to put on the page using condition expression</li>
<li>54 clear saved name when user runs on specified clear page</li>
</ul>
<p>This is getting closer but still lacks</p>
<ul>
<li>form validation or disallowing user to submit multiple times</li>
<li>when persistance is cleared the greeting is also displayed</li>
<li>no indication that form submission is &#8216;in progress&#8217;</li>
<li>still not the way I would do it</li>
</ul>
<p>Action Shots:</p>
<p>running app first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-27-pm.png"><img class="alignnone size-full wp-image-507" title="Screen shot 2011-01-27 at 6.33.27 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-27-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting name first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-34-pm.png"><img class="alignnone size-full wp-image-506" title="Screen shot 2011-01-27 at 6.33.34 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-34-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting name many times</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-40-pm.png"><img class="alignnone size-full wp-image-505" title="Screen shot 2011-01-27 at 6.33.40 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-40-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>running app again after refresh of page</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-51-pm.png"><img class="alignnone size-full wp-image-504" title="Screen shot 2011-01-27 at 6.33.51 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-51-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>running app on designated clear page</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-34-05-pm.png"><img class="alignnone size-full wp-image-503" title="Screen shot 2011-01-27 at 6.34.05 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-34-05-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>Version 3</p>
<p><pre class="brush: jscript;">ruleset a60x557 {
  meta {
    name &quot;advanced-hello-world&quot;
    description &lt;&lt;
      advanced-hello-world
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  global {
    css &lt;&lt;
      .kGrowl-notification a {
        color: white;
      }

      #a60x557-working, #a60x557-notice {
        display: none;
      }
    &gt;&gt;;
  }

  rule what_should_i_do {
    select when pageview &quot;example\.com(?!.+clear)&quot;
    pre {
      userName = ent:userName || &quot;&quot;;
      form =&lt;&lt;
        &lt;p id=&quot;a60x557-notice&quot;&gt;Your name input must be more than 2 characters&lt;/p&gt;
        &lt;p id=&quot;a60x557-form&quot;&gt;Your Name: &lt;input type=&quot;text&quot; id=&quot;a60x557-user-name&quot;/&gt; &lt;button id=&quot;a60x557-submit&quot;&gt;Submit&lt;/button&gt;&lt;/p&gt;
        &lt;img id=&quot;a60x557-working&quot; style=&quot;display: none&quot; src=&quot;http://kynetx-apps.s3.amazonaws.com/advanced-hello-world/working.gif&quot;/&gt;
      &gt;&gt;;
      greeting =&lt;&lt;
        &lt;p&gt;#{userName} is 'da bomb!'&lt;/p&gt;
        &lt;p&gt;Clear saved name by running the app on &lt;a href=&quot;http://example.com/?clear&quot;&gt;example.com/?clear&lt;/a&gt;&lt;/p&gt;
      &gt;&gt;;
      content = (userName eq &quot;&quot;) =&gt; form | greeting;
    }
    {
      notify(&quot;Hello World (advanced)&quot;, content) with sticky = true and opacity = 1;
      emit &lt;|
        $K(&quot;#a60x557-submit&quot;).bind(&quot;click&quot;, function() {

          // get user name from input
          var userName = $K(&quot;#a60x557-user-name&quot;).val();

          // check input
          if (userName.length &gt; 2) {
            // don't allow user to submit more than once
            $K(this).unbind(&quot;click&quot;);

            // get app object to raise web event
            app = KOBJ.get_application(&quot;a60x557&quot;);

            // raise web event to system with user name
            app.raise_event(&quot;user_name_submitted&quot;, {&quot;user-name&quot;:userName});

            // show user 'in progress'
            $K(&quot;#a60x557-form,#a60x557-notice&quot;).remove();
            $K(&quot;#a60x557-working&quot;).show();
          } else {
            $K(&quot;#a60x557-notice&quot;).show()
          };
        });
      |&gt;;
    }
  }

  rule get_form {
    select when web user_name_submitted
    pre {
      userName = event:param(&quot;user-name&quot;);
      reset =&lt;&lt;
        &lt;p&gt;Clear saved name by running the app on &lt;a href=&quot;http://example.com/?clear&quot;&gt;example.com/?clear&lt;/a&gt;&lt;/p&gt;
      &gt;&gt;;
    }
    {
      emit &lt;|
        // close previous notify
        $K(&quot;.kGrowl-notification .close&quot;).trigger(&quot;click&quot;);
      |&gt;;
      notify(&quot;Thanks #{userName}!&quot;, reset) with sticky = true and opacity = 1;
    }
    fired {
      set ent:userName userName;
    }
  }

  rule clearing {
    select when pageview &quot;example\.com\/\?clear&quot;
    notify(&quot;The saved name has been cleared&quot;,&quot;&quot;);
    fired {
      clear ent:userName;
    }
  }

}</pre></p>
<ul>
<li>updated CSS to only change links inside the notify</li>
<li>24 don&#8217;t show form/welcome back notify if on the clear page</li>
<li>28 add notice to show if user input doesn&#8217;t match validation rule</li>
<li>30 add working notification image to let user know app is &#8216;in progress&#8217;</li>
<li>41 watch for user to submit form using jquery</li>
<li>47 check user input against validation rule</li>
<li>49 release click listener so form only gets submitted once</li>
<li>52 get application JS object to raise web event</li>
<li>55 raise web event with user&#8217;s name</li>
<li>58 remove form stuff</li>
<li>59 show working spinner image</li>
<li>61 show notice if user&#8217;s input doesn&#8217;t pass input validation</li>
<li>79 close previous notify once saved form returns</li>
</ul>
<p>Now this advanced hello world example app</p>
<ul>
<li>only allows the user to submit name once</li>
<li>allows user to clear set name</li>
<li>better CSS selectors</li>
<li>form validation</li>
<li>in progress visual</li>
<li>stores user&#8217;s name into persistance</li>
<li>this is how I would do it</li>
</ul>
<p>Action shots:</p>
<p>running app first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-21-04-pm.png"><img class="alignnone size-full wp-image-514" title="Screen shot 2011-01-27 at 8.21.04 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-21-04-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>submitting name first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-22-44-pm.png"><img class="alignnone size-full wp-image-513" title="Screen shot 2011-01-27 at 8.22.44 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-22-44-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>name successfully saved</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-23-40-pm.png"><img class="alignnone size-full wp-image-512" title="Screen shot 2011-01-27 at 8.23.40 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-23-40-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>running app again after reload</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-01-pm.png"><img class="alignnone size-full wp-image-511" title="Screen shot 2011-01-27 at 8.24.01 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-01-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<p>running app on designated clear page</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-55-pm.png"><img class="alignnone size-full wp-image-510" title="Screen shot 2011-01-27 at 8.24.55 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-55-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_38_a60x557_dev_bookmarklet.html" target="_blank">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_38_a60x557_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 38 crazy face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-38-crazy-face.jpg" alt="" width="200" height="188" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/494/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/494/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/494/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=494&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/28/day-38-evolution-of-advanced-hello-world-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.51.54 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.52.04 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.52.11 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-51-54-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.51.54 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-04-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.52.04 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-5-52-11-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 5.52.11 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-05-00-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.05.00 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-27-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.33.27 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-34-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.33.34 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-40-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.33.40 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-33-51-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.33.51 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-6-34-05-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 6.34.05 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-21-04-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 8.21.04 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-22-44-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 8.22.44 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-23-40-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 8.23.40 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-01-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 8.24.01 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-8-24-55-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 8.24.55 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-38-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 37 &#8211; Interacting With Youtube Videos</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/27/day-37-interacting-with-youtube-videos/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/27/day-37-interacting-with-youtube-videos/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 10:15:35 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=484</guid>
		<description><![CDATA[Over a year ago, a friend of mine and I were dreaming up of ways to create a cool Kynetx getting started tutorial/demo. One of my ideas was to have a Kynetx app that took you through a few sites &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/27/day-37-interacting-with-youtube-videos/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=484&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over a year ago, a friend of mine and I were dreaming up of ways to create a cool Kynetx getting started tutorial/demo. One of my ideas was to have a Kynetx app that took you through a few sites and showed stuff off while embedding a video on the page and syncing up the actions taken on the page with the video. Now that vision is a reality since <a href="http://code.google.com/apis/youtube/js_api_reference.html">YouTube has a JavaScript API</a> available from their videos. I created a test app to test one aspect of the API and it&#8217;s shockingly simple.<span id="more-484"></span></p>
<p><pre class="brush: jscript;">ruleset a60x556 {
  meta {
    name &quot;youtuber-test&quot;
    description &lt;&lt;
      youtuber-test
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  dispatch {
    domain &quot;youtube.com&quot;
  }

  rule on_video_page {
    select when pageview &quot;\/watch\?&quot;
    {
      notify(&quot;Current Time&quot;,&quot;&lt;h1 id='a60x556-time'&gt;-&lt;/h1&gt;&quot;) with sticky = true;
      emit &lt;|
        KOBJ.a60x556.player = document.getElementById(&quot;movie_player&quot;);
        KOBJ.a60x556.update = function() {
          var current = KOBJ.a60x556.player.getCurrentTime()
          $K(&quot;#a60x556-time&quot;).text(current);
          setTimeout(function() {
            KOBJ.a60x556.update();
          }, 100);
        }

        KOBJ.a60x556.update();
      |&gt;;
    }
  }
}</pre></p>
<ul>
<li>16 only run on youtube pages with a single video loaded on the page. This selection expression is not robust enough to encompass all youtube pages with videos but it&#8217;s good enough for a demo app</li>
<li>18 setup place to put current video time</li>
<li>20 grab reference of embedded object</li>
<li>21 function to got time of video and update to interface. Setting up function reference on the global KOBJ object so I can call it recursively</li>
<li>26 update current time of video every 100 milliseconds. Could have set this lower or higher but this fits this demo well.</li>
<li>29 get the recursive function going</li>
</ul>
<p>App run on youtube.com video using a bookmarklet</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-2-35-06-am.png"><img class="alignnone size-full wp-image-486" title="Screen shot 2011-01-27 at 2.35.06 AM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-2-35-06-am.png?w=640&h=537" alt="" width="640" height="537" /></a></p>
<p>Video Demo</p>
<span style="text-align:center; display: block;"><a href="http://kynetxappaday.wordpress.com/2011/01/27/day-37-interacting-with-youtube-videos/"><img src="http://img.youtube.com/vi/zGAjM6k5JBg/2.jpg" alt="" /></a></span>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_37_a60x556_dev_bookmarklet.html">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_37_a60x556_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 37 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-37-crazy-face.jpg" alt="" width="200" height="179" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=484&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/27/day-37-interacting-with-youtube-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-27-at-2-35-06-am.png" medium="image">
			<media:title type="html">Screen shot 2011-01-27 at 2.35.06 AM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-37-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 36 &#8211; Mime Type For Firefox Extension Auto Install On Download</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/25/day-36-mime-type-for-firefox-extension-auto-install-on-download/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/25/day-36-mime-type-for-firefox-extension-auto-install-on-download/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 01:08:37 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=425</guid>
		<description><![CDATA[My current favorite way to share my Kynetx apps is through Amazon&#8217;s S3. For Firefox to auto detect a Firefox extension and start the installation process, special Mime type headers need to be set. This can now be easily done &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/25/day-36-mime-type-for-firefox-extension-auto-install-on-download/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=425&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My current favorite way to share my Kynetx apps is through Amazon&#8217;s S3. For Firefox to auto detect a Firefox extension and start the installation process,<a href="https://developer.mozilla.org/en/extension_packaging"> special Mime type headers need to be set</a>. This can now be easily done with S3 through the <a href="http://aws.amazon.com/console/">AWS console</a> or through a capable FTP client like <a href="http://cyberduck.ch/">cyberduck</a>.<span id="more-425"></span></p>
<h3>AWS console</h3>
<p>log into console and find extension file</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/logged-in-to-aws-s3-console.png"><img class="alignnone size-full wp-image-426" title="logged-in-to-aws-s3-console" src="http://kynetxappaday.files.wordpress.com/2011/01/logged-in-to-aws-s3-console.png?w=640&h=491" alt="" width="640" height="491" /></a></p>
<p>Right click on file</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-34-pm.png"><img class="alignnone size-full wp-image-427" title="Screen shot 2011-01-24 at 5.22.34 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-34-pm.png?w=640" alt=""   /></a></p>
<p>Set content-type to application/x-xpinstall</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-45-pm.png"><img class="alignnone size-full wp-image-428" title="Screen shot 2011-01-24 at 5.22.45 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-45-pm.png?w=640&h=386" alt="" width="640" height="386" /></a></p>
<h3>Cyberduck</h3>
<p>Find file in cyberduck</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-56-pm.png"><img class="alignnone size-full wp-image-429" title="Screen shot 2011-01-24 at 5.23.56 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-56-pm.png?w=640&h=571" alt="" width="640" height="571" /></a></p>
<p>Right click and select info or be cool and use the keyboard shortcut &#8216;cmd + i&#8217;</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-02-pm.png"><img class="alignnone size-full wp-image-430" title="Screen shot 2011-01-24 at 5.24.02 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-02-pm.png?w=640" alt=""   /></a></p>
<p>Set content-type to application/x-xpinstall in Metadata tab</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-25-pm.png"><img class="alignnone size-full wp-image-431" title="Screen shot 2011-01-24 at 5.24.25 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-25-pm.png?w=640" alt=""   /></a></p>
<h3>Results</h3>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-39-pm.png"><img class="alignnone size-full wp-image-432" title="Screen shot 2011-01-24 at 5.23.39 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-39-pm.png?w=640&h=447" alt="" width="640" height="447" /></a></p>
<p>For Google Chrome extensions, check out the documentation at <a href="//code.google.com/chrome/extensions/hosting.html">http://code.google.com/chrome/extensions/hosting.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/425/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=425&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/25/day-36-mime-type-for-firefox-extension-auto-install-on-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/logged-in-to-aws-s3-console.png" medium="image">
			<media:title type="html">logged-in-to-aws-s3-console</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-34-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.22.34 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-22-45-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.22.45 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-56-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.23.56 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-02-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.24.02 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-24-25-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.24.25 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-24-at-5-23-39-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-24 at 5.23.39 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>Day 35 &#8211; Find And Replace Words In Twitter Tweet Stream</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/21/day-35-find-and-replace-words-in-twitter-tweet-stream/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/21/day-35-find-and-replace-words-in-twitter-tweet-stream/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 05:06:27 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=418</guid>
		<description><![CDATA[I recently built a Kynetx app to remove foul language from my Twitter tweet stream and thought it was interesting enough to share. The code is mostly JavaScript but there are a few concepts that are really good to know &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/21/day-35-find-and-replace-words-in-twitter-tweet-stream/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=418&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently built a Kynetx app to remove foul language from my Twitter tweet stream and thought it was interesting enough to share. The code is mostly JavaScript but there are a few concepts that are really good to know when building a Kynetx app that uses a lot of JavaScript. You can find the original app on my blog over at <a href="http://geek.michaelgrace.org/2011/01/foul-fowl-control-kynetx-app-for-twitter-com/" target="_blank">http://geek.michaelgrace.org/2011/01/foul-fowl-control-kynetx-app-for-twitter-com/<span id="more-418"></span></a></p>
<p><pre class="brush: jscript;">ruleset a60x551 {
  meta {
    name &quot;Foul Fowl Control&quot;
    description &lt;&lt;
      hides foul language in twitter stream
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  dispatch {
    domain &quot;twitter.com&quot;
  }

  rule find_dem_foul_fowls {
    select when pageview &quot;.*&quot;
    {
      emit &lt;|
        // add repeat function to String object
        // http://stackoverflow.com/questions/4549894/how-can-i-repeat-strings-in-javascript
        String.prototype.repeat = function(times) {
           return (new Array(times + 1)).join(this);
        };

        // list of words to find and replace
        // var foulWords = [&quot;it&quot;,&quot;is&quot;,&quot;the&quot;,&quot;on&quot;,&quot;a&quot;,&quot;i&quot;,&quot;of&quot;,&quot;my&quot;,&quot;me&quot;,&quot;for&quot;,&quot;in&quot;,&quot;up&quot;,&quot;and&quot;,&quot;to&quot;,&quot;be&quot;,&quot;that&quot;];

        // build regex to find and replace foul words
        KOBJ.a60x550.theReplacer = new RegExp('\\b('+foulWords.join('|')+')\\b','gi');

        // attatch function to global KOBJ object so it's callable outside of closure
        KOBJ.a60x550.findFoulFowls = function() {

          // process tweets not marked as processed
          $(&quot;.stream-item:not(.defouled)&quot;).each(function(index, element) {

            // mark as processed and cache object
            var $current = $K(element).addClass(&quot;defouled&quot;);

            // get text of tweet
            var $tweet = $current.find(&quot;.tweet-text&quot;);
            var tweet = $tweet.text();

            // clean it up!
            var needsCleaning = false;
            var cleanTweet = tweet.replace(KOBJ.a60x550.theReplacer, function(match) {
              needsCleaning = true;
              return &quot;*&quot;.repeat(match.length);
            });

            // only write back to the DOM if the tweet was changed because DOM access is expen$ive!
            if (needsCleaning) {
              $tweet.text(cleanTweet);
            };

          }); // end of each

          setTimeout(function() {
            KOBJ.a60x550.findFoulFowls();
          }, 1000);
        };

        KOBJ.a60x550.findFoulFowls();
      |&gt;;
    }
  }
}</pre></p>
<p>The code is fairly well commented so I&#8217;ll just point out one thing. Because I am using a setTimout function to recursively call the function that looks for new tweets, I needed to attach the function to the global KOBJ object. This is because the emitted JavaScript gets executed inside a closure and won&#8217;t be accessible from outside the closure.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/418/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/418/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/418/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=418&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/21/day-35-find-and-replace-words-in-twitter-tweet-stream/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>
	</item>
		<item>
		<title>Day 34 &#8211; Dynamically Picking From Hash</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/18/day-34-dynamically-picking-from-hash/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/18/day-34-dynamically-picking-from-hash/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 19:18:45 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=409</guid>
		<description><![CDATA[Sometimes I don&#8217;t want to statically pick from a dataset or a hash. Sometimes I want to dynamically pick from a hash or dataset based on a condition and I can do that by using a beesting in a pick &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/18/day-34-dynamically-picking-from-hash/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=409&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes I don&#8217;t want to statically pick from a dataset or a hash. Sometimes I want to dynamically pick from a hash or dataset based on a condition and I can do that by using a beesting in a pick statement.<span id="more-409"></span></p>
<p><pre class="brush: jscript;">ruleset a60x545 {
  meta {
    name &quot;beesting-in-pick&quot;
    description &lt;&lt;
      beesting-in-pick
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  rule test_pick {
    select when pageview &quot;.*&quot;
    pre {
      r = math:random(2);
      pleasePick = (r == 0) =&gt; &quot;userName&quot; | &quot;cool&quot;;
      myHash = {
        &quot;userName&quot;:&quot;mike&quot;,
        &quot;cool&quot;:&quot;yes&quot;
      };
      picked = myHash.pick(&quot;$.#{pleasePick}&quot;);
    }
    {
      notify(&quot;picked&quot;,&quot;Picked with: #{pleasePick}&lt;br/&gt;Picked value: #{picked}&quot;) with sticky = true;
    }
  }
}</pre></p>
<ul>
<li>14 get random number to simulate picking based on condition</li>
<li>15 set pick based on random based condition</li>
<li>20 get value from pick statement</li>
</ul>
<p>App run several times in a row on example.com with a bookmarklet</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-17-at-12-03-13-pm.png"><img class="alignnone size-full wp-image-411" title="Screen shot 2011-01-17 at 12.03.13 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-17-at-12-03-13-pm.png?w=640&h=482" alt="" width="640" height="482" /></a></p>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_34_a60x545_dev_bookmarklet.html">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_34_a60x545_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 34 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-34-crazy-face.jpg" alt="" width="200" height="177" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/409/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/409/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/409/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=409&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/18/day-34-dynamically-picking-from-hash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-17-at-12-03-13-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-17 at 12.03.13 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-34-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 33 &#8211; First Time App Is Run For The Day</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/13/day-33-first-time-app-is-run-for-the-day/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/13/day-33-first-time-app-is-run-for-the-day/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 05:59:45 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=400</guid>
		<description><![CDATA[Sometimes you need to know the first time each individual user runs the app for the day. Sometimes you need to know the first time a user runs the app for the day. Well&#8230; here is one way to do &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/13/day-33-first-time-app-is-run-for-the-day/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=400&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to know the first time each individual user runs the app for the day. Sometimes you need to know the first time a user runs the app for the day. Well&#8230; here is one way to do both.<span id="more-400"></span></p>
<p><pre class="brush: jscript;">ruleset a60x541 {
  meta {
    name &quot;new-day-test&quot;
    description &lt;&lt;
      for when you want to run a rule only once on a new day.
      ie. a (script like) rule to clean up or prep for new day.
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  rule check_the_day_for_a_single_user {
    select when pageview &quot;.*&quot;
    pre {
      today = time:strftime(time:now({&quot;tz&quot;:&quot;America/Denver&quot;}), &quot;%d&quot;);
      savedDay = ent:savedDay || 0;
    }
    if (today != savedDay) then {
      noop();
    }
    fired {
      raise explicit event new_day_for_user;
      set ent:savedDay today;
    } else {
      raise explicit event same_day_for_user;
    }
  }

  rule its_a_new_day {
    select when explicit new_day_for_user
    {
      notify(&quot;Hey!&quot;,&quot;It's a new day!&quot;) with sticky = true;
    }
  }

  rule same_day {
    select when explicit same_day_for_user
    {
      notify(&quot;Hello again&quot;,&quot;Looks like it is still the same day&quot;) with sticky = true;
    }
  }

  rule check_the_day_for_app {
    select when pageview &quot;.*&quot;
    pre {
      today = time:strftime(time:now({&quot;tz&quot;:&quot;America/Denver&quot;}), &quot;%d&quot;);
      savedDay = app:savedDay || 0;
    }
    if (today != savedDay) then {
      noop();
    }
    fired {
      raise explicit event new_day_for_app;
      set app:savedDay today;
    } else {
      raise explicit event same_day_for_app;
    }
  }

  rule its_a_new_day_for_app {
    select when explicit new_day_for_app
    {
      notify(&quot;App: Hey!&quot;,&quot;It's a new day!&quot;) with sticky = true;
    }
  }

  rule same_day_for_app {
    select when explicit same_day_for_app
    {
      notify(&quot;App: Hello again&quot;,&quot;Looks like it is still the same day&quot;) with sticky = true;
    }
  }

}</pre></p>
<ul>
<li>12 checking to see if it is a new day for each individual user</li>
<li>15 get current day</li>
<li>16 get the saved day from last time it was run or set to &#8217;0&#8242; if not yet set</li>
<li>18 executed action block if it&#8217;s a new day</li>
<li>22 raise event for new day rules</li>
<li>23 save todays date as the saved day so we know while it is still the same day</li>
<li>25 raise event for same day rules if it is still the same day</li>
<li>43-58 do the same thing but only raise the event for the first user that runs it on the new day using app variables instead of entity variables</li>
</ul>
<p>App run on example.com using bookmarklet for the first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-09-pm.png"><img class="alignnone size-full wp-image-402" title="Screen shot 2011-01-12 at 10.06.09 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-09-pm.png?w=640&h=462" alt="" width="640" height="462" /></a></p>
<p>App run on example.com using bookmarklet for the second time within seconds of running it the first time</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-21-pm.png"><img class="alignnone size-full wp-image-403" title="Screen shot 2011-01-12 at 10.06.21 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-21-pm.png?w=640&h=462" alt="" width="640" height="462" /></a></p>
<p>App run on example.com using bookmarklet for the first time in a different browser</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-58-12-pm.png"><img class="alignnone size-full wp-image-405" title="Screen shot 2011-01-12 at 10.58.12 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-58-12-pm.png?w=640&h=433" alt="" width="640" height="433" /></a></p>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_33_a60x542_dev_bookmarklet.html" target="_blank">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_33_a60x542_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 33 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-33-crazy-face.jpg" alt="" width="200" height="183" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/400/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=400&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/13/day-33-first-time-app-is-run-for-the-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-09-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-12 at 10.06.09 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-06-21-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-12 at 10.06.21 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-10-58-12-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-12 at 10.58.12 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-33-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 32 &#8211; Old School Twitter Retweet</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/13/day-32-old-school-twitter-retweet/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/13/day-32-old-school-twitter-retweet/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 04:26:38 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=393</guid>
		<description><![CDATA[Modify the Twitter web interface to provide the old school &#8220;RT&#8221; functionality that many other Twitter clients provide. 38 html to emulate same style/layout as other twitter action buttons 43 add the RT button when a user mouses over a &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/13/day-32-old-school-twitter-retweet/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=393&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Modify the Twitter web interface to provide the old school &#8220;RT&#8221; functionality that many other Twitter clients provide.<span id="more-393"></span></p>
<p><pre class="brush: jscript;">ruleset a60x532 {
  meta {
    name &quot;old-school-retweet&quot;
    description &lt;&lt;
      old-school-retweet
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  dispatch {
    domain &quot;twitter.com&quot;
  }

  global {
    css &lt;&lt;
      .old-school-enabled .old-school-rt {
         background: url(&quot;http://a2.twimg.com/a/1294279085/phoenix/img/sprite-icons.png&quot;) no-repeat scroll 0 0 transparent;
         background-position: -176px 0;
         display: inline-block;
         margin-bottom: -3px;
         margin-right: 3px;
         position: relative;
         vertical-align: baseline;
         height: 12px;
         margin: 0 2px;
         outline: medium none;
         text-indent: -99999px;
         width: 15px;
      }
    &gt;&gt;;
  }

  rule twitter_page_loaded {
    select when pageview &quot;twitter\.com&quot;
    pre {
      oldSchool =&lt;&lt;
        &lt;a class=&quot;old-school-retweet-action&quot; href=&quot;#&quot;&gt;&lt;span&gt;&lt;span class=&quot;old-school-rt&quot;&gt;&lt;/span&gt;&lt;b&gt;RT&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;
      &gt;&gt;;
    }
    {
      emit &lt;|
        $K(&quot;.stream-item&quot;).live(&quot;mouseenter&quot;, function() {
          var $tweet = $K(this);
          if ( $tweet.hasClass(&quot;old-school-enabled&quot;) == false ) {
            $tweet.addClass(&quot;old-school-enabled&quot;).find(&quot;.tweet-actions&quot;).append(oldSchool);

            $tweet.find(&quot;.old-school-retweet-action&quot;).click(function() {
              var tweet = $K(this).parents(&quot;.tweet-content&quot;).find(&quot;.tweet-text&quot;).text();
              var name = $K(this).parents(&quot;.tweet-content&quot;).find(&quot;.tweet-screen-name&quot;).text();
              var retweet = &quot;RT @&quot;+name+&quot; &quot;+tweet;
              $(&quot;#new-tweet&quot;).trigger(&quot;click&quot;);
              $K(&quot;.draggable textarea.twitter-anywhere-tweet-box-editor&quot;).val(retweet).focus();
              $K(&quot;#tweet_dialog a.tweet-button.button.disabled&quot;).removeClass(&quot;disabled&quot;);
            });
          };
        });
      |&gt;;
    }
  }
}</pre></p>
<ul>
<li>38 html to emulate same style/layout as other twitter action buttons</li>
<li>43 add the RT button when a user mouses over a tweet</li>
<li>45 only add the button if it hasn&#8217;t already been done</li>
<li>48 bind click handler to newly added RT button</li>
<li>49 get the tweet text when the RT button is clicked</li>
<li>50 get the username of the tweeter the tweet came from</li>
<li>51 build new tweet in RT style</li>
<li>52 use Twitter&#8217;s jquery to trigger a click on the new tweet button</li>
<li>53 put the cursor in the tweet box and put the RT in the box</li>
<li>54 enable the tweet button so user doesn&#8217;t have to type before being allowed to tweet</li>
</ul>
<p>Tweet moused over after running app on Twitter.com as a Chrome extension</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-9-21-43-pm.png"><img class="alignnone size-full wp-image-395" title="Screen shot 2011-01-12 at 9.21.43 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-9-21-43-pm.png?w=640" alt=""   /></a></p>
<h2><a href="http://geek.michaelgrace.org/2011/01/old-school-style-retweets-via-kynetx-app/">Get the extension to try it out yourself! (Chrome / Firefox / IE)</a></h2>
<p>Gratuitous day 32 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-32-crazy-face.jpg" alt="" width="200" height="133" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=393&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/13/day-32-old-school-twitter-retweet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-12-at-9-21-43-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-12 at 9.21.43 PM</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-32-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 31 &#8211; Load Stuff Inline In Twitter Stream</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/12/day-31-load-stuff-inline-in-twitter-stream/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/12/day-31-load-stuff-inline-in-twitter-stream/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 20:46:36 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=380</guid>
		<description><![CDATA[Want to customize what can load inline on Twitter&#8217;s tweet stream interface? Here is how I built a Kynetx app to load XKCD comics inline when a user clicks on a tweet with a link to an XKCD comic. 12 &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/12/day-31-load-stuff-inline-in-twitter-stream/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=380&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Want to customize what can load inline on Twitter&#8217;s tweet stream interface? Here is how I built a Kynetx app to load XKCD comics inline when a user clicks on a tweet with a link to an XKCD comic.<span id="more-380"></span></p>
<p><pre class="brush: jscript;">ruleset a60x531 {
  meta {
    name &quot;xkcd-on-twitter&quot;
    description &lt;&lt;
      xkcd-on-twitter
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  dispatch {
    domain &quot;twitter.com&quot;
  }

  global {
    datasource xkcd:HTML &lt;- &quot;http://xkcd.com/&quot;;

    css &lt;&lt;
      div.xkcd-loaded-via-kynetx img {
        max-width: 445px;
      }
    &gt;&gt;;
  }

  rule starting {
    select when pageview &quot;twitter\.com&quot;
    {
      emit &lt;|
        $K(&quot;.stream-item&quot;).live(&quot;click&quot;,
        function() {
            var clicked = this;
            var attempts = 0;
            var found = false;
            if ($K(clicked).attr(&quot;processed&quot;) != &quot;true&quot;) {
                $K(clicked).attr(&quot;processed&quot;, &quot;true&quot;);
                var itemId = $K(clicked).attr(&quot;data-item-id&quot;);
                var interval = setInterval(function() {
                    if ((attempts &gt; 6) || (found == true)) {
                        clearInterval(interval);
                    } else {
                        attempts = attempts + 1;
                        found = ($K(&quot;div.tweet.details-pane-tweet[data-tweet-id='&quot; + itemId + &quot;']&quot;).length != 0) ? true: false;
                        if (found) {
                            app = KOBJ.get_application(&quot;a60x531&quot;);
                            var $links = $K(clicked).find(&quot;div.tweet-text a.twitter-timeline-link&quot;);
                            $links.each(function(index, element) {
                                var url = $K(element).text();
                                if (url.match(/xkcd\.com/gi)) {
                                  $K(&quot;&lt;img class='kynetx-working' src='http://kynetx-apps.s3.amazonaws.com/super-skitch/working.gif'/&gt;&quot;).hide().css({
                                      &quot;position&quot;: &quot;absolute&quot;,
                                      &quot;right&quot;: &quot;10px&quot;,
                                      &quot;top&quot;: &quot;10px&quot;
                                  }).appendTo(&quot;div.tweet.details-pane-tweet[data-tweet-id='&quot; + itemId + &quot;']&quot;).fadeIn(&quot;slow&quot;);
                                  app.raise_event(&quot;xkcd&quot;, {
                                      &quot;url&quot;: url,
                                      &quot;itemId&quot;: itemId
                                  });
                                };
                            });
                        };
                    };
                },
                500);
            };
        });

      |&gt;;
    }
  }

  rule get_image_from_mini_link {
    select when web xkcd
    pre {
      url = event:param(&quot;url&quot;);
      itemId = event:param(&quot;itemId&quot;);
      target = &quot;div.tweet.details-pane-tweet[data-tweet-id='#{itemId}']&quot;;
      pathBeta = url.replace(re/http:\/\/xkcd\.com(\/.*)/,&quot;$1&quot;);
      path = pathBeta.replace(re/xkcd\.com(\/.*)/,&quot;$1&quot;);
      page = datasource:xkcd(path);
      middleContent = page.query(&quot;#middleContent&quot;);
      title = middleContent.query(&quot;h1&quot;);
      images = middleContent.query(&quot;img&quot;);
      image = images[0];
      returnHtml =&lt;&lt;
        &lt;div class=&quot;xkcd-loaded-via-kynetx&quot;&gt;
          #{title}
          #{image}
        &lt;/div&gt;
      &gt;&gt;;
    }
    {
      emit &lt;|
        $K(target).find(&quot;.kynetx-working&quot;).fadeOut();
        $K('&lt;div&gt;'+returnHtml+'&lt;/div&gt;').hide().appendTo(target).fadeIn();
      |&gt;;
    }
  }
}</pre></p>
<ul>
<li>12 deployed as a browser extension so only check select statements on twitter.com</li>
<li>16 going to query the XKCD site as an HTML datasource and grab the image and title</li>
<li>18-22 make sure comic fits within meta tray of Twitter</li>
<li>34 only process clicked tweet if not already previously processed to prevent duplication</li>
<li>35 mark tweet as processed</li>
<li>36 data-item-id required to find correct meta tray to load comic in</li>
<li>37 use setInterval to wait for the  meta tray to load since it is not immediate</li>
<li>38-39 clear interval if we&#8217;ve waiter longer than 3 seconds or if the tray loaded</li>
<li>42 look for correct meta tray to be loaded</li>
<li>45 get link from tweet that was clicked on</li>
<li>46 go through each tweet</li>
<li>48 if the url found in the tweet is a link to an xkcd comic then lets raise an event to KNS with the link</li>
<li>49-53 show user spinner to let them know the app is working</li>
<li>54 raise event</li>
</ul>
<ul>
<li>72 when an event is raised with xkcd link in tweet</li>
<li>77 get path portion of url extracted</li>
<li>78 extract path from url&#8217;s that didn&#8217;t have &#8216;http&#8217; prepended</li>
<li>79 get contents of xkcd comic page</li>
<li>80 filter through html of xkcd page and grab html with id of middleContent</li>
<li>81 grab title of comic</li>
<li>82 grab all the images which happens to be just one but query returns an array</li>
<li>83 get first image in array</li>
<li>93 fadeout working spinning gif to let user know the app is done working</li>
<li>94 append the comic into the meta tray of Twitter interface</li>
</ul>
<p>Tweet with xkcd link clicked on after running app on Twitter.com as a Chrome extension</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-1-37-20-pm.png"><img class="alignnone size-full wp-image-386" title="Screen shot 2011-01-11 at 1.37.20 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-1-37-20-pm.png?w=640&h=594" alt="" width="640" height="594" /></a></p>
<h2><a href="http://geek.michaelgrace.org/2011/01/load-xkcd-inline-on-twitter/">Get the extension to try it out yourself! (Chrome / Firefox)</a></h2>
<p>Gratuitous day 31 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-31-crazy-face.jpg" alt="" width="200" height="234" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/380/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/380/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/380/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=380&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/12/day-31-load-stuff-inline-in-twitter-stream/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-11-at-1-37-20-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-11 at 1.37.20 PM</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-31-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 30 &#8211; Detecting Empty Pick</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/04/day-30-detecting-empty-pick/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/04/day-30-detecting-empty-pick/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 23:15:19 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=373</guid>
		<description><![CDATA[Many times I need to be able to know if my pick statement returns nothing or something so I can react differently. I finally figured out a good way to do this. 12-23 hash to pick from 29 iterate through &#8230; <a href="http://kynetxappaday.wordpress.com/2011/01/04/day-30-detecting-empty-pick/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=373&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many times I need to be able to know if my pick statement returns nothing or something so I can react differently. I finally figured out a good way to do this.<span id="more-373"></span></p>
<p><pre class="brush: jscript;">ruleset a60x526 {
  meta {
    name &quot;hash-pick-detect&quot;
    description &lt;&lt;
      hash-pick-detect
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  global {
    dataHash = {
      &quot;one&quot;: {
        &quot;name&quot;: &quot;Mike&quot;
      }, // number
      &quot;two&quot;: {
        &quot;random&quot;: 8
      }, // number
      &quot;three&quot;: {
        &quot;name&quot;: &quot;Alex&quot;
      } // number

    }; // dataHash

  } // global

  rule detect_the_pick {
    select when pageview &quot;.*&quot;
    foreach dataHash setting (key, value)
    pre {
      userName = value.pick(&quot;$.name&quot;, true);
      length = userName.length();
    }
    if (length &gt; 0) then {
      notify(&quot;Key: #{key}&quot;,&quot;Name: #{userName}&lt;br/&gt;Length: #{length}&quot;) with sticky = true;
    }
    notfired {
      raise explicit event empty_pick
        with pickedKey = key;
    }
  }

  rule empty_pick_found {
    select when explicit empty_pick
    pre {
      pickedKey = event:param(&quot;pickedKey&quot;);
      results =&lt;&lt;
        Key: #{pickedKey}&lt;br/&gt;
        doesn't have a name associated with it to pick from
      &gt;&gt;; //' fixing syntax highlighting
    }
    {
      notify(&quot;An empty pick was detected&quot;,results) with sticky = true;
    }
  }
}</pre></p>
<ul>
<li>12-23 hash to pick from</li>
<li>29 iterate through top level hash elements</li>
<li>31 pick name from hash element and ALWAYS return results in an array &#8211; second optional parameter of pick tells it to always return an array</li>
<li>32 get length of array returned from pick</li>
<li>34 if the length is greater than 0 then we know it found something to pick from the hash</li>
<li>37 if the action block didn&#8217;t fire because data wasn&#8217;t found to pick then raise explicit event to process that situation</li>
</ul>
<p>App run on example.com with bookmarklet</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-3-49-59-pm.png"><img class="alignnone size-full wp-image-375" title="Screen shot 2011-01-03 at 3.49.59 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-3-49-59-pm.png?w=640" alt=""   /></a></p>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_30_a60x526_dev_bookmarklet.html" target="_blank">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_30_a60x526_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 30 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-30-crazy-face.jpg" alt="" width="400" height="237" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=373&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/04/day-30-detecting-empty-pick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-3-49-59-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-03 at 3.49.59 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-30-crazy-face.jpg" medium="image" />
	</item>
		<item>
		<title>Day 29 &#8211; URL Encode Strings</title>
		<link>http://kynetxappaday.wordpress.com/2011/01/04/day-29-url-encode-strings/</link>
		<comments>http://kynetxappaday.wordpress.com/2011/01/04/day-29-url-encode-strings/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 21:25:49 +0000</pubDate>
		<dc:creator>Mike Grace</dc:creator>
				<category><![CDATA[Kynetx]]></category>

		<guid isPermaLink="false">http://kynetxappaday.wordpress.com/?p=366</guid>
		<description><![CDATA[For those late evenings when you just need a good cold URL encoded string&#8230;. 11 movie reference App run on example.com with bookmarklet Get the bookmarklet to try it out yourself! Gratuitous day 29 Grace face<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=366&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those late evenings when you just need a good cold URL encoded string&#8230;.<span id="more-366"></span></p>
<p><pre class="brush: jscript;">ruleset a60x525 {
  meta {
    name &quot;uri-escape&quot;
    description &lt;&lt;
      uri-escape
    &gt;&gt;
    author &quot;Mike Grace&quot;
    logging on
  }

  rule ehskahpeh {
    select when pageview &quot;.*&quot;
    pre {
      restfulYql = &quot;http://query.yahooapis.com/v1/public/yql?q=&quot;;
      queryStatement = &quot;select * from html where url='www.kynetx.com'&quot;;
      finalThingy = restfulYql + uri:escape(queryStatement);
      appender =&lt;&lt;
        &lt;h1&gt;#{finalThingy}&lt;/h1&gt;
      &gt;&gt;;
    }
    {
      append(&quot;body&quot;, appender);
    }
  }
}</pre></p>
<ul>
<li>11 movie reference</li>
</ul>
<p>App run on example.com with bookmarklet</p>
<p><a href="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-1-28-15-pm.png"><img class="alignnone size-full wp-image-368" title="Screen shot 2011-01-03 at 1.28.15 PM" src="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-1-28-15-pm.png?w=640&h=344" alt="" width="640" height="344" /></a></p>
<h2><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_29_a60x525_dev_bookmarklet.html" target="_blank">Get the bookmarklet to try it out yourself!</a></h2>
<p><a href="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day_29_a60x525_dev_bookmarklet.html" target="_blank"><img title="bookmarklet" src="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&amp;h=128&h=128" alt="" width="128" height="128" /></a></p>
<p>Gratuitous day 29 Grace face</p>
<p><img class="alignnone" src="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-29-crazy-face.jpg" alt="" width="150" height="141" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kynetxappaday.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kynetxappaday.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kynetxappaday.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kynetxappaday.wordpress.com&#038;blog=18336500&#038;post=366&#038;subd=kynetxappaday&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kynetxappaday.wordpress.com/2011/01/04/day-29-url-encode-strings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/894b3a322869ed08bff2fc51f5c797d6?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">themikegrace</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2011/01/screen-shot-2011-01-03-at-1-28-15-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-01-03 at 1.28.15 PM</media:title>
		</media:content>

		<media:content url="http://kynetxappaday.files.wordpress.com/2010/12/1292053223_default-icon.png?w=128&#38;h=128&#38;h=128" medium="image">
			<media:title type="html">bookmarklet</media:title>
		</media:content>

		<media:content url="http://mikegrace.s3.amazonaws.com/kynetx-app-a-day/day-29-crazy-face.jpg" medium="image" />
	</item>
	</channel>
</rss>