Twitter avatar servlet ver. 1.2


This servlet lets you display profile images from Twitter in your applications. For example, use URL like /servlet/twi/t411 as a reference for profile image Twitter user @t411

How to use this servlet:

a) download twiavatarPackage.jar and save it in WEB-INF/lib

b) describe this servlet in web.xml file. Servlet accepts the following initial parameters (optional):
proxyHost - Optional parameter. Describes a proxy host for your internet connection
proxyPort - Optional parameter. Describes a proxy port for your internet connection
defaultURL - Optional parameter. Describes a default URL for avatars

For example:
 


<servlet>
  <servlet-name>TwiAvatar</servlet-name>
  <servlet-class>com.jsos.twi.TwiAvatarServlet</servlet-class>
</servlet>

c) describe a mapping for this servlet in web.xml file. E.g.:
 


<servlet-mapping>
  <servlet-name>TwiAvatar</servlet-name>
  <url-pattern>/servlet/twi/*</url-pattern>
</servlet-mapping>

and now in your applications you can use it in your applications in the following form: /servlet/twi/screen_name_from_twitter. For example:
 


<img src="http://host/servlet/twi/t411">

Also you can describe the proxy settings for the servlet itself. Parameters are proxyHost and proxyPort. E.g.:
 


<servlet>
  <servlet-name>TwiAvatar</servlet-name>
  <servlet-class>com.jsos.twi.TwiAvatarServlet</servlet-class>
<init-param>
  <param-name>proxyHost</param-name>
  <param-value>192.168.0.1</param-value>
</init-param>

<init-param>
  <param-name>proxyPort</param-name>
  <param-value>8080</param-value>
</init-param>
</servlet>

   For downloading:

    Twitter avatar package:  twiavatarPackage.jar
 

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

     

Also in JSOS: