<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0MDR3YzcCp7ImA9WhZQFEw.&quot;"><id>tag:blogger.com,1999:blog-7172873032676974096</id><updated>2011-04-21T12:51:16.888-07:00</updated><category term="sitecatalyst" /><category term="data insertion api" /><category term="integration" /><category term="twitter api" /><category term="twitter omniture integration" /><category term="php" /><category term="sitecatalyst reporting" /><category term="twitter" /><category term="simplepie" /><category term="omniture" /><title>Websicle - Random Things that Give You Brain Freeze</title><subtitle type="html">Random Things that Give You Brain Freeze</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://websicle.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://websicle.blogspot.com/" /><author><name>Lily</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="25" src="http://3.bp.blogspot.com/_b8MoxpzMEzA/SbGkS3T43qI/AAAAAAAADPQ/UFedK8_CI0o/S220/headshot.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/websicle" /><feedburner:info uri="websicle" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0MNRHo5fip7ImA9WxVbEUU.&quot;"><id>tag:blogger.com,1999:blog-7172873032676974096.post-7194824004330901938</id><published>2009-03-27T13:05:00.000-07:00</published><updated>2009-03-27T13:24:55.426-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-27T13:24:55.426-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="twitter api" /><category scheme="http://www.blogger.com/atom/ns#" term="omniture" /><category scheme="http://www.blogger.com/atom/ns#" term="sitecatalyst reporting" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter omniture integration" /><title>Twitter-Omniture Integration SiteCatalyst Reporting</title><content type="html">So one thing that I forgot to include in my previous post is what you get out of the Twitter-Omniture SiteCatalyst integration!  Here are some handy screenshots. I've chosen the iPhone, Blackberry, and Palm Pre brands to track.&lt;br /&gt;&lt;br /&gt;Raw # of Tweets per brand:&lt;br /&gt;&lt;a href="http://img.skitch.com/20090327-c2qbnyjgcfkwk82n8j5bgc8863.jpg" target="_blank"&gt;&lt;img src="http://img.skitch.com/20090327-c2qbnyjgcfkwk82n8j5bgc8863.jpg" width="600" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hmm, that looks interesting. Now if you're interested in understanding who's talking most about the iPhone, you can dig into that to subrelate by author:&lt;br /&gt;&lt;a href="http://img.skitch.com/20090327-mi5emdexjrhh1e7ah8ks4et1qj.jpg" target="_blank"&gt;&lt;img src="http://img.skitch.com/20090327-mi5emdexjrhh1e7ah8ks4et1qj.jpg" width="600" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From here though, I really wanted to weight the value of each author's tweets differently based on what they were saying and how many followers they had.  Stay tuned for the next post that goes into how I did that.  For now, though, here's a screenshot of the additional reporting I'm seeing now!  (Looks like the Palm Pre took a hit)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://img.skitch.com/20090327-qme3csxs8j7py68174asfs4wk5.jpg" target="_blank"&gt;&lt;img src="http://img.skitch.com/20090327-qme3csxs8j7py68174asfs4wk5.jpg" width="600" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For more random thoughts, follow me on twitter! - http://twitter.com/sflily&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7172873032676974096-7194824004330901938?l=websicle.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/websicle/~4/ONYo9nHRKO8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://websicle.blogspot.com/feeds/7194824004330901938/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://websicle.blogspot.com/2009/03/twitter-omniture-integration.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7172873032676974096/posts/default/7194824004330901938?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7172873032676974096/posts/default/7194824004330901938?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/websicle/~3/ONYo9nHRKO8/twitter-omniture-integration.html" title="Twitter-Omniture Integration SiteCatalyst Reporting" /><author><name>Lily</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="25" src="http://3.bp.blogspot.com/_b8MoxpzMEzA/SbGkS3T43qI/AAAAAAAADPQ/UFedK8_CI0o/S220/headshot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://websicle.blogspot.com/2009/03/twitter-omniture-integration.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcASXo_fCp7ImA9WxVVFk8.&quot;"><id>tag:blogger.com,1999:blog-7172873032676974096.post-3404497625539595859</id><published>2009-03-06T15:10:00.000-08:00</published><updated>2009-03-09T11:07:28.444-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-09T11:07:28.444-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="twitter api" /><category scheme="http://www.blogger.com/atom/ns#" term="integration" /><category scheme="http://www.blogger.com/atom/ns#" term="simplepie" /><category scheme="http://www.blogger.com/atom/ns#" term="omniture" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="sitecatalyst" /><category scheme="http://www.blogger.com/atom/ns#" term="data insertion api" /><title>6 Easy Steps to Integrate Twitter &amp; Omniture SiteCatalyst Without IT!</title><content type="html">&lt;div style="font-size:12px;color:#000000"&gt;&lt;br /&gt;&lt;br /&gt;I'm going to have to start with a disclaimer. Some of you may know me from Omniture, but this post is in no way a recommendation or best practice from Omniture :)  I just decided to dust off what few programming skills I had and give the Twitter + SiteCatalyst integration a whirl.  &lt;br /&gt;&lt;br /&gt;With that said, I'm going to cover how to implement the integration, all without the need for IT to get involved!  &lt;br /&gt;&lt;br /&gt;Here's what you'll need in order to follow along:&lt;br /&gt;&lt;br /&gt;- a basic understanding of programming (I will be using &lt;a href="http://www.w3schools.com/PHP/php_intro.asp"&gt;PHP&lt;/a&gt;)&lt;br /&gt;- a basic understanding of &lt;a href="http://www.w3schools.com/sql/default.asp"&gt;SQL&lt;/a&gt;&lt;br /&gt;- a basic understanding of &lt;a href="http://www.twitter.com"&gt;Twitter&lt;/a&gt;&lt;br /&gt;- an understanding of Omniture's &lt;a href="http://developer.omniture.com"&gt;data insertion API&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update 3/9: For those who are just interested in getting the plugin code and not the nuts &amp; bolts, you can download a plugin that Jason Thompson created over at &lt;a href="http://emptymind.org/?page_id=69"&gt;http://emptymind.org/?page_id=69&lt;/a&gt; and skip the technical details. :)&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;Step 1: Download &lt;a href="http://www.simplepie.org"&gt;SimplePie library&lt;/a&gt;&lt;/span&gt;  &lt;br /&gt;In SimplePie's own words, they are "a very fast and easy-to-use class, written in PHP, that puts the 'simple' back into 'really simple syndication'."  That means it's going to be super easy to parse Twitter's search feed!  Once you've downloaded and expanded the files, upload them onto your server. I'm assuming that you have a server to put files on. It can be as basic as GoDaddy hosting, which is what I used. There are many other options as well - FatCow, HostMonster, DreamHost, etc. All of them roughly $6/month or less.  &lt;br /&gt;&lt;br /&gt;You should see something similar to this structure now:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090306-fp7nweqhu8eb1k78s1ux2qfmx9.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;You'll want to make sure that your server is good to go, so hit the compatibility page first.  You can find it at "/compatibility_test/sp_compatibility_test.php". Here were my results, important parts highlighted:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090306-cxf8rrewtri4sj8htjk46752ga.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;Step 2: Create new PHP file and include SimplePie&lt;/span&gt; &lt;br /&gt;Once you've included SimplePie, you should go through the steps to parse your twitter feed to make sure it's working as expected.  In this example, we're storing our feed URL in the variable $feedURL as "http://search.twitter.com/search.atom?q=omniture", where omniture is the search term:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090306-jrammuwn3utqsg5b1pyacpdecn.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;Step 3: Verify PHP file output&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hopefully you've got a nice output showing each individual tweet now, like this:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090306-b719hdh8un9rw53bqa18asqwu2.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;&lt;br /&gt;Step 4: Incorporate since_id to Avoid Duplicate Tweets&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Each tweet has an id associated with it that looks like this: "tag:search.twitter.com,2005:1290809923".  The last part of that id is essentially a timestamp. When you call the Twitter search feed, you can append that value in the request so that it only pulls tweets more recent or fresh since that date, like so:&lt;br /&gt;http://search.twitter.com/search.atom?q=omniture&amp;since_id=1290809923&lt;br /&gt;&lt;br /&gt;In order to append it, we have to store it. That's where SQL comes into play. You'll need to create a very simple table to store your key values.  Here's an example of how you can structure it:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family:courier,verdana,arial"&gt;&lt;br /&gt;CREATE TABLE `feeds` (&lt;br /&gt;  `id` int(4) NOT NULL auto_increment,&lt;br /&gt;  `since_id` varchar(32) NOT NULL default '0',&lt;br /&gt;  `query` text NOT NULL,&lt;br /&gt;  PRIMARY KEY  (`id`)&lt;br /&gt;);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I'm thinking a few steps ahead by assuming that you may change up what you want to search twitter for, which means you should have separate rows with separate since_id values.&lt;br /&gt;&lt;br /&gt;Here's a screenshot of how I added SQL to my php file:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090309-kyc46b5ak4mx7s51j7c6bnxc9e.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;You'll also need to add an insert or update after cycling through the search response in order to update the since_id value in the table.&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;&lt;br /&gt;Step 5: Add Omniture Data Insertion API Call&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Okay, you're really almost there!  Last thing we need to do is make sure we make a call out to Omniture's Data Insertion API for each item in the for loop.  I'm not going to go through forming the header and passing client-specific authentication data, that can be found at &lt;a href="http://developer.omniture.com"&gt;http://developer.omniture.com&lt;/a&gt; and you can leave a comment if you'd like to speak directly about it.  Here's the Tweet-specific stuff you'll want to add:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family:courier,verdana,arial"&gt;&lt;br /&gt;$page_url  = "http://www.twitter.com";&lt;br /&gt;$pageName  = "Twitter Mention"; &lt;br /&gt;$events    = "event3";&lt;br /&gt;$evar4    = "omniture";&lt;br /&gt;&lt;br /&gt;$xml .= $page_url ? " &lt;pageURL&gt;$page_url&lt;/pageURL&gt;\n":"";&lt;br /&gt;$xml .= $pageName ? " &lt;pageName&gt;$pageName&lt;/pageName&gt;\n":""; &lt;br /&gt;$xml .= $author ? " &lt;evar5&gt;$author&lt;/evar5&gt;\n":"";&lt;br /&gt;$xml .= $recipient ? " &lt;evar6&gt;$recipient&lt;/evar6&gt;\n":"";&lt;br /&gt;$xml .= $events ? " &lt;events&gt;$events&lt;/events&gt;\n":"";&lt;br /&gt;$xml .= $query ? " &lt;evar4&gt;$query&lt;/evar4&gt;\n":"";&lt;br /&gt;$xml .= $title ? " &lt;evar7&gt;$title&lt;/evar7&gt;\n":"";&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="step" style="font-size:18px;color:#000000;font-weight:bold"&gt;&lt;br /&gt;Step 6: Set Up Cron Job to Run Script Hourly&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's what the interface looks like in GoDaddy for setting up a cron job:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090309-f4wry62sxyp5r1ysqea2qijb4p.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;These are the details I input for setting it up to use my script on an hourly basis:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://img.skitch.com/20090309-mcunt7xypym3416kq3ghbe2c2q.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And now you're done! If you found this post helpful, please &lt;a href="http://twitter.com/home/?status=From+Websicle%2F%40sflily+6+Easy+Steps+to+Integrate+Twitter+%26+Omniture+SiteCatalyst+Without+IT+-+http%3A%2F%2Fwebsicle.blogspot.com%2F"&gt;Tweet it!&lt;/a&gt; :)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;For more random thoughts, follow me on twitter! - http://twitter.com/sflily&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7172873032676974096-3404497625539595859?l=websicle.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/websicle/~4/9uzyzSteGBo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://websicle.blogspot.com/feeds/3404497625539595859/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://websicle.blogspot.com/2009/03/6-easy-steps-to-integrate-twitter.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7172873032676974096/posts/default/3404497625539595859?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7172873032676974096/posts/default/3404497625539595859?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/websicle/~3/9uzyzSteGBo/6-easy-steps-to-integrate-twitter.html" title="6 Easy Steps to Integrate Twitter &amp; Omniture SiteCatalyst Without IT!" /><author><name>Lily</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="25" src="http://3.bp.blogspot.com/_b8MoxpzMEzA/SbGkS3T43qI/AAAAAAAADPQ/UFedK8_CI0o/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://websicle.blogspot.com/2009/03/6-easy-steps-to-integrate-twitter.html</feedburner:origLink></entry></feed>

