A2S.in - Make Money Online - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
11946Views

Thread: [HELP] Java HTTP Bot

  1. #1
    Member
    Join Date
    May 2015
    Location
    The Netherlands
    Posts
    18
    Coins
    0
    Thumbs Up
    Received: 0
    Given: 0

    [HELP] Java HTTP Bot

    Dear A2S,

    I saw that there where a few HTTP Bots written in java I also want to build 1 but how to start of with the HTTP Request.
    Can I build a easy method for it or is there one? How should I start with building the bot? Is there someone that can give me a start?


    0 Not allowed! Not allowed!

  2. #2
    私は正義です Ryuzaki's Avatar

    Join Date
    Feb 2015
    Location
    In your NIGHTMARE
    Posts
    2,960
    Coins
    0
    Thumbs Up
    Received: 478
    Given: 122
    @Chillivanilli or @EdgarT can maybe help you

    0 Not allowed! Not allowed!

  3. #3
    Admin


    Join Date
    Dec 2014
    Posts
    200
    Coins
    6
    Thumbs Up
    Received: 44
    Given: 50
    There is no easy way to do this.
    You can look into this https://a2s.in/botting/1866-unibot-c...lkthrough.html
    Or if you want to learn about http requests in C# I can find well explained ebook

    0 Not allowed! Not allowed!

  4. #4
    Coder Chillivanilli's Avatar




    Join Date
    Jul 2014
    Posts
    1,200
    Coins
    103
    Thumbs Up
    Received: 273
    Given: 128
    Quote Originally Posted by OfficialJoe View Post
    Dear A2S,

    I saw that there where a few HTTP Bots written in java I also want to build 1 but how to start of with the HTTP Request.
    Can I build a easy method for it or is there one? How should I start with building the bot? Is there someone that can give me a start?
    Basicly I'm using this 2 classes for my Http requests:
    Honoki | Java HTTP Wrapper

    I edited them both a lot to fit my needs, but you can start with it. They have some disadvantages regarding cookies because the cookies are globally saved, not per domain.

    0 Not allowed! Not allowed!

  5. #5
    Member 12-6cloud's Avatar
    Join Date
    Apr 2015
    Posts
    53
    Coins
    4
    Thumbs Up
    Received: 5
    Given: 3
    I'm still new to screwing with http requests in java but maybe I can help you a little. (or confuse you :P)

    This might be difficult to grasp if you don't already understand http requests and what they are made of. You will need some way of viewing the http requests that are being sent before you can send one in java. Download Fiddler, or some tool, or use a network analyzer in your browser. Google Chrome has one built in if you look at the Network tab of inspect element. I use an add-on for Firefox called HttpFox. I like the way it's organized. :P

    I don't know how much you understand about http at the moment so here are some posts from @atheus that may help you understand. (or confuse you )
    HTTP Requests and GET and POST

    The best way to learn is probably just to screw around with it yourself. Look at http requests with Google Chrome(inspect element -> network) and try to understand how they are structured and what everything means. Once you think you understand HTTP requests you might be able to start using java to send these yourself.

    Here's a simple example on how you would send an http request in java and catch a response:



    This is a very simple example and doesn't involve sending any http headers along with it.

    It might be annoying since you probably don't understand what a URLConnection object is or a BufferedReader but you just need to screw around with it and this will become very easy for you.

    I hope I didn't confuse you haha :P

    0 Not allowed! Not allowed!

  6. #6
    Member
    Join Date
    Jul 2014
    Posts
    15
    Coins
    0
    Thumbs Up
    Received: 0
    Given: 0
    Quote Originally Posted by 12-6cloud View Post
    I'm still new to screwing with http requests in java but maybe I can help you a little. (or confuse you :P)

    This might be difficult to grasp if you don't already understand http requests and what they are made of. You will need some way of viewing the http requests that are being sent before you can send one in java. Download Fiddler, or some tool, or use a network analyzer in your browser. Google Chrome has one built in if you look at the Network tab of inspect element. I use an add-on for Firefox called HttpFox. I like the way it's organized. :P

    I don't know how much you understand about http at the moment so here are some posts from @atheus that may help you understand. (or confuse you )
    HTTP Requests and GET and POST

    The best way to learn is probably just to screw around with it yourself. Look at http requests with Google Chrome(inspect element -> network) and try to understand how they are structured and what everything means. Once you think you understand HTTP requests you might be able to start using java to send these yourself.

    Here's a simple example on how you would send an http request in java and catch a response:



    This is a very simple example and doesn't involve sending any http headers along with it.

    It might be annoying since you probably don't understand what a URLConnection object is or a BufferedReader but you just need to screw around with it and this will become very easy for you.

    I hope I didn't confuse you haha :P
    nice. commend yo code

    0 Not allowed! Not allowed!

  7. #7
    Member 12-6cloud's Avatar
    Join Date
    Apr 2015
    Posts
    53
    Coins
    4
    Thumbs Up
    Received: 5
    Given: 3
    Quote Originally Posted by atheus View Post
    nice. commend yo code
    It's not my code xD
    I stole it from the java documentation https://docs.oracle.com/javase/tutor...ngWriting.html

    0 Not allowed! Not allowed!

  8. #8
    Member
    Join Date
    May 2015
    Location
    The Netherlands
    Posts
    18
    Coins
    0
    Thumbs Up
    Received: 0
    Given: 0
    Quote Originally Posted by Chillivanilli View Post
    Basicly I'm using this 2 classes for my Http requests:

    I edited them both a lot to fit my needs, but you can start with it. They have some disadvantages regarding cookies because the cookies are globally saved, not per domain.
    But how would you invoke clicking buttons? Example your warofclicks bot.

    Quote Originally Posted by EdgarT View Post
    There is no easy way to do this.
    You can look into this
    Or if you want to learn about http requests in C# I can find well explained ebook
    I will talk to Chillivanilli about this situation in java. I hope I can contribute something ASAP also thanks for your offer in C# the only thing is I have more expierence in Java atm and for C# I need to download that heavy Visual Studio and Java is easy to run with eclipse for GUI or console

    0 Not allowed! Not allowed!

  9. #9
    Coder Chillivanilli's Avatar




    Join Date
    Jul 2014
    Posts
    1,200
    Coins
    103
    Thumbs Up
    Received: 273
    Given: 128
    Quote Originally Posted by OfficialJoe View Post
    But how would you invoke clicking buttons? Example your warofclicks bot.



    I will talk to Chillivanilli about this situation in java. I hope I can contribute something ASAP also thanks for your offer in C# the only thing is I have more expierence in Java atm and for C# I need to download that heavy Visual Studio and Java is easy to run with eclipse for GUI or console
    You just need a GUI and the bot needs to be run as a Thread. So if you click the start button in the GUI, the thread is started, if you click the stop button the thread is interrupted.

    0 Not allowed! Not allowed!

  10. #10
    Member
    Join Date
    May 2015
    Location
    The Netherlands
    Posts
    18
    Coins
    0
    Thumbs Up
    Received: 0
    Given: 0
    Quote Originally Posted by Chillivanilli View Post
    You just need a GUI and the bot needs to be run as a Thread. So if you click the start button in the GUI, the thread is started, if you click the stop button the thread is interrupted.
    Oke what did you use for GUI? Cause I liked that style just simple java style. But I mean I mean click buttons on the website for example on yout WOC bot clicking ads etc

    0 Not allowed! Not allowed!

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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