Skip to content

Instantly share code, notes, and snippets.

@phstudy
Created December 7, 2012 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phstudy/4232986 to your computer and use it in GitHub Desktop.
Save phstudy/4232986 to your computer and use it in GitHub Desktop.
Twitter4j Scriptlet version
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="twitter4j.Twitter"%>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>Sign in with Twitter example</title>
</head>
<body>
<%
if(null == session.getAttribute("twitter")) {
%>
<a href="signin"><img src="./images/Sign-in-with-Twitter-darker.png"/></a>
<%
}
if(null != session.getAttribute("twitter")) {
Twitter twitter = (Twitter)session.getAttribute("twitter");
%>
<h1>Welcome <%=twitter.getScreenName()%> (<%=twitter.getId()%>)</h1>
<form action="./post" method="post">
<textarea cols="80" rows="2" name="text"></textarea>
<input type="submit" name="post" value="update"/>
</form>
<a href="./logout">logout</a>
<%
}
%>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment