<?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>Mike Luby &#187; twitter</title>
	<atom:link href="http://www.mikeluby.com/category/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikeluby.com</link>
	<description>acts smart.</description>
	<lastBuildDate>Wed, 23 Dec 2009 15:45:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Display Your Twitter feed with Javascript and jQuery</title>
		<link>http://www.mikeluby.com/2009/12/23/display-your-twitter-feed-with-javascript-and-jquery/</link>
		<comments>http://www.mikeluby.com/2009/12/23/display-your-twitter-feed-with-javascript-and-jquery/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 15:41:00 +0000</pubDate>
		<dc:creator>Mike Luby</dc:creator>
				<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.mikeluby.com/?p=223</guid>
		<description><![CDATA[Here is a quick example how to display your Twitter feed just using Javascript and jQuery. As you know, this content won&#8217;t be available for spidering so it&#8217;s more for your users rather than SEO. Ok, lets get started.
If you haven&#8217;t already, let&#8217;s include jQuery into your site. Add the following script tag into the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick example how to display your Twitter feed just using Javascript and jQuery. As you know, this content won&#8217;t be available for spidering so it&#8217;s more for your users rather than SEO. Ok, lets get started.<br />
If you haven&#8217;t already, let&#8217;s include jQuery into your site. Add the following script tag into the &lt;head&gt; of your site:</p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Next we&#8217;re going to load the data from Twitter asynchronously. The following will do that:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
//Your twitter name
var twitter_name = &quot;mikeluby&quot;;
//Number of tweets you want to get back
var twitter_count = 6;
//Callback function name
var callback_name = &quot;tweet_callback&quot;;
//Twitter search url
var twitter_search = &quot;http://twitter.com/statuses/user_timeline&quot;;
//Return type (json or xml)
var return_type = &quot;json&quot;;
//Adds script tags to the head/body tag
( function() {
var ts = document.createElement('script');
ts.type = 'text/javascript';
ts.async = true;
ts.src = twitter_search + &quot;.&quot; + return_type + &quot;?screen_name=&quot; + twitter_name + &quot;&amp;count=&quot; + twitter_count + &quot;&amp;callback=&quot; + callback_name;
( document.getElementsByTagName( 'head' )[ 0 ] || document.getElementsByTagName( 'body' )[ 0 ] ).appendChild( ts );
} )();
&lt;/script&gt;
</pre>
<p>Ok you got the data now what? Let&#8217;s parse it and display it!</p>
<pre class="brush: jscript;">&lt;script type=&quot;text/javascript&quot;&gt;
//Call back function
function tweet_callback( data ) {
//Loop through the data from twitter
$.each( data, function( i, tweet ) {
//Make sure the text isn't undefined
if( tweet.text != undefined ) {
//Lets do some regex magic to replace urls, hashtags, and usernames
var text = tweet.text.toString().replace( /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig, '&lt;a href=&quot;$1&quot;&gt;$1&lt;/a&gt;' ).replace( /(^|\s)@(\w+)/, '&lt;a href=&quot;http://www.twitter.com/$2&quot;&gt;@$2&lt;/a&gt;' ).replace( /[#]+[A-Za-z0-9-_]+/ig, function(t) { var tag = t.replace(&quot;#&quot;,&quot;%23&quot;); return t.link(&quot;http://search.twitter.com/search?q=&quot;+tag); } );
//Lets append each tweet to a ul with the id of tweet_container
$( &quot;#tweet_container&quot; ).append( &quot;&lt;li&gt;&quot; + text + &quot;&lt;/li&gt;&quot;);
}
} );
}&lt;/script&gt;</pre>
<p>There you go! The only limitation is if a user decides to visit the page (and make the twitter api calls) more than 100 times per hour.</p>
<p>For those who don&#8217;t know how to do a ul tag with an id:</p>
<pre class="brush: xml;">&lt;ul id=&quot;tweet_container&quot;&gt;&lt;/ul&gt;</pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikeluby.com/2009/12/23/display-your-twitter-feed-with-javascript-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lets post to twitter via command line!</title>
		<link>http://www.mikeluby.com/2009/01/11/lets-post-to-twitter-via-command-line/</link>
		<comments>http://www.mikeluby.com/2009/01/11/lets-post-to-twitter-via-command-line/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 02:35:11 +0000</pubDate>
		<dc:creator>Mike Luby</dc:creator>
				<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://strategicv.com/?p=92</guid>
		<description><![CDATA[If you find your self not truly satisfied with filling out a form or by sending a text you can post your twitter statuses via command line/curl:

curl -u USERNAME:PASSWORD -d status=&#34;MESSAGE&#34; http://twitter.com/statuses/update.xml &#124; grep truncated

]]></description>
			<content:encoded><![CDATA[<p>If you find your self not truly satisfied with filling out a form or by sending a text you can post your twitter statuses via command line/curl:</p>
<pre class="brush: jscript;">
curl -u USERNAME:PASSWORD -d status=&quot;MESSAGE&quot; http://twitter.com/statuses/update.xml | grep truncated
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mikeluby.com/2009/01/11/lets-post-to-twitter-via-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
