<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: auto_link code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 07:35:56 GMT</pubDate>
    <description>DZone Snippets: auto_link code</description>
    <item>
      <title>automate linking to Twitter users</title>
      <link>http://snippets.dzone.com/posts/show/4577</link>
      <description>this method searches for @some_user in a string (txt) and links found matches to the twitter-page of some_user&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;def link_twitter_user(txt)&lt;br /&gt;	if match = txt.match(/.*?(@)((?:[a-z][a-z]+))(:|\s)/i)&lt;br /&gt;		user = match[2]&lt;br /&gt;		txt.gsub!(user, '&lt;a href="http://twitter.com/' + user + '"&gt;' + user + '&lt;/a&gt;')&lt;br /&gt;	end&lt;br /&gt;	txt&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 27 Sep 2007 11:36:39 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4577</guid>
      <author>labuschin (Martin Labuschin)</author>
    </item>
  </channel>
</rss>
