<?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>dogan kaya berktas &#187; Twitter Inc</title>
	<atom:link href="http://doganberktas.com/tag/twitter-inc/feed/" rel="self" type="application/rss+xml" />
	<link>http://doganberktas.com</link>
	<description>is actually from a small planet somewhere in the vicinity of Betelgeuse</description>
	<lastBuildDate>Thu, 26 Jan 2012 00:29:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Twitter oauth on GAE/J</title>
		<link>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/</link>
		<comments>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:22:03 +0000</pubDate>
		<dc:creator>dkberktas</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appengine-web.xml]]></category>
		<category><![CDATA[gae/j]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Google Inc.]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java platform]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter Inc]]></category>
		<category><![CDATA[twitter oauth]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://doganberktas.com/?p=212</guid>
		<description><![CDATA[Twitter supports oauth and there are many libraries for it, for  Java(twitter4J)(oauth-signpost),  most of the time you see examples of a desktop version, so it can take time to implement it on a web application (it did take time for my case). Step 1. Get a Twitter account and create a Twitter application from http://twitter.com/apps [...]]]></description>
			<content:encoded><![CDATA[<p>Twitter supports <a href="http://apiwiki.twitter.com/OAuth-FAQ">oauth </a>and there are many libraries for it, for  Java(<a href="http://twitter4j.org/en/index.html#introduction">twitter4J</a>)(<a href="http://code.google.com/p/oauth-signpost/">oauth-signpost</a>),  most of the time you see examples of a desktop version, so it can take time to implement it on a web application (it did take time for my case).</p>
<p>Step 1. Get a Twitter account and create a Twitter application from http://twitter.com/apps (don&#8217;t forget to check in browser and enter a  valid callback url. <a href="http://doganberktas.com/wp-content/uploads/2010/01/2.jpg"><img class="size-full wp-image-218 alignnone" title="2" src="http://doganberktas.com/wp-content/uploads/2010/01/2.jpg" alt="" width="523" height="536" /></a></p>
<p>Step 2.  Download <a href="http://twitter4j.org/en/index.html#download">twitter4J</a> add the library (in my case twitter4j-core-2.1.1-SNAPSHOT.jar) to project and update classpath</p>
<p>Step 3. Create a <a href="http://code.google.com/eclipse/docs/getting_started.html#creating">web application</a> (I assume you have the <a href="http://code.google.com/eclipse/">Google plugin for Eclipse </a>)</p>
<p><a href="http://doganberktas.com/wp-content/uploads/2010/01/1.jpg"><img class="size-full wp-image-219 alignnone" title="1" src="http://doganberktas.com/wp-content/uploads/2010/01/1.jpg" alt="" width="455" height="559" /></a></p>
<p>Step 4. Add the following servlets and update your web.xml. First servlet will handle login part. It will create a RequestToken which will create the magical aggrements between the consumer(your application) and provider(twitter). First servlet save the  token and secret token since we will need them later.</p>
<pre>String token = requestToken.getToken();
String tokenSecret = requestToken.getTokenSecret();
</pre>
<ul>
<li><a href="http://code.google.com/p/dogansartifacts/source/browse/trunk/GoogleAppEngineJava/TwiitterClient/src/a/b/c/server/HomeServlet.java">Home servlet</a></li>
<li><a href="http://code.google.com/p/dogansartifacts/source/browse/trunk/GoogleAppEngineJava/TwiitterClient/src/a/b/c/server/LoginServlet.java">Login Servlet</a></li>
</ul>
<p>Step 5. You forget to update web.xml didn&#8217;t you, update the web.xml</p>
<p>Step 6.  Enable <a href="http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions">session</a> by adding</p>
<pre>    &lt;sessions-enabled&gt;true&lt;/sessions-enabled&gt;
</pre>
<p>to appengine-web.xml.</p>
<p>You can see my version from <a href="http://90.latest.denemekaya.appspot.com/login">http://90.latest.denemekaya.appspot.com/login</a></p>
<p>ps. don&#8217;t forget to set the callback in Twittter to the url of the servlet for callback.</p>
<p>Links:</p>
<ul>
<li>http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/</li>
<li>Explain the same procedure with Grails &#8212; http://blogs.bytecode.com.au/glen/2009/12/08/log-into-your-grails-app-using-your-twitter-credentials.html</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://doganberktas.com/2010/01/26/using-twitter-oauth-on-gaej/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

