<?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/"
	>

<channel>
	<title>GissiSim.com &#187; Labs</title>
	<atom:link href="http://www.gissisim.com/category/labs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gissisim.com</link>
	<description>Gissur Simonarson Online</description>
	<lastBuildDate>Sun, 20 Jun 2010 18:36:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Analytics Advanced Segments</title>
		<link>http://www.gissisim.com/2009/11/03/google-analytics-advanced-segments/</link>
		<comments>http://www.gissisim.com/2009/11/03/google-analytics-advanced-segments/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 14:53:29 +0000</pubDate>
		<dc:creator>GissiSim</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[Advanced Segments]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Google Analytics]]></category>

		<guid isPermaLink="false">http://www.gissisim.com/?p=416</guid>
		<description><![CDATA[I just wanted to put up a few examples of how I am using Google Analytics Advanced Segment creator. I will be following up with more articles on how to do more cool things with Advanced Segments, Custom Reports, Intelligence Alerts, and even some of the Google API calls. Here is a great way to [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop">I</span> just wanted to put up a few examples of how I am using Google Analytics Advanced Segment creator. I will be following up with more articles on how to do more cool things with Advanced Segments, Custom Reports, Intelligence Alerts, and even some of the Google API calls.</p>
<p>Here is a great way to create a Advanced Segment to see how much traffic you&#8217;re getting from your social media sites such as Twitter.com, Digg.com etc etc etc.</p>
<h3>Social Media Advanced Segment</h3>
<ol>
<li>Go to <strong>Advanced Segments</strong> on the left column.</li>
<li>Click <strong>&#8216;Create new custom segment&#8217;</strong></li>
<li>Under Dimensions find <strong>Source, </strong>drag it over to where it says Dimensions or Metrics</li>
<li>Then you will see <strong>Condition</strong>, select <strong>&#8216;Matches Regular Expression&#8217;</strong></li>
<li>Here you list your social networks as a regular expression. Here is what I have: <strong>facebook\.com|twitter\.com|flickr\.com|youtube\.com|digg\.com<br />
|bx\.businessweek\.com|delicious\.com|stumbleupon\.com</strong></li>
<li>At the bottom give it a name.</li>
<li>Now you can test it to see if it works, once thats done hit <strong>&#8216;Create Segment&#8217;</strong></li>
</ol>
<p style="text-align: center;"><strong><a href="http://www.gissisim.com/wp-content/uploads/2009/11/GissiSim_Creating_Advanced_Segment1.png"><img class="size-large wp-image-419 aligncenter" title="GissiSim Creating Advanced Segment for Social Media" src="http://www.gissisim.com/wp-content/uploads/2009/11/GissiSim_Creating_Advanced_Segment1-1024x459.png" alt="GissiSim Creating Advanced Segment for Social Media" width="531" height="238" /></a><br />
</strong></p>
<p>Please know that you can click on the images to get a their full size counterpart.</p>
<p>Then we go and put it into action in the Dashboard. Here I will just show you a picture how how you do it. Pretty self explanatory.
</p>
<p style="text-align: center;"><a href="http://www.gissisim.com/wp-content/uploads/2009/11/GissiSim_Creating_Advanced_Segment_In_Action.png"><img class="size-full wp-image-425   aligncenter" title="GissiSim Creating Advanced Segment In Action" src="http://www.gissisim.com/wp-content/uploads/2009/11/GissiSim_Creating_Advanced_Segment_In_Action.png" alt="Click for larger image" width="512" height="307" /></a></p>
<p style="text-align: left;">Like I said this is just the start. I will be writing more articles with more intense use of these new features. I just wanted to give a quick simple example to get you&#8217;re ideas popping. There are of course some more ways I use this, to see what News Sources are linking to my webpage. So maybe <strong>cnn\.com|bbc\.co\.uk</strong> etc etc.</p>
<p style="text-align: left;">As you can see there are endless possibilities, and these are the tools that the company I work for ( <a title="Skyrr - Velkomin" href="http://www.skyrr.is" target="_blank">Skyrr</a> ) uses to help our clients archive the goal for their Web Site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gissisim.com/2009/11/03/google-analytics-advanced-segments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Live jQuery Twitter feed</title>
		<link>http://www.gissisim.com/2009/03/13/live-jquery-twitter-feed/</link>
		<comments>http://www.gissisim.com/2009/03/13/live-jquery-twitter-feed/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 12:41:42 +0000</pubDate>
		<dc:creator>GissiSim</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.gissisim.com/?p=310</guid>
		<description><![CDATA[As many of you that read my blog already know, I am in love with twitter. It has opened up a world for me that I just didn&#8217;t know existed, really given me the love I once had for the internet back. Since I&#8217;ve gotten so much from it, I&#8217;ve decided to give something back [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop">A</span>s many of you that read my blog already know, I am in love with twitter. It has opened up a world for me that I just didn&#8217;t know existed, really given me the love I once had for the internet back. Since I&#8217;ve gotten so much from it, I&#8217;ve decided to give something back to the community. Since not everyone is a big coder, I want to give those of you that want a live twitter feed on your page the code to accomplish that.</p>
<p>Please feel free to use this code for your own personal use. However if you want to sell this or use it on a corporate site, please talk to me for permission. Also if you guys want to give me some expert tips on how to make things better in the code, please comment on what can be changed or added! Thank you.</p>
<p>Link straight to <strong><a title="Example jQuery Twitter Feed" href="http://icetweet.gissisim.com">example</a></strong>.</p>
<h2>The Code</h2>
<pre>&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;
      $(
          function()
          {
              setInterval("getSearch()",10000);
          getSearch();

          }
      );

    TwitterCache = {};

  function getSearch()
  {

            var url = "http://search.twitter.com/search.json?q=%22in+love%22&amp;callback=?";
            // Change %22in+love%22 to your search. %22 is a qoute
            $.getJSON
            (
                url,
            function(data)
            {
                if( data.results ) // Checks to see if you have any new tweets
                {
                    var i = -1, result, HTML='', HTML2='';
                    while( (result = data.results[++i]) &amp;&amp; !TwitterCache[result.id] )
                    {
                        TwitterCache[result.id] = result.from_user;
                        HTML += '&lt;li id="TwitterId'+ result.id +'"&gt;&lt;img src="' +
                        result['profile_image_url']+'" alt="Profile Image" /&gt;
                        &lt;strong class="User"&gt;'+ result.from_user + '&lt;/strong&gt;' +
                        FormatIt(result.text) + ' &lt;span class="created_at"&gt;' +
                        relative_time(result.created_at) + '&lt;/span&gt; via ' +
                        linkup(result.source) + '&lt;/li&gt;';

                    }
                    if( HTML !== '' )
                        $("#tweets ul").prepend( HTML ).find('li:hidden').slideToggle('slow');

                    $("li:gt(14)").remove(); // Removes everything past the 15th tweet

                    $("li:even").css  // Simple Styling of the boxes START
                        ({
                            "background": "#DFDFDF",
                            "border-color": "#DFDFDF",
                            "border-style": "solid",
                            "border-width": "2px"
                        });
                    $("li:odd").css
                        ({
                            "background": "grey",
                            "border-color": "grey",
                            "border-style": "solid",
                            "border-width": "2px"
                        });
                    $("li").hover(
                      function () {
                        $(this).addClass("hover");
                        $(this).animate({
                            opacity: 1.0
                            }, 10);

                      },
                      function () {
                        $(this).removeClass("hover");
                        $(this).animate({
                            opacity: 0.2
                            }, 10);
                      }
                    ); // STYLING ENDS

                }
            }
        )

  }

    function FormatIt(text_results)  // Formats the text. Makes In Love become bold
    {
        text_results = text_results.replace(/(in love)/ig,
        '&lt;strong class="inlove"&gt;$1&lt;/strong&gt;');
        return text_results.linkify();
    }

    function linkup(link) // Makes the links linkable
    {
        link = link.replace('&amp;lt;a href=&amp;quot;','&lt;a href="');
        link = link.replace('&amp;quot;&amp;gt;','"&gt;');
        link = link.replace('&amp;lt;/a&amp;gt;','&lt;/a&gt;');
        return link;
    }

      String.prototype.linkify = function() {  //Also makes links linkable
            return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&amp;\?\/~.=]+/,
            function(m) {
        return m.link(m);
      });
    };

  function relative_time(time_value) { //Makes the time thing happen
        var values = time_value.split(" ");
        time_value = values[2] + " " + values[1] + ", " + values[3] + " " + values[4];
        var parsed_date = Date.parse(time_value);
        var relative_to = (arguments.length &gt; 1) ? arguments[1] : new Date();
        var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
        delta = delta + (relative_to.getTimezoneOffset() * 60);

        var r = '';
        if (delta &lt; 60) {
          r = 'a minute ago';
        } else if(delta &lt; 120) {
          r = 'couple of minutes ago';
        } else if(delta &lt; (45*60)) {
          r = (parseInt(delta / 60)).toString() + ' minutes ago';
        } else if(delta &lt; (90*60)) {
          r = 'an hour ago';
        } else if(delta &lt; (24*60*60)) {
          r = '' + (parseInt(delta / 3600)).toString() + ' hours ago';
        } else if(delta &lt; (48*60*60)) {
          r = '1 day ago';
        } else {
          r = (parseInt(delta / 86400)).toString() + ' days ago';
        }

        return r;
}
function twitter_callback ()
{
      return true;
}

&lt;/<span class="end-tag">script</span>&gt;</pre>
<h2>The Example</h2>
<p>This is probably the best way to see how you should make this work. Just look at the code and you should get a fairly good idea what I&#8217;m doing. I&#8217;ve put comments next to the things that can be changed in the jQuery code. It&#8217;s all in one HTML file to make it easier to see all at once.</p>
<p><img class="aligncenter size-full wp-image-313" title="jquerytwitter" src="http://www.gissisim.com/wp-content/uploads/2009/03/jquerytwitter.gif" alt="jquerytwitter" width="420" height="591" /><a title="Go to example of jQuery Twitter Feed" href="http://icetweet.gissisim.com"><strong></strong></a></p>
<p><a title="Go to example of jQuery Twitter Feed" href="http://icetweet.gissisim.com"><strong>Link to exmaple.</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gissisim.com/2009/03/13/live-jquery-twitter-feed/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
