PDA

View Full Version : [JAVA] Sean's wrapper help



Rambo
03-08-2014, 03:35 PM
I am working of a marabot of sorts. Heres the code so far:


private int marabot(){
Connection neo = new Connection("[Only registered and activated users can see links]"); // makes new object
jLabel2.setText("Established Connection...");
jLabel2.repaint();
jTextArea1.setText(neo.post("/dologin.php", new String [][] {{"id", "USERIDINSERT"}, {"password", "insert password"}})); //login
jLabel2.setText("Logged in...");
jLabel2.repaint();
String strHTML = neo.get("/countdown.php");
// plushie machine
if(strHTML.contains("You can use the Plushie Machine now"))
{
neo.get("[Only registered and activated users can see links]");
jLabel2.setText("Did Plushie Machine");
jLabel2.repaint();

}
return 0;
}



The login command doesnt work. In Python login works with this request:

values = {'id' : "useridinsert", 'password' : "passinsert"}
Zachafer

j03
03-08-2014, 03:38 PM
So your labels aren't updating? Did you try saving the response as an HTML file to see what exactly is going on?

Also I would recommend to have this all in something other than an integer... perhaps a boolean to return true if the login worked? Rambo

Rambo
03-08-2014, 03:47 PM
Yes Infamous Joe, I checked the HTML and it didn't work. Its going to eventually run through all the dailes, and all users, so what the function returns is not important.