<?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>Asheville Web Design &#187; twitter</title>
	<atom:link href="http://www.appliedtns.com/blog/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.appliedtns.com/blog</link>
	<description>Asheville Web Design and Technology Blog</description>
	<lastBuildDate>Mon, 12 Dec 2011 21:56:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Parsing out links from the Twitter API Response with Regular Expressions</title>
		<link>http://www.appliedtns.com/blog/2009/04/parsing-out-links-from-the-twitter-api-response-with-regular-expressions/</link>
		<comments>http://www.appliedtns.com/blog/2009/04/parsing-out-links-from-the-twitter-api-response-with-regular-expressions/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 15:47:15 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ashevillewebblog.com/?p=131</guid>
		<description><![CDATA[Recently while building AVLTweetup.com we decided that instead of just displaying the tweets as plain text and making people copy and paste links or hashtags into their address bar that we would just make them automatically link for them. It isn&#8217;t much work for us to do that and it saves people who use the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently while building <a href="http://avltweetup.com" title="Asheville Tweetup">AVLTweetup.com</a> we decided that instead of just displaying the tweets as plain text and making people copy and paste links or hashtags into their address bar that we would just make them automatically link for them. It isn&#8217;t much work for us to do that and it saves people who use the site some time. This is pretty easily done using some regular expressions and replacing the pattern with a string we specify. Since Twitter has a well define format all we need to do is look for a few things and switch em out. Here is how we are handling each Tweet as we parse our tree of tweets.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;">	<span style="color:#AADDFF; font-weight:bold;">$formatted_text</span> = <span style="color:#FFFFFF; font-weight:bold;">preg_replace</span><span style="color:#AA66FF; font-weight:bold;">&#40;</span><span style="color:#A8FF60;">'/(<span style="color:#0000FF;">\b</span>(www<span style="color:#0000FF;">\.</span>|http<span style="color:#0000FF;">\:</span><span style="color:#0000FF;">\/</span><span style="color:#0000FF;">\/</span>)<span style="color:#0000FF;">\S</span>+<span style="color:#0000FF;">\b</span>)/'</span>, <span style="color:#A8FF60;">&quot;&lt;a target='_blank' href='$1'&gt;$1&lt;/a&gt;&quot;</span>, <span style="color:#AADDFF; font-weight:bold;">$tweet</span>-<span style="color:#DDEEBB; font-weight:bold;">&amp;</span>gt;text<span style="color:#AA66FF; font-weight:bold;">&#41;</span>;
	<span style="color:#AADDFF; font-weight:bold;">$formatted_text</span> = <span style="color:#FFFFFF; font-weight:bold;">preg_replace</span><span style="color:#AA66FF; font-weight:bold;">&#40;</span><span style="color:#A8FF60;">'/<span style="color:#0000FF;">\#</span>(<span style="color:#0000FF;">\w</span>+)/'</span>, <span style="color:#A8FF60;">&quot;&lt;a target='_blank' href='http://search.twitter.com/search?q=$1'&gt;#$1&lt;/a&gt;&quot;</span>, <span style="color:#AADDFF; font-weight:bold;">$formatted_text</span><span style="color:#AA66FF; font-weight:bold;">&#41;</span>;
	<span style="color:#AADDFF; font-weight:bold;">$formatted_text</span> = <span style="color:#FFFFFF; font-weight:bold;">preg_replace</span><span style="color:#AA66FF; font-weight:bold;">&#40;</span><span style="color:#A8FF60;">'/<span style="color:#0000FF;">\@</span>(<span style="color:#0000FF;">\w</span>+)/'</span>, <span style="color:#A8FF60;">&quot;&lt;a target='_blank' href='http://twitter.com/$1'&gt;@$1&lt;/a&gt;&quot;</span>, <span style="color:#AADDFF; font-weight:bold;">$formatted_text</span><span style="color:#AA66FF; font-weight:bold;">&#41;</span>;</pre></div></div>

<p>So this will first replace any links with an actual anchor tag and then we are going to convert all our hash tags to links to searches and all our user tags to links to their page.</p>
<p>Now we have the formatted text from the raw text the Twitter Search API gives us. All we have to do is display it how we want in our layout. Also while printing out the content i made sure to enclose our text in a specified class so it would be easy to find it for the next little bit of code that will go and fetch any twitpics and display them when a user mouses over the url. I will do a full write up on that in the future so that I can walk through the whole process since it will involve css combined with js and some php.</p>
<p>A short post but it has been a while since a fresh post so starting off a bit slow!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.appliedtns.com/blog/2009/04/parsing-out-links-from-the-twitter-api-response-with-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Asheville Twestival: iPledge Video</title>
		<link>http://www.appliedtns.com/blog/2009/02/asheville-twestival-ipledge-video/</link>
		<comments>http://www.appliedtns.com/blog/2009/02/asheville-twestival-ipledge-video/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 04:27:22 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asheville]]></category>
		<category><![CDATA[charity:water]]></category>
		<category><![CDATA[twestival]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ashevillewebblog.com/?p=115</guid>
		<description><![CDATA[We will be shooting an “iPledge” video tomorrow at Pritchard Park in Downtown Asheville. Come join us and be part of our video. The shoot is going to be very short, you simply hold a sign and say “iPledge”.
Bring your friends and family and join in on the fun.
Please come out and show your support [...]]]></description>
			<content:encoded><![CDATA[<p>We will be shooting an “iPledge” video tomorrow at Pritchard Park in Downtown Asheville. Come join us and be part of our video. The shoot is going to be very short, you simply hold a sign and say “iPledge”.</p>
<p>Bring your friends and family and join in on the fun.</p>
<p>Please come out and show your support this Saturday!<br />
Pritchard Park 11:30am and 3:00pm</p>
<p>We will also be accepting items for our silent auction taking place on Thursday, February 12. at Windows on the Park.</p>
<p>    Available Sponsorships:</p>
<p>    Platinum Sponsors: $200.00<br />
    Your company will appear on our website, displayed during the twestival event, and we will do our best to get you in on all the press, blogs, and any other exposure possible!</p>
<p>    Supporting Sponsors: (Food/Beer/Event Cost):$50 donation<br />
    You will be listed as supporter sponsor on our website and will tweet and blog about your support/donation.</p>
<p>    iPledge: $5<br />
    You get to be in our own Viral Video Project, which will be seen by 100’s, 1000’s, maybe even millions</p>
<p>    BLOGGERS: $0<br />
    Simply mention our twestival on your blog, send us the perma-link and we will gratefully add you to our BlogRoll</p>
<p>    We understand that $$ maybe tight and you may not be able to donate any $$. You do not need to give $$ to support the cause, we still need your help spreading the word and finding creative ways to bring attention to the cause.</p>
<p>Thank you for supporting Asheville’s very own Twestival.</p>
<p>Have a question, email us at avltwestival at gmail.com or leave a comment</p>
]]></content:encoded>
			<wfw:commentRss>http://www.appliedtns.com/blog/2009/02/asheville-twestival-ipledge-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

