package sample.org.itscool.rss;

import org.itscool.commons.document.RequestToXmlDocument;
import org.itscool.weber.action.Action;
import org.itscool.weber.action.ActionBucket;
import org.itscool.weber.controller.Globals;

public class RssXmlSampleAction extends Action {
    public static final String LINE=System.getProperty("line.separator");
    
    public String doExecute(ActionBucket bucket)throws Exception{
        String url = (String)this.getParameter("query");
        System.out.println(url);
        
        RequestToXmlDocument rssDocument = 	new RequestToXmlDocument(url);
        System.out.println(rssDocument.parseText("Shift_JIS"));
        
        bucket.printXml(rssDocument.getDocument());
        
        return Globals.RET_NOFORWARD;
    }
}