It seems a few people are interested in my code, it is also apparent that some people are not familiar with PHP.
I’ve thrown together a simple script to demonstrate how it should work.
With regards to PHP, it’s a server side language and so you need to be running a web server that can interpret the language. I run my code on a shared hosting package you can see it in action at http://fifasearch.com, for those who just want to play I’d advise installing XAMP on your local machine and playing with the code on there.
Once you’ve set-up your testing environment (that can read php files) head over to my GitHub page and download the latest files. Put them in the root directory of you’re webserver (for XAMP that is “\xampp\htdocs”) then create a new file called search.php and copy the following code into it:
<?PHP //we let PHP know what other files //we will be using in this script require_once('connector.php'); require_once('tradeor.php'); require_once('eahashor.php'); require_once('searchor.php'); //enter your username, password, secret answer in the variables below //should look something like //$user = "ea@ea.com"; //$password = "password"; //$secret = "secretquestion"; $user = ""; $password = ""; $secret = ""; //we call the eaEncode function from the EAHashor file $e = new EAHashor(); $hash = $e->eaEncode($secret); //display the hash on the screen echo "Your Hash: " . $hash . "<br />"; $c = new Connector($user, $password, $hash); $info = $c->connect(); //display the connection info on the screen echo "<br />Your Connection Details:<br />"; echo $info['EASW_KEY'] . "<br />"; echo $info['EASF_SESS'] . "<br />"; echo $info['PHISHKEY'] . "<br />"; echo $info['XSID'] . "<br />"; //we call the playersearch function from the Searchor file $s = new Searchor($info['EASW_KEY'], $info['EASF_SESS'], $info['PHISHKEY'], $info['XSID']); //we pass $s->playersearch a lot of variables //1. what number to start searching at //2. how many results do I want to get back (max 15) //3. what level is the player //4. what formation am I looking for //5. what position do they play //6. what nationality are they //7. what league do they play in //8. what team do they play for //9. minimum bid (this is not your offer) //10. maximum bid (this is not your offer) //11. minimum Buy It Now (this is not your offer) //12. maximum Buy It Now (this is not your offer) $search = $s->playersearch(0,1,'gold','f442','attacker','9','13','144','','','',''); //display the search results on the screen echo "<br />A Single Search Result: <br />" ; var_dump($search); //we call the trade function from the Tradeor file //we pass $t-trade() a trade id to lookup $t = new Tradeor($info['EASW_KEY'], $info['EASF_SESS'], $info['PHISHKEY'], $info['XSID']); $trade = $t->trade(18629464); //to bid 200 on the trade above you would use $t->bid(18629464, 200); //display the trade details on the screen echo "<br /><br />A Single Trade Detail: <br />" ; var_dump($trade); ?>
Once you’ve done that, open your browser and point it at the search.php page and you should now see some output.
The searched for player is Berbatov, so you can work out the variables from that piece of information.
Hello,
I saw you updated your hash function 1 hour ago but FYI, it is still not right.
Good luck.
Strange it works for me.
What issues are you having with it?
Here is an example,
My security question is leicester.
When I send it using the web app, it sends : 65b12668c7e181968a7cc4d598745bb4
But if I use your php script, it returns : 9e9ed2f06a35434814c54e96498c38ec
I’ve just run it with your secret question and the test code I posted above and I got the correct hash
This is crazy, I downloaded your file :
https://raw.github.com/mousey/FIFA13-Ultimate-Team-Search/master/code/eahashor.php
I wrote this piece of code :
$hash=new EAHashor();
echo $hash->eaEncode(“leicester”);
and I get this : 9e9ed2f06a35434814c54e96498c38ec
Awsome, thank you very much, your work is much appreciated 😉
Hey, i keep getting:
A Single Search Result:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
A Single Trade Detail:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
Can you help please ? thanks
I get as far as the connection show my variables back fine, but on the page I get back:
A Single Search Result:
bool(false)
A Single Trade Detail:
bool(false)
Any reason for that? 🙂
@Rob I’m experiencing the same behavior as yesterday. My demo code was basically the same as yours. The search result returns the values Jonas describes. I guess I’m getting an error code back from ea somewhere but I can’t find it in the reply. Line 150 in searchor.php ($EASSEARCH = curl_exec($ch);) seems to be empty for some reason.
@Medz @Jonas @Marc
What console do you play this on? if it’s not XBox then I think the issue is with connector.php which for now always seems to pick Xbox.
https://github.com/mousey/FIFA13-Ultimate-Team-Search/issues/3 details the issue and how to fix it. Let me know if that works.
@fut
not sure what to suggest, I ran it again this morning and got the correct hash
This is a real headache for me !
You did not any change to your code that you did not commit to github ?
I will try again, deleting the class on my server, re-uploading it and re-writing a sample code
Well, still no luck, if you want to see what’s happening, you can check it here :
http://maillots-nantes.fr/fut/hash?str=leicester
it shows the difference between EA’s js hash and your hash.
@Rob the fix for connector.php allows to connect (already fixed that yesterday) but search still comes up empty. I also tried the credits function in functionor.php and it also comes up empty. Probably something is still wrong with curl and/or http headers.
By the way, thanks for all your effort so far!
I had some issues with ssl and curl in earlier projects and so I added these two lines to searchor.php (I also had to add this to connector.php):
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
Now at least I get a response:
string(54) “{“message”:null,”reason”:”expired session”,”code”:401}”
2 questions mate,
1. How can I adapt this for consumables such as contract cards for both bid and buy now?
2. How do you get this script to run constantly instead of just once?
I get this error now after making search.php and filling in my account details.
A Single Search Result:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
A Single Trade Detail:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
Why has my prev 2 posts here been deleted?
Oh nevermind, stupid browser playing up, sorry.
Still need help putting all of this together.
A Single Search Result:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
A Single Trade Detail:
string(53) “{“message”:null,”reason”:”Invalid Cookie”,”code”:482}”
[…] Published Using my FIFA13 code. […]
Hi,
First of all I would like to thank Rob for sharing this code. I’d be glad to help everyone out to get this code running.
The correct hash for the answer of the secret question ‘leicester’ = 65b12668c7e181968a7cc4d598745bb4. For now it’s better to hardcode it in your script I think.
I’m still not able to effectively run the searchor code because I get a lot of undefined offset errors in connect file. My account is created on a Xbox 360, so that should be no problem.
Does anyone have a clue what the problem can be?
Thanks in advance,
John
Just a moment ago, I got this code running. I get some information about the Berbatov’s on the market. I’m wondering if it would be hard to create a function that will execute the search around the 59th minute.
Really great stuff Rob, i stumbled upon some of your earlier posts and was able to get up and running very easily with you files! About the only point of confusion i ran into was not noticing that the search results were returned as JSON and then figuring out which search fields use strings and which use enums, but using the real FUT web app w/ a header reader is clearing that up mostly.
Do you know what would be required to quicksell a card in my watch list? I think they call it discarding behind the scenes and i looks like you might be able to get the tradeId from the watchlist(i haven’t tried to do this programattically yet, but there looked like a pretty sensible url popping up when i looked at the http hearders when quick selling something).
Would love to hear your thoughts on this.
Keep up the good work!
-Skyler
Anyone had success converting this php code to c#?
I copied and pasted all your code and trying to run the above file under xamp, but I get the following errors:
Notice: Undefined offset: 1 in C:\xampp\htdocs\fut\connector.php on line 58
Notice: Undefined offset: 7 in C:\xampp\htdocs\fut\connector.php on line 62
Notice: Undefined offset: 1 in C:\xampp\htdocs\fut\connector.php on line 63
Notice: Undefined offset: 8 in C:\xampp\htdocs\fut\connector.php on line 66
Notice: Undefined offset: 1 in C:\xampp\htdocs\fut\connector.php on line 67
Notice: Undefined offset: 1 in C:\xampp\htdocs\fut\connector.php on line 71
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\fut\connector.php on line 128
Notice: Undefined offset: 6 in C:\xampp\htdocs\fut\connector.php on line 192
Notice: Undefined offset: 1 in C:\xampp\htdocs\fut\connector.php on line 193
Your Connection Details:
Content-Length: 0
A Single Search Result:
bool(false)
A Single Trade Detail:
bool(false)
@John: What did you do to solve the undefinded offset errors in connector?
@Rob I solved my issue… after looking into the headers I noticed that my searchurl is different than in the code.
I had to change https://utas.fut.ea.com/ut/game/fifa13/auctionhouse? into https://utas.s2.fut.ea.com/ut/game/fifa13/auctionhouse? and now everything works. I wonder if the url is dynamic or if it’s tied to a console or country. Anyway, it works 🙂
Is this for PS3 or XBOX?
After opening search.php I get my Hash and my Connection Details.
+ the following:
Content-Type: application/json;charset=utf-8
A Single Search Result:
string(54) “{“message”:null,”reason”:”expired session”,”code”:401}”
A Single Trade Detail:
string(54) “{“message”:null,”reason”:”expired session”,”code”:401}”
So far so good, but what to do now?
Would be great if you could help me.
Hey Rob,
is there any possibility to buy a complete working Autobuyer from you?
I think it’s time we put our knowledge together. We need to make a User Interface and I think we need a database with all the player names link to the player ID’s.
Somehow I’m getting the keys but can’t get past the phishing key. $EAVALIDATE is now returning:
{“debug”:””,”string”:”Unauthorized (ut)”,”reason”:””,”code”:”401″}
Anyone can help?
I agree with John, we should all try and make a working programme for us all to use, I have a database with last year’s players from an auto buyer would that be hepful?
I have downloaded the xampp but i have no idea how to use it and also how to use the code etc
This is the 1st time im using this.
Someone help !
What is wrong with this ?
Your Hash: ecdbcd98b225ffa56118ef4e07bf66c6
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 58
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 62
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 63
Notice: Undefined offset: 8 in C:\xampp\htdocs\xampp\connector.php on line 66
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 67
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 71
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\xampp\connector.php on line 128
Notice: Undefined offset: 6 in C:\xampp\htdocs\xampp\connector.php on line 192
Notice: Undefined offset: 1 in C:\xampp\htdocs\xampp\connector.php on line 193
Your Connection Details:
Content-Length: 0
A Single Search Result:
bool(false)
A Single Trade Detail:
bool(false)
Got the Undefined offset: error.
Anyone got any idea?
Sorry to double post but Simon/John how did you lads manage to get that sorted?
first of all, thanks a lot for your work rob
new eahashor still not working
Rob, what is the url to put into a cURL init to post an auction on the auction house? can you please comment with that code???
This returns a 500 error
If anyone can help me on this I cannot seem to post an auction
here is my debug { [“debug”]=> string(0) “” [“string”]=> string(26) “Internal Server Error (ut)” [“reason”]=> string(0) “” [“code”]=> string(3) “500” }
AND CODE:
$searchurl = “https://utas.fut.ea.com/ut/game/fifa13/auctionhouse?”;
for($w = 1; $w “150”, “duration” => “3600”, “startingBid” => “150”, “itemData” => array(“id” => $id[$w]));
$data_string = json_encode($data);
$cookie_string = $this->EASW_KEY.”; “.$this->EASF_SESS .”; “.$this->PHISHKEY;
$ch = curl_init($searchurl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘x-http-method-override: POST’,
$this->XSID)
);
$bid = curl_exec($ch);
$Bid[$w] = json_decode($bid);
curl_close($ch);
sleep(.5);
}
$aBid = array(‘num’ => $ii, ‘Bid’ => $Bid);
return $aBid;
Has anyone been able to buy a card using this? I have this code:
$t = new Tradeor($info[‘EASW_KEY’], $info[‘EASF_SESS’], $info[‘PHISHKEY’], $info[‘XSID’]);
$trade = $t->bid($tid, 300);
where $tid is an existing trade id (my own card). I’ve also changed the urls to the ps3 versions in the tradeor.php
Hi I have an error:
Warning: Division by zero in C: \ xampp \ htdocs \ eahashor.php on line 300
Your Hash: 0bf52a1e66b99aa335bbba167254328e
Fatal error: Call to undefined function curl_init () in C: \ xampp \ htdocs \ connector.php on line 45
Hey guys.
Just a hint to make the developement much easier.
Use Firefox and the firebug plugin.
There you can see all requests made by the app.
In some cases there are special behaviours e.g. some pile changes need just the resourceId while other also needs the tradeId.
Furthermore an important thing for the curl_setopt:
If you still get an error add also this one:
//Important for https
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
not work ç_ç
Your Hash: 26aad7ee1aa15d7707624d2069dbc497
Notice: Undefined offset: 1 in C:\xampp\htdocs\connector.php on line 58
Notice: Undefined offset: 7 in C:\xampp\htdocs\connector.php on line 62
Notice: Undefined offset: 1 in C:\xampp\htdocs\connector.php on line 63
Notice: Undefined offset: 8 in C:\xampp\htdocs\connector.php on line 66
Notice: Undefined offset: 1 in C:\xampp\htdocs\connector.php on line 67
Notice: Undefined offset: 1 in C:\xampp\htdocs\connector.php on line 71
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 127
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 128
Notice: Trying to get property of non-object in C:\xampp\htdocs\connector.php on line 128
Notice: Undefined offset: 6 in C:\xampp\htdocs\connector.php on line 192
Notice: Undefined offset: 1 in C:\xampp\htdocs\connector.php on line 193
Your Connection Details:
Content-Length: 0
A Single Search Result:
bool(false)
A Single Trade Detail:
bool(false)
@Marc
how did you found this adress?
https://utas.s2.fut.ea.com/ut/game/fifa13/auctionhouse?
@rob could you drop me a mail? I’ve found why and when the url changes.
@Markus, do you know how to quicksell/discard an item? I’ve inspected the hearders when i quick sell but haven’t had much luck finding the key parts yet.
@markus, on the web app, how come I can tamper the request to post auctions at 150/150Bin yet with the script my 150/150Bin requests return a 500 error and 150/200 requests go through? Is it an issue with the amount of HTTP headers, or the cookie string not including all 15+ cookies only the 4 necessary ones?