Bonsoir.

Je récupère une page qui contient des côtes de paris sportifs.
Par défaut, les côtes sont de type fraction. Or j'ai besoin de les avoir en décimal.

Le type de côtes à afficher se trouve dans un cooky.

J'ai donc essayer de spécifier un fichier cooky mais sans succés.
Le header de la page récupérée contient toujours la valeur par défaut : ODDS (fraction). Le voici :
Code X : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
HTTP/1.0 200 OK
Date: Thu, 15 Feb 2007 00:52:16 GMT
Server: Microsoft-IIS/6.0 BetApp/1.91
Expires: 0
Pragma: no-cache
Set-Cookie: EXT_AFF=; path=/
Set-Cookie: FLAGS=en|en|uk|default|ODDS|0|GBP; path=/; expires=Sat, 01 Jan 3000 00:00:00; domain=ladbrokes.com
Set-Cookie: LANG=en; path=/; expires=Sat, 01 Jan 3000 00:00:00
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Pragma: no-cache
Content-Type: text/html; charset=iso8859-1
Connection: close

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $book_odds_url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cache/cooky.txt');
curl_exec($ch);
curl_close($ch);
et mon fichier cooky.txt
Code X : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
www.ladbrokes.com	FALSE	/	FALSE	1203016746	SYS_SOURCE	OBS_WEB
.ladbrokes.com	TRUE	/	FALSE	1198885620	STATUS	0%7C0%7C0%7C0
.ladbrokes.com	TRUE	/	FALSE	32504284980	FLAGS	en|en|uk|default|DECIMAL|1|EUR
www.ladbrokes.com	FALSE	/	FALSE	32504284817	LANG	en
www.ladbrokes.com	FALSE	/	FALSE	1577836800	CP	null*
www.ladbrokes.com	FALSE	/	FALSE	1174072735	flash_version	6