<?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>Refresh &#187; google appengine</title>
	<atom:link href="http://www.refresh.dk/topic/google-appengine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.refresh.dk</link>
	<description>Web programming for practitioners</description>
	<lastBuildDate>Sun, 02 May 2010 16:25:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Announcing TwitterEngine: Your own twitter aggregation site on AppEngine</title>
		<link>http://www.refresh.dk/twitterengine/</link>
		<comments>http://www.refresh.dk/twitterengine/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 09:27:41 +0000</pubDate>
		<dc:creator>Steffen Tiedemann Christensen</dc:creator>
				<category><![CDATA[Open Web]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[google appengine]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.refresh.dk/twitterengine/</guid>
		<description><![CDATA[About a week ago some friends launched Twittertinget.dk, a sleek app that aggregates tweets from politicians in the Danish parliament. In the name of democracy, the web application has a vital flaw though: It only lists tweets from politician, not to them. That makes for one-sided communication. 
As a friendly gesture, Socialsquare asked me to [...]]]></description>
			<content:encoded><![CDATA[<p>About a week ago <a href="http://detersmart.dk">some</a> <a href="http://www.wemind.dk">friends</a> launched <a href="http://www.twittertinget.dk">Twittertinget.dk</a>, a sleek app that aggregates tweets from politicians in the Danish parliament. In the name of democracy, the web application has a vital flaw though: It only lists tweets <i>from</i> politician, not <i>to</i> them. That makes for one-sided communication. </p>
<p>As a friendly gesture, <a href="http://www.socialsqaure.dk">Socialsquare</a> asked me to create a complementary service, which does the exact opposite thing: Let&#8217;s you know what people are tweeting to their elected representatives. This ended up in <a href="http://www.folketwinget.dk">Folketwinget.dk</a>, a simple site hosted on <a href="http://code.google.com/appengine">Google AppEngine</a>.</p>
<p>Now, aggregating tweets to and from the Danish Folketing seems like a faily specific, but it turns out that such an aggregator of can easily be used by any other group &#8212; so we&#8217;ve open sourced the code <a href="http://github.com/steffentchr/TwitterEngine">over on Github</a>. The code runs directly on AppEngine so it&#8217;s easy to host and have running in a few minutes.</p>
<p>For example, if you have a company called <a href="http://www.23visual.com">23</a> with a few employees on Twitter it might be cool to show all the incoming and outgoing tweets from the company. </p>
<p>Get started by  <a href="http://code.google.com/intl/da/appengine/downloads.html">installing the Google AppEngine SDK</a>, start up a terminal and browse to the AppEngine folder on your local machine. Then&#8230;</p>
<p><b>1. Get the code</b><br />
Run this command to download the code. (Obviously, you&#8217;ll want to change the folder name from <tt>23tweets</tt> to something else.)<br />
<code>git clone git://github.com/steffentchr/twitterengine.git 23tweets</code></p>
<p><b>2. Update <tt>app.yaml</tt> and create <tt>config.yaml</tt></b><br />
Open up the file called <tt>app.yaml</tt> in the newly created folder and change the application name in the very first line of the file. In this example, we&#8217;ll change it from <tt>twitterengine</tt> to <tt>23tweets</tt> </p>
<p>Also, rename the file called <tt>config.yaml.sample</tt> to <tt>config.yaml</tt> </p>
<p><b>3. Create an AppEngine project</b><br />
Open up GoogleAppEngineLauncher (it&#8217;s called that on Mac anyway). Right-click in the window and select &#8220;Add existing..&#8221;. Now select the folder we&#8217;ve just created and click OK. </p>
<p>This is all you need to actually get the application up-and-running. Click the Run icon to start your development server and open up http://localhost:8000 in a browser. </p>
<p><b>4. Configure the application for your dirty purposes</b><br />
Before you can import some tweets into your application you will need to update the configuration. Open up config.yaml in a text editor and change what you think is necessary. For my example, I&#8217;ll use this configuration:</p>
<p><code>
<pre>site_name: 23 tweets
site_tag_line: What is up with 23?
site_domain: 23tweets.appsport.com

twitter_username: 23pull
twitter_password: secretpassword

users:
- steffentchr
- mygdal
- mmmmmariaaaaa
- abemad
- guan
- burtblancher
- 23

hashes:
- 23
- 23hq
- twentythree</pre>
<p></code></p>
<p>Basically: Use the user account of <tt>23pull</tt> to get all tweets to and from @steffentchr, @mygdal, etc and all tweets with the hash <tt>#23</tt>. Then call the site &#8220;23 tweets&#8221;.</p>
<p>(This could just as easily have been used to create <a href="http://twitter.com/sindre/status/1396304732">a Folketwinget-sibbling for the Norwegian parliament</a> or for aggregating conversations of everything involved in a specific open source community.) </p>
<p><b>4b. Import the tweets</b><br />
Now, go to <tt>http://localhost:8080/import</tt> to trigger an import of everything specified in the config file. When you return to  <tt>http://localhost:8080/</tt> you should see all a batch of the latest twitterings. </p>
<p>When you&#8217;ve finished step 5., the application will automatically import tweets every five minutes. The frequency can be changed by editing <tt>cron.yaml</tt>.  </p>
<p><b>5. Deploy your app</b><br />
Before you can deploy your new twitter aggregator to the wide web, you will need to create the application with Google. Go to <a href="http://appengine.google.com/">the AppEngine dashboard</a>, click the &#8220;Create an application&#8221; button and fill in the form. Remember to use the correct application identifier, i.e. <tt>23tweets</tt>.</p>
<p>When your application has been succesfully created, go back to GoogleAppEngineLauncher and right-click your project. Then select the deploy option and sign in to your Google account. That&#8217;s it. It&#8217;s online.</p>
<p>Again, you&#8217;ll need to visit <tt>http://<b>projectname</b>.appspot.com/import</tt> to import tweets into the online database and then go to <tt>http://<b>projectname</b>.appspot.com/</tt> to see the result.</p>
<p><b>6. Customizing the design</b><br />
You&#8217;ll find that your site is in Danish and generally doesn&#8217;t look the way you want it to. Changing the design though is fairly easy: Modify <tt>index.html</tt> and <tt>resources/style.css</tt> for your purposes. If you need anything fancy, the html file is structured using <a href="http://www.djangobook.com/en/beta/chapter04/">the Django templating system</a>.</p>
<p><b>Update April 24th 2009:</b> Originally, this post contained information for running external cron jobs to import tweets. Today, the code has been updated to utilize AppEngine&#8217;s new native cron feature which makes it all happend automagically.</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.refresh.dk/twitterengine/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
