<?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>andr3w.net &#187; twitter</title>
	<atom:link href="http://andr3w.net/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://andr3w.net</link>
	<description>amateur web development...</description>
	<lastBuildDate>Fri, 20 Aug 2010 21:08:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hashtag and Username Linking in Twitter Apps</title>
		<link>http://andr3w.net/2009/05/hashtag-and-username-linking-in-twitter-apps/</link>
		<comments>http://andr3w.net/2009/05/hashtag-and-username-linking-in-twitter-apps/#comments</comments>
		<pubDate>Tue, 12 May 2009 23:44:50 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[site updates]]></category>
		<category><![CDATA[amdavidson.me]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://andr3w.net/?p=151</guid>
		<description><![CDATA[Are you trying to add automatic hashtag and username hot linking in your PHP twitter app? I just tried to do this with my amdavidson.me lifestreaming site. It&#8217;s just two nested regular expressions. If there&#8217;s some problem with nested preg_replace functions, or if any regular expression geniuses have better ideas, feel free to comment. But [...]]]></description>
			<content:encoded><![CDATA[<p>Are you trying to add automatic <a href="http://hashtags.org">hashtag</a> and username hot linking in your PHP twitter app?</p>
<p>I just tried to do this with my <a href="http://amdavidson.me">amdavidson.me</a> lifestreaming site. It&#8217;s just two nested regular expressions. If there&#8217;s some problem with nested preg_replace functions, or if any regular expression geniuses have better ideas, feel free to comment.</p>
<p>But if not, here&#8217;s a little code for you, should make things super easy. It assumes your tweet variable is $tweet, replace with whatever you&#8217;d need.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">echo</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\#([a-zA-Z0-9_]{1,15})?/'</span><span style="color: #339933;">,</span> <br />
<span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://hashtags.org/tag/<span style="color: #006699; font-weight: bold;">$1</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;#<span style="color: #006699; font-weight: bold;">$1</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <br />
<a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\@([a-zA-Z0-9_]{1,15})?/'</span><span style="color: #339933;">,</span> <br />
<span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span>http://twitter.com/<span style="color: #006699; font-weight: bold;">$1</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;@<span style="color: #006699; font-weight: bold;">$1</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <br />
<span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://andr3w.net/2009/05/hashtag-and-username-linking-in-twitter-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
