Results 1 to 9 of 9

Thread: Good Java Wrapper?

  1. #1

    Join Date
    Jan 2012
    Gender
    Location
    Atlanta
    Age
    25
    Posts
    136
    Thanks
    1,372
    Thanked 1,399 Times in 817 Posts


    Downloads
    85
    Uploads
    4
    Mentioned
    628 Post(s)
    Time Online
    14 d 7 h 24 m
    Avg. Time Online
    10 m
    Rep Power
    6

    Good Java Wrapper?

    I need a good Java wrapper


    Post/get, etc. You know Just the most recommended one!

  2. #2
    Reemer's Avatar
    Join Date
    Dec 2011
    Gender
    Location
    Iowa
    Age
    25
    Posts
    625
    Thanks
    348
    Thanked 414 Times in 242 Posts


    Downloads
    30
    Uploads
    9
    Mentioned
    200 Post(s)
    Time Online
    2 d 17 h 46 m
    Avg. Time Online
    2 m
    Rep Power
    8
    I sent you that tutorial br0, it had thr wrapper in it. Additionally I posted it in the wrapper thread on here.

    Edit: its in the source code sectionin the "various HTTP wrappers" thread
    Last edited by Reemer; 03-18-2012 at 11:05 PM.

  3. #3

    Join Date
    Jan 2012
    Gender
    Location
    Atlanta
    Age
    25
    Posts
    136
    Thanks
    1,372
    Thanked 1,399 Times in 817 Posts


    Downloads
    85
    Uploads
    4
    Mentioned
    628 Post(s)
    Time Online
    14 d 7 h 24 m
    Avg. Time Online
    10 m
    Rep Power
    6
    I use that one, just making sure

    I'm having a problem posting topics/replies on Neoboard with Java...



    I'm getting the whole:

    <div class="errormess" style="padding:10px;background-color:white;">
    <b>Error: </b>You have been directed to this page from the wrong place! If you <b>KEEP</b> getting this error, chances are you have some security settings enabled that are not letting you play Neopets correctly.<br><br>Click <a href="/security_settings.phtml"><b>here</b></a> to see some tips that might help you fix this problem.</div><div style="padding:10px;background-color:black;"><a href="javascript:history.back();" style="color:white" class="errormess"><b><span class="errorpointer">«</span> Back</b></a></div></div>
    </div>
    I know if I resend the headers with Live HTTPHeaders, it works. but if I visit the link directly on Neo, I get that....how do I get around it like everyone else does?
    Last edited by Ryan~; 03-18-2012 at 11:20 PM.

  4. #4
    Reemer's Avatar
    Join Date
    Dec 2011
    Gender
    Location
    Iowa
    Age
    25
    Posts
    625
    Thanks
    348
    Thanked 414 Times in 242 Posts


    Downloads
    30
    Uploads
    9
    Mentioned
    200 Post(s)
    Time Online
    2 d 17 h 46 m
    Avg. Time Online
    2 m
    Rep Power
    8
    That's usually a referral error, or the POST data isn't being sent correctly. I haven't used the Java wrapper very much though.

  5. #5

    Join Date
    Jan 2012
    Gender
    Location
    Atlanta
    Age
    25
    Posts
    136
    Thanks
    1,372
    Thanked 1,399 Times in 817 Posts


    Downloads
    85
    Uploads
    4
    Mentioned
    628 Post(s)
    Time Online
    14 d 7 h 24 m
    Avg. Time Online
    10 m
    Rep Power
    6
    It doesn't have an option for a referrer in the post data. There is a nother wrapper i've seen in some source just simply named HttpWrapper and the post looks like:

    strHTML = wrap.post("http://www.neopets.com/neoboards/process_topic.phtml" , "boardType=reply&topic_id="+ boardID + "&board_id="+ boardNumber + "&next=1&message="+ bumpMessage + "&remLen=" + ((Integer)(400 - charCountBM)).toString(), "http://www.neopets.com/neoboards/topic.phtml?topic=" + boardID);
    It's got the referrer right there at the end!

    ---------- Post added at 09:34 PM ---------- Previous post was at 09:23 PM ----------

    If anyone can help me, PM me

  6. #6
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 32 m
    Avg. Time Online
    16 m
    Rep Power
    14

  7. #7

    Join Date
    Jan 2012
    Gender
    Location
    Atlanta
    Age
    25
    Posts
    136
    Thanks
    1,372
    Thanked 1,399 Times in 817 Posts


    Downloads
    85
    Uploads
    4
    Mentioned
    628 Post(s)
    Time Online
    14 d 7 h 24 m
    Avg. Time Online
    10 m
    Rep Power
    6
    Anyone know how to use sockopens?

    Just something as simple as logging in?

  8. #8
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 32 m
    Avg. Time Online
    16 m
    Rep Power
    14
    I found that snippet... I can't get it to work for me.

    Quote Originally Posted by slimemonkey
    I fixed some major bugs, for example, the cookie handling system was all wrong with the other one, and added a few more features - a more complete and realistic header with referrers, so here is the finalized first version of my HTTP wrapper in Java.

    I didn't want to add this as a reply along with the other thread because this also has documentation and stuff.

    Here it is!

    If you feel motivated, or intrigued to, use this wrapper class, then (I would be overjoyed!) here is documentation on how to use the class.

    First, you need to instantiate an object/instance of the class:

    It is crucial to remember that the "<domain>" starts with "www." and ends with ".de/com/w/e else". NO "HTTP://" and NO ending it with "/"
    Example:
    www.google.com
    www.neopets.com
    After instantiating/declaring an object, there is only one major method to concern yourself with:

    This method only has 1 parameter. The argument is passed in a special way. I briefly explained this method in this thread.
    Basically, this parameter is a special kind of String. All the data for the parameter is stored in one string. The different details are part of the string, separated by the sequence "||".

    The different types of things that can be passed in as of now are: cookies, data (for POST variables), file/page, and method. I think it is easiest to understand this with examples:
    CODE
    .request("m:OST||f::index.phtml" );
    The above line will use the method POST and look for the file "index.phtml". Please note that it is NOT required to have a slash in front of the file section of the parameter. This is automatically taken care of inside the class..

    CODE
    .request("f::desert/shrine.phtml||m:OST||d: :type=approach");
    The above example would be used for going to Coltzan's shrine. The file it is trying to access is "desert/shrine.phtml". Again, notice that there is no "/" before "desert..". The method specified is "POST". The POST data that we are passing in is: "type=approach". Another important note: The order of the different data does NOT matter.

    The official function header:

    The returning string is the request along with the response.

    PS. Please comment on my cookie updating method...I think, even though it looks big and bulky, it is efficient and has O(n) runtime..I think. Please critique it.

    PPS. I will include GZip in the next version...or an updated version of this. I will also include ... fancy things...ideas are welcome.
    Not sure how reliable it is

  9. #9

    Join Date
    Jan 2012
    Gender
    Location
    Atlanta
    Age
    25
    Posts
    136
    Thanks
    1,372
    Thanked 1,399 Times in 817 Posts


    Downloads
    85
    Uploads
    4
    Mentioned
    628 Post(s)
    Time Online
    14 d 7 h 24 m
    Avg. Time Online
    10 m
    Rep Power
    6
    I saw that and didn't wanna bother with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •