Package fr.eolya.utils

Examples of fr.eolya.utils.ScriptSnippet


            System.out.println("Url            = " + url);
            System.out.println("Scripts Path   = " + scriptsPath);
            System.out.println("Action         = " + action);
            System.out.println("Script name    = " + getScriptName(scriptsPath, url));
           
            ScriptSnippet snippet = getScriptSnippet(getScriptName(scriptsPath, url), action, url);
            if (snippet!=null)
                System.out.println("Script snippet = found");
            else
                System.out.println("Script snippet = none");
            System.out.println("------------------------------------------------------------");
View Full Code Here


        if (scriptName==null) return "";
        return scriptName;
    }
   
    static public ScriptSnippet getScriptSnippet(String scriptName, String action, String url) {
        ScriptSnippet scriptSnippet = null;
        if (scriptName !=null && !"".equals(scriptName)) scriptSnippet = ScriptSnippet.getInstance (scriptName, url, action);
        return scriptSnippet;
    }
View Full Code Here

   
    static public String[] htmlLinks(String url, String rawPage, String[] inLinks, String scriptsPath, String scriptName) {
        if (scriptName==null || "".equals(scriptName))
            scriptName = getScriptName(scriptsPath, url);
       
        ScriptSnippet scriptSnippet = getScriptSnippet(scriptName, "links", url);
        if (scriptSnippet==null) return inLinks;
       
        String engineName = scriptSnippet.getEngineName();
        String code = scriptSnippet.getCode();
       
        ScriptEngineManager factory = new ScriptEngineManager();
        ScriptEngine engine = factory.getEngineByName(engineName);
       
//        ScriptsWrapperHelper helper = new ScriptsWrapperHelper(engine);
View Full Code Here

    static public HashMap<String, String> htmlParse(String url, String rawPage, String contentType, String scriptsPath, String scriptName) {
       
        if (scriptName==null || "".equals(scriptName))
            scriptName = getScriptName(scriptsPath, url);
       
        ScriptSnippet scriptSnippet = getScriptSnippet(scriptName, "parse", url);
        if (scriptSnippet!=null) {
           
            String engineName = scriptSnippet.getEngineName();
            String code = scriptSnippet.getCode();
           
            ScriptEngineManager factory = new ScriptEngineManager();
            ScriptEngine engine = factory.getEngineByName(engineName);
           
            Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
View Full Code Here

    static public HashMap<String, String> cleanText(String url, String text, String scriptsPath, String scriptName) {
       
        if (scriptName==null || "".equals(scriptName))
            scriptName = getScriptName(scriptsPath, url);
       
        ScriptSnippet scriptSnippet = getScriptSnippet(scriptName, "cleantext", url);
        if (scriptSnippet!=null) {
           
            String engineName = scriptSnippet.getEngineName();
            String code = scriptSnippet.getCode();
           
            ScriptEngineManager factory = new ScriptEngineManager();
            ScriptEngine engine = factory.getEngineByName(engineName);
           
            Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
View Full Code Here

    static public HashMap<String, String> extractMeta(String url, String rawPage, String contentType, String contentCharset, String scriptsPath, String scriptName, boolean lowercase) {
       
        if (scriptName==null || "".equals(scriptName))
            scriptName = getScriptName(scriptsPath, url);
       
        ScriptSnippet scriptSnippet = getScriptSnippet(scriptName, "extractmeta", url);
        if (scriptSnippet!=null) {
           
            String engineName = scriptSnippet.getEngineName();
            String code = scriptSnippet.getCode();
           
            ScriptEngineManager factory = new ScriptEngineManager();
            ScriptEngine engine = factory.getEngineByName(engineName);
           
            Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);
View Full Code Here

TOP

Related Classes of fr.eolya.utils.ScriptSnippet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.