Posts Tagged API
Twitter client with Spring Social
Posted by Dirk Dresselhaus in Projects on 2013-05-16
Integrating social network activity into (customer) websites and because I have been using the Spring Framework and also Spring MVC and Spring Security for a long time, I decided to take a closer look at the Spring Social project. So I created a small application that should just display the timeline of my Twitter accounts and have the possibility to post something quickly.
- Social app
Social app displaying Twitter homefeeds with images
Yes, I know my .css skills are incredible.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | @Controller public class AuthController { private OAuth1Operations oauthOperations; private OAuthToken requestToken; @RequestMapping(value = "/connect", method = RequestMethod.GET) public String connect() { TwitterConnectionFactory connectionFactory = new TwitterConnectionFactory(CONSUMER_KEY, CONSUMER_SECRET); oauthOperations = connectionFactory.getOAuthOperations(); requestToken = oauthOperations.fetchRequestToken("http://localhost:8080/callback", null); String authorizeUrl = oauthOperations.buildAuthorizeUrl(requestToken.getValue(), OAuth1Parameters.NONE); return "redirect:" + authorizeUrl; } @RequestMapping(value = "/callback") public @ResponseBody OAuthToken callback(@RequestParam(value = "oauth_token") String oauthToken, @RequestParam(value = "oauth_verifier") String oauthVerifier) { OAuthToken accessToken = oauthOperations.exchangeForAccessToken(new AuthorizedRequestToken(requestToken, oauthVerifier), OAuth1Parameters.NONE); return accessToken; } } |
LOTROArmory
Posted by Dirk Dresselhaus in Projects on 2013-03-22
I wanted to test the Java framework Vaadin and to make this more interesting (and perhaps somehow useful), I decided to implement the data.lotro.com-API of the game The Lord of the Rings Online by Turbine and create an armory/arsenal where the user can easily compare characters. I chose Castor XML as XML framework.
Unfortunatelly the data.lotro.com-API is not always accessable and sometimes disabled by Turbine, so that it is not possible to get information from the server. Because of that I recently implemented a method to load “old” data from the local database by enabling the checkbox “Use local database”.
Furthermore the API is also not complete and not able to provide all data (e.g. newer items are often unavailable).
- LOTROArmory: display character info
LOTROArmory: display character info of "Gorothir"
- LOTROArmory character compare
LOTROArmory comparing characters in internal frames
- LOTROArmory display kinship information
LOTROArmory display kinship information of "Gwend en Ithil"
Possible test data:
Server: [DE-RP] Belegaer
Character: Gorothir
Enable checkbox “Use local database” if error occurs (which means that the data.lotro.com-API is not available at this moment).
Link to LOTROArmory (no longer online)