<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>DirtMind Blog</title>
	<atom:link href="http://dirtmind.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dirtmind.wordpress.com</link>
	<description>What&#039;s on your mind?</description>
	<lastBuildDate>Mon, 18 Apr 2011 13:26:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dirtmind.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>DirtMind Blog</title>
		<link>http://dirtmind.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dirtmind.wordpress.com/osd.xml" title="DirtMind Blog" />
	<atom:link rel='hub' href='http://dirtmind.wordpress.com/?pushpress=hub'/>
		<item>
		<title>phpbb3 Sign in with twitter</title>
		<link>http://dirtmind.wordpress.com/2009/07/21/phpbb3-sign-in-with-twitter/</link>
		<comments>http://dirtmind.wordpress.com/2009/07/21/phpbb3-sign-in-with-twitter/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 10:09:08 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[authorize]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[mechanism]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpbb3]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[sign in with twitter]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=95</guid>
		<description><![CDATA[I&#8217;ve previously blogged about how I extended the architecture of phpbb3 to my entire website. This got me great advantages in terms of security, session management etc. etc. and a consistent look and feel. However, something I always wanted to do was lower the barriers to people posting. I have enabled anonymous posting with a, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=95&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously blogged about how I extended the <a href="http://dirtmind.wordpress.com/2009/01/27/extending-phpbb3/" target="_blank">architecture of phpbb3</a> to my entire website. This got me great advantages in terms of security, session management etc. etc. and a consistent look and feel. However, something I always wanted to do was lower the barriers to people posting. I have enabled anonymous posting with a, visual captcha obviously, but some features like the use of the image gallery and certain forum sections are only available to registered members. The problem is: registering is a pain!</p>
<p>So here comes &#8220;Sign in with twitter&#8221;. <a href="http://twitter.com" target="_blank">Twitter </a>has been moving to<a href="http://oauth.net" target="_blank"> OAuth</a> to provide an open platform for authentication, meaning that sites like <a href="http://www.dirtmind.com" target="_blank">www.dirtmind.com</a> can use twitter as a way of logging in users, even brand new ones, in just two clicks! Sounds awesome doesn&#8217;t it?</p>
<div class="wp-caption alignnone" style="width: 175px"><img title="Sign in with twitter button" src="http://www.dirtmind.com/images/login_twitter.gif" alt="This is just the button, it doesnt do a login here!" width="165" height="28" /><p class="wp-caption-text">This is just the button, it doesn&#39;t do a login here!</p></div>
<p>There were a few problems with getting this all to work&#8230; phpbb has an open architecture and a mechanism for you to create your own authentication plugins, so rather than use the default database authentication mechanism you can use LDAP or Apache or write you own. Unfortunately, despite my detailed searching it seems no one has written an auth_twitter plugin for phpbb3. On the other hand there are some good php twitter oauth examples out there so I thought it shouldn&#8217;t be too hard to write my own.</p>
<p><strong><span style="text-decoration:underline;">Some requirements:</span></strong></p>
<p>1. New users must be able to use twitter oauth to create and login to new dirtmind accounts seamlessly.</p>
<p>2. Existing dirtmind members must be able to login using their normal username/password combination <em>and</em> twitter oauth interchangeably.</p>
<p>3. No twitter user should be able to hijack an existing dirtmind account</p>
<p>4. A twitter user needs to be able to claim a dirtmind account as theirs as part of the twitter oath flow</p>
<p>5. A dirtmind user needs to be able to specify a twitter account to log in with, that isn&#8217;t necessarily the same name</p>
<p>6. An account created by twitter oauth needs to be a standard normal phpbb user account, the user should be able to change their profile and even set a password that will then work as part of normal phpbb db login</p>
<p>7. All logins should honour phpbb security, inactive accounts and banned accounts settings</p>
<p>Easy right?</p>
<p><strong><span style="text-decoration:underline;">The big challenge</span></strong></p>
<p>The main problem in achieving this was that there is some architectural impedence between twitter oauth and phpbb login. This is probably why I couldn&#8217;t find anything out there that I could just pick up and use.</p>
<p>Twitter oauth is a two stage process, you request an authorisation url, you go to it and enter account details on the twitter site (or use your current logged in status) and then it calls back to the original applicaiton.</p>
<p>Phpbb login is a single process, you call login with a username/password and the user is either logged in or not.</p>
<p><strong><span style="text-decoration:underline;">The solution</span></strong></p>
<p>Yes, I got it to work, you can see the results on <a href="http://www.dirtmind.com" target="_blank">www.dirtmind.com</a> (any part of the site, forum, games, image gallery, whatever &#8211; it&#8217;s side wide awesomeness). I&#8217;m not going to post all of the code for how login works on my website for obvious security reasons but here&#8217;s the solution and some snippets to help you put it all together.</p>
<p>So I did write an auth_twitter plugin for phpbb3 however this practically no twitter oauth flow in it at all. It&#8217;s basically the same as the standard auth_db plugin with some notable exceptions:</p>
<ul>
<li>If the source of the login attempt is twitter then allow null passwords</li>
<li>If the source of the login is twitter then auto-create a phpbb account if one doesn&#8217;t exist</li>
<li>During auto-creation of accounts if the target already exists than redirect to a mapping page that allows the user to claim the target dirtmind account or alternatively specify an arbitrary name for their new dirtmind account</li>
</ul>
<p>How to create a new phpbb users (from auth_twitter)</p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>$row = array(</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;username&#8217;<span style="white-space:pre;"> </span>=&gt; $username,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_twitter&#8217; =&gt; $db-&gt;sql_escape(utf8_clean_string($username)),</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_password&#8217;<span style="white-space:pre;"> </span>=&gt; phpbb_hash(&#8221;),</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_email&#8217;<span style="white-space:pre;"> </span>=&gt; &#8216;none@dirtmind.com&#8217;,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;group_id&#8217;<span style="white-space:pre;"> </span>=&gt; (int) $grow['group_id'],</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_type&#8217;<span style="white-space:pre;"> </span>=&gt; USER_NORMAL,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_ip&#8217;<span style="white-space:pre;"> </span>=&gt; getenv(&#8216;REMOTE_ADDR&#8217;),<span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_timezone&#8217; =&gt; &#8217;1.00&#8242;,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_dst&#8217; =&gt; 0,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_lang&#8217; =&gt; &#8216;en&#8217;,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_actkey&#8217; =&gt; &#8221;,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_dateformat&#8217; =&gt; &#8216;d M Y H:i&#8217;,<span style="white-space:pre;"> </span></div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_style&#8217; =&gt; 1,</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>&#8216;user_regdate&#8217; =&gt; time(),</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:710px;width:1px;height:1px;"><span style="white-space:pre;"> </span>);<span style="white-space:pre;"> </span></div>
<blockquote>
<pre><span style="white-space:pre;"> </span>$row = array(
<span style="white-space:pre;"> </span>'username'<span style="white-space:pre;"> </span>=&gt; $username,
<span style="white-space:pre;"> </span>'user_twitter' =&gt; $db-&gt;sql_escape(utf8_clean_string($username)),
<span style="white-space:pre;"> </span>'user_password'<span style="white-space:pre;"> </span>=&gt; phpbb_hash(''),
<span style="white-space:pre;"> </span>'user_email'<span style="white-space:pre;"> </span>=&gt; 'none@dirtmind.com',
<span style="white-space:pre;"> </span>'group_id'<span style="white-space:pre;"> </span>=&gt; (int) $grow['group_id'],
<span style="white-space:pre;"> </span>'user_type'<span style="white-space:pre;"> </span>=&gt; USER_NORMAL,
<span style="white-space:pre;"> </span>'user_ip'<span style="white-space:pre;"> </span>=&gt; getenv('REMOTE_ADDR'),<span style="white-space:pre;"> </span>
<span style="white-space:pre;"> </span>'user_timezone' =&gt; '1.00',
<span style="white-space:pre;"> </span>'user_dst' =&gt; 0,
<span style="white-space:pre;"> </span>'user_lang' =&gt; 'en',
<span style="white-space:pre;"> </span>'user_actkey' =&gt; '',
<span style="white-space:pre;"> </span>'user_dateformat' =&gt; 'd M Y H:i',<span style="white-space:pre;"> </span>
<span style="white-space:pre;"> </span>'user_style' =&gt; 1,
<span style="white-space:pre;"> </span>'user_regdate' =&gt; time(),
<span style="white-space:pre;"> </span>);<span style="white-space:pre;"> </span></pre>
</blockquote>
<p><span style="white-space:pre;"><span style="white-space:normal;">Normally you&#8217;d then call:</span></span></p>
<blockquote>
<pre><span style="white-space:pre;"><span style="white-space:normal;">$phpbb_user_id = user_add($row);</span><span style="white-space:normal;"> </span></span></pre>
</blockquote>
<p><span style="white-space:pre;"><span style="white-space:normal;">To add the user to the database, but since you&#8217;re inside the login mechanism you just pass the row back as part of the return data of the login_twitter function</span></span></p>
<p>I then simply call the login_twitter method with username and no password from the twitter oauth flow, which is built into my basic page template <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For simple php oauth I strongly recommend <a href="http://github.com/abraham/twitteroauth/tree/master" target="_blank">Abraham&#8217;s twitter oauth</a>. Obviously there are some issues to deal with like not allowing arbitrary account linkage, preventing simple db account hacking based on the blank passwords and other anti-hacking things to consider, but those are all fairly standard solutions to fairly standard problems. The results are a really sweet login experience for people <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /> Tagged: architecture, authentication, authorize, code, login, mechanism, oauth, php, phpbb3, plugin, requirements, sign in with twitter, twitter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=95&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/07/21/phpbb3-sign-in-with-twitter/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/images/login_twitter.gif" medium="image">
			<media:title type="html">Sign in with twitter button</media:title>
		</media:content>
	</item>
		<item>
		<title>Challenges in Developing a Twitter Client</title>
		<link>http://dirtmind.wordpress.com/2009/06/23/challenges-in-developing-a-twitter-client/</link>
		<comments>http://dirtmind.wordpress.com/2009/06/23/challenges-in-developing-a-twitter-client/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:48:51 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TweetMind]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[deterministic]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[garbage collection]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[multi-threading]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[virtual]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=91</guid>
		<description><![CDATA[hallenges in Developing a Twitter Client TweetMind is developed in c# on .net. The aim was to provide a nice friendly intuitive twitter client. I basically wanted twhirl but with more features like drag and drop groups, better following/unfolllowing stuff etc. Scalability, Caching and Performance Twitter gives you a lot of data if you&#8217;re following [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=91&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">hallenges in Developing a Twitter Client</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">TweetMind is developed in c# on .net. The aim was to provide a nice friendly intuitive twitter client. I basically wanted twhirl but with more features like drag and drop groups, better following/unfolllowing stuff etc.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Scalability, Caching and Performance</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Twitter gives you a lot of data if you&#8217;re following a lot of people and I want TweetMind to work for noobs and hardcore twitter users alike. So, with this in mind I set about thinking about scalability and implemented a number of cunning techniques to keep memory usage down:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- I cache all the date twitter gives TweetMind for seaches, quick user lookups etc.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- I wrote my own cache, that includes memory management so if it starts getting too big it dumps out old stuff that may not be needed anymore</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- I cache tweets, user information and avatars</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">- The UI is seperate from the TweetMind Cache so I use virtual display techniques. There aren&#8217;t any tweet displays in existence outside of the immediately visible tab and it&#8217;s visible area. Everything else pops in and out of existence as you scroll or tab about. Unfortunately this makes scrolling a little slow on my system but it&#8217;s well worth it!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Garbage Collection my arse!</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">During development I noticed that if I left TweetMind running for a while it would run out of memory. That was fairly easy to solve as I simply hadn&#8217;t implemented my cache memory management very well. Once that was sorted I noticed I started getting &#8220;Unable to create window handle&#8221; exceptions all over the place and everything would die. A bit of googline about and I found some guidance saying that I should add the &#8220;USER Objects&#8221; column to my Windows Task Manager and have a look at what was going on.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Lo and behold I was quickly cranking up to 5000ish of these things and crashing horribly. It seems that applications have a max load of 10,000 and I wasn&#8217;t approaching it fast enough to crash. Although I had virtualised the tweet display the window objects I was creating to display a tweet weren&#8217;t being disposed of properly and the Garbage Collector was never going anywhere near these things. In the end I implemented a manual dispose method, explicitly called and suddenly life is grand.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">If you add the &#8220;USER Objects&#8221; column to your task manager and fire up TweetMind you can see this working yourself. Just flip about between tabs and you&#8217;ll see USER Objects spike up, especially when going back to the home tab if you&#8217;ve been recieving a lot of tweets. But almost as soon as it spikes up it should settle back down to around 800 &#8211; 1000 depending on many things (don&#8217;t worry if it&#8217;s a bit more or less so long as it&#8217;s staying roughly stable);</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">I can now run TweetMind for hours without memory, USER Objects, GDI Objects or anything else getting too out of hand! Huzzah! This should make TweetMind scalable enough for even the most hardcore of users <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">What order do things happen in?</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Normally when programming things happen one after another. This is fairly simple and deterministic therefore when there&#8217;s bugs it&#8217;s reasonably simple to track them down and fix them. However, looking up information on the internet is fairly slow and when TweetMind starts it needs to lookup who you are, your friends tweets (equivalent of your &#8220;home&#8221; page on twitter), your replies and your direct messages. Imagine doing all that in your browser, it would take a while. Image that long waiting for a program to start and become responsive. The quality of user experience would be total shit. Therefore I decided to do it all at the same time, and in the background. This means the main TweetMind window can happily respond to your actions while stuff is loading.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Technically I did this by multithreading.I execute all of the main twitter lookups (friends timeline, replies, DMs) on throttled threads dumping all their data into the cache, the UI then reads the cache when it wants to which is derived from when you&#8217;re looking at it. Underneath the UI the &#8220;engine&#8221; of the system periodically, depending on things like API limit usage, looks up info on Twitter in parallel. This means that the user experience is quite quick for TweetMind vs. some other twitter clients <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<p>The aim was to provide a nice friendly intuitive twitter client. I basically wanted twhirl but with more features like drag and drop groups, better following/unfolllowing stuff etc.</p>
<p><strong><span style="text-decoration:underline;">Scalability, Caching and Performance</span></strong></p>
<p>Twitter gives you a lot of data if you&#8217;re following a lot of people and I want TweetMind to work for noobs and hardcore twitter users alike. So, with this in mind I set about thinking about scalability and implemented a number of cunning techniques to keep memory usage down:</p>
<p>- I cache all the date twitter gives TweetMind for seaches, quick user lookups etc.</p>
<p>- I wrote my own cache, that includes memory management so if it starts getting too big it dumps out old stuff that may not be needed anymore</p>
<p>- I cache tweets, user information and avatars</p>
<p>- The UI is seperate from the TweetMind Cache so I use virtual display techniques. There aren&#8217;t any tweet displays in existence outside of the immediately visible tab and it&#8217;s visible area. Everything else pops in and out of existence as you scroll or tab about. Unfortunately this makes scrolling a little slow on my system but it&#8217;s well worth it!</p>
<p><strong><span style="text-decoration:underline;">Garbage Collection my arse!</span></strong></p>
<p>During development I noticed that if I left TweetMind running for a while it would run out of memory. That was fairly easy to solve as I simply hadn&#8217;t implemented my cache memory management very well. Once that was sorted I noticed I started getting &#8220;Unable to create window handle&#8221; exceptions all over the place and everything would die. A bit of googline about and I found some guidance saying that I should add the &#8220;USER Objects&#8221; column to my Windows Task Manager and have a look at what was going on.</p>
<p>Lo and behold I was quickly cranking up to 5000ish of these things and crashing horribly. It seems that applications have a max load of 10,000 and I wasn&#8217;t approaching it fast enough to crash. Although I had virtualised the tweet display the window objects I was creating to display a tweet weren&#8217;t being disposed of properly and the Garbage Collector was never going anywhere near these things. In the end I implemented a manual dispose method, explicitly called and suddenly life is grand.</p>
<p>If you add the &#8220;USER Objects&#8221; column to your task manager and fire up TweetMind you can see this working yourself. Just flip about between tabs and you&#8217;ll see USER Objects spike up, especially when going back to the home tab if you&#8217;ve been recieving a lot of tweets. But almost as soon as it spikes up it should settle back down to around 800 &#8211; 1000 depending on many things (don&#8217;t worry if it&#8217;s a bit more or less so long as it&#8217;s staying roughly stable);</p>
<p>I can now run TweetMind for hours without memory, USER Objects, GDI Objects or anything else getting too out of hand! Huzzah! This should make TweetMind scalable enough for even the most hardcore of users <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><span style="text-decoration:underline;">What order do things happen in?</span></strong></p>
<p>Normally when programming things happen one after another. This is fairly simple and deterministic therefore when there&#8217;s bugs it&#8217;s reasonably simple to track them down and fix them. However, looking up information on the internet is fairly slow and when TweetMind starts it needs to lookup who you are, your friends tweets (equivalent of your &#8220;home&#8221; page on twitter), your replies and your direct messages. Imagine doing all that in your browser, it would take a while. Image that long waiting for a program to start and become responsive. The quality of user experience would be total shit. Therefore I decided to do it all at the same time, and in the background. This means the main TweetMind window can happily respond to your actions while stuff is loading.</p>
<p>Technically I did this by multithreading.I execute all of the main twitter lookups (friends timeline, replies, DMs) on throttled threads dumping all their data into the cache, the UI then reads the cache when it wants to which is derived from when you&#8217;re looking at it. Underneath the UI the &#8220;engine&#8221; of the system periodically, depending on things like API limit usage, looks up info on Twitter in parallel. This means that the user experience is quite quick for TweetMind vs. some other twitter clients <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh yeah, <a href="http://www.dirtmind.com/top_stories/latest-tweetmind-news--public-beta-open-837.php" target="_blank">TweetMind public beta</a> is now open</p>
<br /> Tagged: alpha, architecture, beta, cache, client, deterministic, free, garbage collection, memory, multi-threading, new, release, twitter, virtual <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=91&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/06/23/challenges-in-developing-a-twitter-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>
	</item>
		<item>
		<title>Coming soon&#8230; TweetMind</title>
		<link>http://dirtmind.wordpress.com/2009/05/27/coming-soon-tweetmind/</link>
		<comments>http://dirtmind.wordpress.com/2009/05/27/coming-soon-tweetmind/#comments</comments>
		<pubDate>Wed, 27 May 2009 10:49:56 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TweetMind]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[dirtmind]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[screenshot]]></category>
		<category><![CDATA[seesmic desktop]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tweetdeck]]></category>
		<category><![CDATA[tweetmind]]></category>
		<category><![CDATA[twhirl]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=83</guid>
		<description><![CDATA[Coming soon to an intrawebz near you is the ultimate twitter client: TweetMind! I got fed up with twitter clients not being able to do what I wanted! I like the simplicity of twirl but need groups and more advanced features like tweetdeck, plus multiple accounts, a customisable interface, font size, drag and drop for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=83&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Coming soon to an intrawebz near you is the ultimate <a href="http://www.twitter.com" target="_blank">twitter </a>client: TweetMind!</p>
<p>I got fed up with twitter clients not being able to do what I wanted! I like the simplicity of twirl but need groups and more advanced features like tweetdeck, plus multiple accounts, a customisable interface, font size, drag and drop for grouping people, and all sorts of other goodies. Twhirl doesn&#8217;t do enough, Tweetdeck is too limiting, Seesmic Desktop suck monkey balls. So I decided to write my own, twitter client and so TweetMind was born.</p>
<p>So far it&#8217;s in early development and isn&#8217;t available for public use. I plan to start limited alpha testing in the next few weeks followed by public beta after that. In the meantime, here&#8217;s a screenshot of the development version &#8211; bear in mind that visual details <strong>will</strong> change, I&#8217;ve not finished adding nice buttons and sorting out the bottom of my tweet forms yet!</p>
<div id="attachment_84" class="wp-caption alignnone" style="width: 310px"><a href="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot2.jpg"><img class="size-medium wp-image-84" title="tweetmind_screenshot2" src="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot2.jpg?w=300&#038;h=212" alt="TweetMind Alpha 0.9 screenshot" width="300" height="212" /></a><p class="wp-caption-text">TweetMind Alpha 0.9 screenshot</p></div>
<p>Click the pic for a full-size verison.  Oh and of course like all <a title="DirtMind Tools" href="http://dirtmind.com/tools/" target="_blank">DirtMind stuff</a> this will be free and there will be no ads! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s an updated screenshot from May 27th:</p>
<p><a href="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot.jpg"><img class="alignnone size-medium wp-image-89" title="TweetMind Screenshot" src="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot.jpg?w=274&#038;h=300" alt="TweetMind Screenshot" width="274" height="300" /></a></p>
<br /> Tagged: alpha, beta, dirtmind, free, groups, screenshot, seesmic desktop, software, tweetdeck, tweetmind, twhirl, twitter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=83&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/05/27/coming-soon-tweetmind/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>

		<media:content url="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot2.jpg?w=300" medium="image">
			<media:title type="html">tweetmind_screenshot2</media:title>
		</media:content>

		<media:content url="http://dirtmind.files.wordpress.com/2009/05/tweetmind_screenshot.jpg?w=274" medium="image">
			<media:title type="html">TweetMind Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Uploading images with a firefox extension</title>
		<link>http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/</link>
		<comments>http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/#comments</comments>
		<pubDate>Wed, 06 May 2009 10:34:20 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[FireFox Extension]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[bbcode]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[lol]]></category>
		<category><![CDATA[lolcat]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=80</guid>
		<description><![CDATA[I&#8217;ve blogged before about some of the technology behind the free DirtMind image gallery so here&#8217;s some more&#8230; For a long time I&#8217;ve wanted to make uploading and using images on forums simpler. FireFox gives us the capabilities to do this since when writing a firefox extension you&#8217;ve got access to a bit more functionality [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=80&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve blogged before about some of the technology behind the free DirtMind image gallery so here&#8217;s some more&#8230;</p>
<p>For a long time I&#8217;ve wanted to make uploading and using images on forums simpler. FireFox gives us the capabilities to do this since when writing a firefox extension you&#8217;ve got access to a bit more functionality than you normally do from javascript as it&#8217;s trusted code.</p>
<p>The mission, upload an image by right clicking on it, generating all necessary BBCode.</p>
<p>The solution:</p>
<p>1) Write a nice XUL user interface for adding right click options to the firefox browser, selecting a local picture, establishing selection of a remote picture and providing nice upload feedback</p>
<p>2) Using the firefox extension encode the local image, or download a remote image and encode it (without saving a local file &#8211; that would be cheating)</p>
<p>3) Upload to the image host, decode the image data back into a picture.</p>
<p>After that it&#8217;s easy  because we&#8217;re just into the normal serverside image processing stuff that the image host does.</p>
<p>Here&#8217;s some screenshots of it in action:</p>
<div class="wp-caption alignnone" style="width: 485px"><a href="http://www.dirtmind.com/tools/ffdmbbcode.php"><img title="Selecting an image to upload" src="http://www.dirtmind.com/images/dmbbcode3.jpg" alt="Selecting an image to upload" width="475" height="377" /></a><p class="wp-caption-text">Selecting an image to upload</p></div>
<div class="wp-caption alignnone" style="width: 468px"><a href="http://www.dirtmind.com/tools/ffdmbbcode.php"><img title="The image uploaded" src="http://www.dirtmind.com/images/dmbbcode4.jpg" alt="The image uploaded" width="458" height="337" /></a><p class="wp-caption-text">The image uploaded</p></div>
<p>Because of the other stuff I&#8217;ve blogged about before in terms of image captioning and deep site integration with phpBB you can now upload an image, caption it and post it extremely easily. Check out this HQ <a href="http://www.dirtmind.com/top_stories/psst-upload-images-to-dirtmind-using-a-firefox-extension-706.php">video of the whole process</a>!</p>
<p>Or watch in in lower quality on youtubte:</p>
<span style="text-align:center; display: block;"><a href="http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/"><img src="http://img.youtube.com/vi/mtnFPxN3gg4/2.jpg" alt="" /></a></span>
<br /> Tagged: addon, bbcode, extension, firefox, forum, free, howto, image, lol, lolcat <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=80&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/05/06/uploading-images-with-a-firefox-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/images/dmbbcode3.jpg" medium="image">
			<media:title type="html">Selecting an image to upload</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/images/dmbbcode4.jpg" medium="image">
			<media:title type="html">The image uploaded</media:title>
		</media:content>
	</item>
		<item>
		<title>Make your own lolcats, rofls and captions online</title>
		<link>http://dirtmind.wordpress.com/2009/05/01/make-your-own-lolcats-rofls-and-captions-online/</link>
		<comments>http://dirtmind.wordpress.com/2009/05/01/make-your-own-lolcats-rofls-and-captions-online/#comments</comments>
		<pubDate>Fri, 01 May 2009 13:27:48 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lol]]></category>
		<category><![CDATA[lolcats]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[rofl]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=77</guid>
		<description><![CDATA[I decided I wanted to allow DirtMind site members to be able to add captions to images easily so I set about thinking how to add an Image Captioner to the free DirtMind image hosting service. I intially talked to the developer of a well known online image captioner about getting his code to work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=77&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I decided I wanted to allow DirtMind site members to be able to add captions to images easily so I set about thinking how to add an Image Captioner to the free <a href="http://www.dirtmind.com/gallery" target="_blank">DirtMind image hosting service</a>. I intially talked to the developer of a well known online image captioner about getting his code to work as part of my site. Unfortunately though the backend technologies of his site and DirtMind didn&#8217;t mesh so I set about writing my own.</p>
<p>In the end this has had a lot of advantages as the Image captioner is far more specific to my design <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Server-side it&#8217;s pretty simple as I already had some image processing going on to watermark images with my site logo. Rather than make a stand alone image captioner I decided to integrate the functionality throughout the image gallery &#8211; that means all uploaded images are captionable. If you&#8217;re the owner of an image you can overwrite it with a captioned version, otherwise you can just save it as a new image (of course owners can do this too).</p>
<p>Of course some people will want a stand alone captioner, or at least a landing page so I created one for these people at <a href="http://www.dirtmind.com/captioner.php" target="_blank">www.dirtmind.com/captioner.php</a> but this is really just a single file upload box that goes to the normal gallery pages <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="text-decoration:underline;"><strong>Play with it</strong></span></p>
<p>As with everything at DirtMind it&#8217;s free and has no ads, if you want to try it out just look at any image on DirtMind! Here&#8217;s an example to play with (just click the pic).<br />
<a href="http://www.dirtmind.com/gallery/viewimage.php?uid=53&amp;gallery=sfw&amp;imageid=dirtmindimage_12408487590.jpg"><img src="http://www.dirtmind.com/gallery/images/53/tn/dirtmindimage_12408487590.jpg" alt="" /></a></p>
<p>You need to have a registered DM account to save your pic, or upload new ones, but you can play about with the captions without registering!</p>
<p>Technically the most challenging thing about doing this was the client side javascript. It seems that if you write something that works in FireFox then it pretty much works in Safari and Chrome. IE however has it&#8217;s own plans, and needs entirely different code. I spent a lot of time getting it to work in each platform. If you use another browser I&#8217;d appreciate you giving it a test run!</p>
<br /> Tagged: caption, chrome, firefox, free, hosting, ie, image, javascript, lol, lolcats, online, rofl, safari <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=77&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/05/01/make-your-own-lolcats-rofls-and-captions-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/gallery/images/53/tn/dirtmindimage_12408487590.jpg" medium="image" />
	</item>
		<item>
		<title>How to get reviews for FireFox extensions</title>
		<link>http://dirtmind.wordpress.com/2009/02/20/how-to-get-reviews-for-firefox-extensions/</link>
		<comments>http://dirtmind.wordpress.com/2009/02/20/how-to-get-reviews-for-firefox-extensions/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 02:06:37 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[FireFox Extension]]></category>
		<category><![CDATA[addon]]></category>
		<category><![CDATA[bbcode]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[yammer]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=71</guid>
		<description><![CDATA[I posted this guidance recently based on the response I got from a comment on an AMO (addons.mozilla.org) editor&#8217;s blog. Basically it&#8217;s instructions on how to leave a review but not how to get a review. I&#8217;ve released several firefox addons/extensions under various different IDs so here&#8217;s my advice on actually getting reviews&#8230; Reviews are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=71&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I posted <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">this guidance</a> recently based on the response I got from a comment on an AMO (<a href="http://addons.mozilla.org" target="_blank">addons.mozilla.org</a>) editor&#8217;s blog. Basically it&#8217;s instructions on how to leave a review but not how to get a review. I&#8217;ve released several firefox addons/extensions under various different IDs so here&#8217;s my advice on actually getting reviews&#8230;</p>
<p>Reviews are all important for firefox extension developers as without a number (minumum 3 decent) reviews you can&#8217;t get an extension out of the sandbox and into the public site. That&#8217;s important because in the sandbox you have to have a log in to get at an extension on the main public area anyone can download and use anonymously, so clearly there&#8217;s a barrier to normal users for sandbox extensions. This is for a good reason of course, good reviews mean that an extension isn&#8217;t just spam or complete shit, it&#8217;s actually useful.</p>
<hr />So, 3 things:</p>
<p>1) If you have a <a href="https://addons.mozilla.org/en-US/firefox/users/login" target="_blank">log in to AMO</a> then please leave reviews for the extensions you like, even if they&#8217;re already public</p>
<p>2) Please leave a review for <a href="https://addons.mozilla.org/en-US/firefox/user/3933582" target="_blank">my extensions</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>3) If you&#8217;re just sponging off the way extension developers make cool stuff for free help them out by leaving a review, it&#8217;s not like it costs anything more than 5 mins of your time!</p>
<hr />If you&#8217;re an extension developer, then you already know all this. So the critical question is how do you get reviews for your extension?</p>
<p>The obvious answer is to <strong>get your users to do leave reviews</strong>. The problem is it can be hard to get users if you don&#8217;t have reviews. I&#8217;ve gone about this by examining the target user base for my addon, and then telling them about it. My latest extension is about generating bbcode for forum users so naturally forum users are my target audience, I started off with my own forum and then let other forums know about it. If an extension is properly labelled then interested people will find it, of course many of them use google rather than AMO so you need to think about getting a website or page up that shows off your extension that people will find by search engines. Be careful with forums though, they are notoriously twitchy about percieved spam!</p>
<p>Do you personally know people/internet peeps that would be interested in using your addon? Then <strong>invite them</strong> to <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">leave a review and make sure you explain how to</a>!</p>
<p><strong>List it on AMO.</strong> People do naturally find extensions by searching AMO, I know because they&#8217;ve found mine!</p>
<p><strong>Blog it!</strong> Blogs are a great way to direct search engine traffic to something of interest.</p>
<p><strong>Tweet it! </strong>If you have a twitter following then let your tweeps know about your new found extension awesomeness.  It&#8217;s bound to be relevant to some of them, or at least as relevant as knowing that you&#8217;ve woken up.</p>
<p><strong>Get external links!</strong> If your target audience has a community or reference website then ask the webmasters if they&#8217;d be interested in linking to your extension in their resources section. Remember, everyone hates a spammer but people like contributors so you&#8217;ll often find that if you word your communication properly you&#8217;ll get a positive response. This will drive users to your extension, and in turn will drive up the number of reviews.</p>
<p><strong>Pimp it out!</strong> Whatever mediums/networks you&#8217;re a part of should know about your extension. Post it to Facebook, twitter, yammer, bebo, blinko, linkedin, hi5, plaxo, friendfeed, plurj, rejaw, meemi etc. But only let them know once, otherwise you&#8217;ll be just another spammer and ignored as such.</p>
<p>Finally, get an AMO account and <strong>leave review for other people</strong>. If I see reviews for one of my extensions I&#8217;ll lookup the username and leave a review for their extension. A bit of quid quo pro works well. So <a href="http://www.dirtmind.com/top_stories/please-review-the-bbcode-firefox-extension-501.php" target="_blank">leave me a review and I&#8217;ll leave you one</a>, there are many others that have the same philosophy, if you&#8217;re one of them then why not leave a comment here gently spamming your firefox extension.</p>
<p>Do you have any other tips?</p>
<br /> Tagged: addon, bbcode, blogging, extension, facebook, firefox, forum, hints, how to, linkedin, mozilla, review, tips, tricks, twitter, yammer <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=71&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/02/20/how-to-get-reviews-for-firefox-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>
	</item>
		<item>
		<title>Why @dirtythoughts are better than secrettweets</title>
		<link>http://dirtmind.wordpress.com/2009/02/12/why-dirtythoughts-are-better-than-secrettweets/</link>
		<comments>http://dirtmind.wordpress.com/2009/02/12/why-dirtythoughts-are-better-than-secrettweets/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 13:56:05 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[FireFox Extension]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[dirty]]></category>
		<category><![CDATA[dirtythoughts]]></category>
		<category><![CDATA[secret]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[uncensored]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=67</guid>
		<description><![CDATA[Want to read people&#8217;s innermost secret dirty thoughts? @dirtythoughts is a twitter account that anyone can post anything to, anonymously in realtime. There&#8217;s no filtering or censoring, there&#8217;s not even a moderation queue so as soon as you type in your dirty thought it&#8217;s posted on twitter, it&#8217;s also posted on the dirtythoughts website so [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=67&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Want to read people&#8217;s innermost secret dirty thoughts?</p>
<p><a href="http://twitter.com/dirtythoughts" target="_blank">@dirtythoughts</a> is a twitter account that anyone can post anything to, anonymously in realtime. There&#8217;s no filtering or censoring, there&#8217;s not even a moderation queue so as soon as you type in your dirty thought it&#8217;s posted on twitter, it&#8217;s also posted on the dirtythoughts website so that users can discuss. You don&#8217;t have to be a twitter user to join in so tell the world your <a href="http://www.dirtmind.com/thoughts" target="_blank">dirty thought</a> now!</p>
<p>This was inspired by secrettweet which is good but censored, moderated and very slow, therefore, improvements <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /> Tagged: anonymous, dirty, dirtythoughts, secret, twitter, uncensored <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=67&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/02/12/why-dirtythoughts-are-better-than-secrettweets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>
	</item>
		<item>
		<title>Jeni Barnett scaremongering about MMR on the radio</title>
		<link>http://dirtmind.wordpress.com/2009/02/10/jeni-barnett-scaremongering-about-mmr-on-the-radio/</link>
		<comments>http://dirtmind.wordpress.com/2009/02/10/jeni-barnett-scaremongering-about-mmr-on-the-radio/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:01:44 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[DirtMind Stories]]></category>
		<category><![CDATA[bitch]]></category>
		<category><![CDATA[crazy]]></category>
		<category><![CDATA[irresponsible]]></category>
		<category><![CDATA[jeni barnett]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[mmr]]></category>
		<category><![CDATA[scaremongering]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=64</guid>
		<description><![CDATA[This &#8220;TV presenter&#8221;, that&#8217;s right a tv presenter, not a doctor, biologist, nurse, pharmacologist or anything else meaningful is doing her bit to drive us back into the dark ages by spreading her uninformed propaganda on a radio show. I think she should be ashamed of herself, as should her production team, for spouting such [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=64&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This &#8220;TV presenter&#8221;, that&#8217;s right a tv presenter, not a doctor, biologist, nurse, pharmacologist or anything else meaningful is doing her bit to drive us back into the dark ages by spreading her uninformed propaganda on a radio show. I think she should be ashamed of herself, as should her production team, for spouting such misinformation. She is a danger to public health in the UK where this is a growing story. UKers can complain about Jeni Barnett’s MMR show of 7th January 2009 to <a class="postlink" rel="nofollow" href="http://www.ofcom.org.uk/complain/" target="_blank">OFCOM</a>.</p>
<p>This irresponsible scaremongering <a class="postlink" rel="nofollow" href="http://www.jenibarnett.com/" target="_blank">Jeni Barnett</a> was originally brought up by <a class="postlink" rel="nofollow" href="http://www.badscience.net/2009/02/legal-chill-from-lbc-973-over-jeni-barnetts-mmr-scaremongering/" target="_blank">Bad Science</a> blogger <a class="postlink" rel="nofollow" href="http://www.badscience.net/about-dr-ben-goldacre/" target="_blank">Dr Ben Goldacre</a> (someone actually qualified to comment) who posted the original audio. He got slapped with a cease and desist but the audio is spreading like wildfire. So<span style="font-weight:bold;"> <a class="postlink-local ymp-btn-page-play ymp-media-2de0cdb65a27b44c654c393ce9826150" href="http://www.dirtmind.com/videos/jeni-barnett-mmr-and-vaccination-slot-on-lbc.mp3">here it is<em class="ymp-skin"></em></a> </span>for your listening displeasure.</p>
<p>Perhaps her brain would be less addled if she ate less pies?</p>
<p><a class="postlink-local img_link" href="http://www.dirtmind.com/gallery/viewimage.php?uid=53&amp;gallery=sfw&amp;imageid=dirtmindimage_12342269270.jpg"><img style="width:410px;height:350px;" src="http://www.dirtmind.com/gallery/images/53/sfw/dirtmindimage_12342269270.jpg" alt="Image" /></a></p>
<p><img title="Snooty" src="http://www.dirtmind.com/forum/images/smilies/eusa_snooty.gif" alt="" /></p>
<p><a href="http://www.dirtmind.com/top_stories/jeni-barnett-scaremongering-about-mmr-on-the-radio-443.php" target="_blank">Comment anonymously here</a></p>
<br /> Tagged: bitch, crazy, irresponsible, jeni barnett, media, mmr, scaremongering <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=64&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/02/10/jeni-barnett-scaremongering-about-mmr-on-the-radio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.dirtmind.com/videos/jeni-barnett-mmr-and-vaccination-slot-on-lbc.mp3" length="42358491" type="audio/mpeg" />
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/gallery/images/53/sfw/dirtmindimage_12342269270.jpg" medium="image">
			<media:title type="html">Image</media:title>
		</media:content>

		<media:content url="http://www.dirtmind.com/forum/images/smilies/eusa_snooty.gif" medium="image">
			<media:title type="html">Snooty</media:title>
		</media:content>
	</item>
		<item>
		<title>How to sent a message to twitter using php</title>
		<link>http://dirtmind.wordpress.com/2009/02/09/how-to-sent-a-message-to-twitter-using-php/</link>
		<comments>http://dirtmind.wordpress.com/2009/02/09/how-to-sent-a-message-to-twitter-using-php/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 11:51:34 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=52</guid>
		<description><![CDATA[As part of the Integration of DirtMind with twitter I needed to send tweets to twitter from php to the anonymous @dirtythoughts account. Here&#8217;s how I did it         $username = 'dirtythoughts';         $password = 'yeahlikeimdumbenoughtoincludethathere';         // The message you want to send         $tweet = 'message that has been filtered [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=52&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As part of the <a href="http://dirtmind.wordpress.com/2009/02/09/integrating-a-website-with-twitter/" target="_blank">Integration</a> of <a href="http://www.dirtmind.com">DirtMind </a>with <a href="http://twitter.com">twitter</a> I needed to send tweets to twitter from php to the anonymous <a href="http://twitter.com/dirtythoughts" target="_blank">@dirtythoughts</a> account. Here&#8217;s how I did it</p>
<blockquote>
<pre>        $username = 'dirtythoughts';
        $password = 'yeahlikeimdumbenoughtoincludethathere';
        // The message you want to send
        $tweet = 'message that has been filtered for html and stuff';
        // The twitter API address
        $url = 'http://twitter.com/statuses/update.xml';
        // Set up and execute the curl process
        $curl_handle = curl_init();
        curl_setopt($curl_handle, CURLOPT_URL, "$url");
        curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl_handle, CURLOPT_POST, 1);
        curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$tweet");
        curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
        $buffer = curl_exec($curl_handle);
        curl_close($curl_handle);
        // check for success or failure
        if ((!empty($buffer))  &amp;&amp; (!$buffer))
        {
            $error[] = "There was an error while trying to talk to twitter";
            $error[] = "Twitter said: $buffer";
            $error[] = "Try again later!";
        }
	else if ($buffer)
	{
		$p = xml_parser_create();
		xml_parse_into_struct($p, $buffer, $vals, $index);
		$tweetid = $vals[3]["value"];
	}</pre>
</blockquote>
<p>This last bit about the  xml parser reads the return xml from twitter, when there hasn&#8217;t been an error and gets the tweetid. This is used to link to individual tweets on a twitter account like so &#8220;http://twitter.com/dirtythoughts/status/ + tweetid&#8221; so that once a user had tweeted using the DirtyThoughts anonymous account I could give them a <a href="http://twitter.com/dirtythoughts/status/1189397989" target="_blank">link to their tweet</a>.</p>
<br /> Tagged: anonymous, code, parser, php, twitter, xml <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=52&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/02/09/how-to-sent-a-message-to-twitter-using-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>
	</item>
		<item>
		<title>How to submit a post to phpbb3 by a different user</title>
		<link>http://dirtmind.wordpress.com/2009/02/09/how-to-submit-a-post-to-phpbb3-by-a-different-user/</link>
		<comments>http://dirtmind.wordpress.com/2009/02/09/how-to-submit-a-post-to-phpbb3-by-a-different-user/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 11:51:32 +0000</pubDate>
		<dc:creator>dirtmind</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Website Development]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpbb3]]></category>

		<guid isPermaLink="false">http://dirtmind.wordpress.com/?p=51</guid>
		<description><![CDATA[As part of the Integration of DirtMind with twitter I needed to be able to submit posts into my phpbb3 forum using a bot account to protect anonymity of my users when they&#8217;re tweeting their DirtyThoughts anonymously, and I didn&#8217;t want to use the anonymous/guest account because I wanted to generate hit counts etc. Here&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=51&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As part of the <a href="http://dirtmind.wordpress.com/2009/02/09/integrating-a-website-with-twitter/" target="_blank">Integration </a>of <a href="http://www.dirtmind.com">DirtMind </a>with <a href="http://twitter.com">twitter</a> I needed to be able to submit posts into my phpbb3 forum using a bot account to protect anonymity of my users when they&#8217;re tweeting their <a href="http://twitter.com/dirtythoughts">DirtyThoughts </a>anonymously, and I didn&#8217;t want to use the anonymous/guest account because I wanted to generate hit counts etc. Here&#8217;s how I did it</p>
<blockquote>
<pre>        $poll = $uid = $bitfield = $options = '';   
        generate_text_for_storage($twitter_status, $uid, $bitfield, $options, true, true, true);

        $data = array(
           'forum_id'      =&gt; 11, //the subforum that my DirtyThoughts thread is in
           'icon_id'      =&gt; false,
           'topic_id'      =&gt; 435, //the thread to reply to
           'poster_id'      =&gt; 146, //the id of the DirtyThoughts user              

           'enable_bbcode'   =&gt; true,
           'enable_smilies'   =&gt; true,
           'enable_urls'      =&gt; true,
           'enable_sig'      =&gt; true,

           'message'      =&gt; $twitter_status,
           'message_md5'   =&gt; md5($twitter_status),

           'bbcode_bitfield'   =&gt; $bitfield,
           'bbcode_uid'      =&gt; $uid,

           'post_edit_locked'   =&gt; 0,
           'topic_title'      =&gt; '',
           'notify_set'      =&gt; false,
           'notify'         =&gt; false,
           'post_time'       =&gt; 0,
           'forum_name'      =&gt; '',
           'enable_indexing'   =&gt; true,          
        );          
        //store current user
        $old_user_id=$user-&gt;data['user_id'];
        $old_username=$user-&gt;data['username'];       
        $old_usercol=$user-&gt;data['user_colour'];       
        //change to bot
        $user-&gt;data['username']='DirtyThoughts';
        $user-&gt;data['user_id']= 146;
        $user-&gt;data['user_colour']= '';
        //make post
        submit_post('reply', 'Dirty Thought', 'DirtyThoughts', POST_NORMAL, $poll, $data, '');    
        //restore user
        $user-&gt;data['username']=$old_username;
        $user-&gt;data['user_id']= $old_user_id;
        $user-&gt;data['user_colour'] = $old_usercol;</pre>
</blockquote>
<p>Interestingly the submit_post function always uses the current user object to make a post, regardless of the settings in $data. To get around this I store the current userid, name and colour in variables  and switch to the bot values to make the post before returning the current users settings to their normal values.</p>
<br /> Tagged: anonymous, code, php, phpbb3 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dirtmind.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dirtmind.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dirtmind.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dirtmind.wordpress.com&amp;blog=6277407&amp;post=51&amp;subd=dirtmind&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dirtmind.wordpress.com/2009/02/09/how-to-submit-a-post-to-phpbb3-by-a-different-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb81137ecfee45cabb9aff4edd803e8d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dirtmind</media:title>
		</media:content>
	</item>
	</channel>
</rss>
