The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 573 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 752 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.4.12 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5327 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 5327 errorHandler->error
/global.php 1024 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined variable $postsdone - Line: 906 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 906 errorHandler->error
Warning [2] Undefined array key 89193 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89194 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89195 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89202 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89233 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89235 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89366 - Line: 912 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 912 errorHandler->error
Warning [2] Undefined array key 89193 - Line: 1643 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 1643 errorHandler->error
/showthread.php 924 buildtree
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 925 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "showimages" - Line: 811 - File: inc/functions_post.php PHP 8.4.12 (Linux)
File Line Function
/inc/functions_post.php 811 errorHandler->error
/showthread.php 925 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1568 - File: showthread.php PHP 8.4.12 (Linux)
File Line Function
/showthread.php 1568 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 33 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $multipage - Line: 36 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 36 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $ratethread - Line: 41 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 41 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $multipage - Line: 68 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 68 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 82 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $thread_deleted - Line: 104 - File: showthread.php(1600) : eval()'d code PHP 8.4.12 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 104 errorHandler->error
/showthread.php 1600 eval




Extreme Makeover Buildism Edition.
#5
I finished the httpGet

Root:
Code:
addFunction("httpGet", new JavaFunction()
        {

            public int call(LuaCallFrame callFrame, int nArguments) {
                if(nArguments != 2 || !(callFrame.get(1) instanceof String))
                        throw new RuntimeException("Argument to httpGet() must be a string");
                    web web=new web();
                    String url = (String) callFrame.get(1);
                   web.set(url);
                    callFrame.push(web.getNoReplace());
                    return 1;
            }
        });

dig.web:
Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dig;

import java.net.*;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
*
* @author roperson
*/
public class web {
    static URL url;
    
    public static void set(String URL) {
        try {
            // try {
                 //URLEncoder.encode(URL, "UTF-8");
             URL=URL.replaceAll(" ", "+");
             URL=URL.replaceAll(",", "%2C");
             if (URL.startsWith("http://")) {
                 URL.replaceFirst("http://", "");
             }
               URL url2=new URL("http://"+URL);
               url=url2;
        } catch (MalformedURLException ex) {
            throw new RuntimeException("Argument was formatted incorrectly.");
        }
  }
    
      public static String getNoReplace() {
        try {
            String buffer;
            String line;
            int responseCode;
            HttpURLConnection connection;
            InputStream input;
            BufferedReader dataInput;
            connection = (HttpURLConnection) url.openConnection();
            responseCode = connection.getResponseCode();
            if (responseCode != HttpURLConnection.HTTP_OK) {
                    throw new RuntimeException("HTTP response code: " +String.valueOf(responseCode));
            }
            try {
              buffer = new String();
              input = connection.getInputStream();
              dataInput = new BufferedReader(new InputStreamReader(input));
              while ( (line = dataInput.readLine()) != null) {
                buffer=buffer+line;
              }
              input.close();
            }
            catch (Exception ex) {
              ex.printStackTrace(System.err);
              return null;
            }
            return buffer;
        } catch (IOException ex) {
            ex.printStackTrace(System.err);
            return null;
        }
  }

  public static String get() throws Exception {
    String buffer;
    String line;
    int responseCode;
    HttpURLConnection connection;
    InputStream input;
    BufferedReader dataInput;
    connection = (HttpURLConnection) url.openConnection();
    responseCode = connection.getResponseCode();
    if (responseCode != HttpURLConnection.HTTP_OK) {
      throw new Exception("HTTP response code: " +
                          String.valueOf(responseCode));
    }
    try {
      buffer = new String();
      input = connection.getInputStream();
      dataInput = new BufferedReader(new InputStreamReader(input));
      while ( (line = dataInput.readLine()) != null) {
        buffer=line;
      }
      input.close();
    }
    catch (Exception ex) {
      ex.printStackTrace(System.err);
      return null;
    }
    return buffer;
  }
  
  public static void send() throws Exception {
      get();
  }
  
  public static void send(String url) throws Exception {
      set(url);
      get();
  }
}
[Image: 2eehsib.gif]
Reply


Messages In This Thread
Extreme Makeover Buildism Edition. - by When - 08-18-2012, 01:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)