boolean success;
try {
while(keyword != null) {
// look it up using the Wikipedia API
final HttpClient httpClient = new HttpClient(
"http://en.wikipedia.org/w/api.php?action=query&titles="
+ keyword.replace(' ', '_').replace("%", "%25")
+ "&prop=revisions&rvprop=content&format=xml");
final SAXParserFactory factory = SAXParserFactory.newInstance();
// Parse the input
final SAXParser saxParser = factory.newSAXParser();
saxParser.parse(httpClient.getInputStream(), this);
final String response = getText();
if (response.startsWith("#REDIRECT")) {
// extract the new keyword