Skip to content

Instantly share code, notes, and snippets.

@xAlstrat
Created December 23, 2015 21:46
Show Gist options
  • Save xAlstrat/29a4b01cd5b2c153f9a6 to your computer and use it in GitHub Desktop.
Save xAlstrat/29a4b01cd5b2c153f9a6 to your computer and use it in GitHub Desktop.
<?php
include_once 'config.php';
include_once $CONTROLLER_ROOT.'/Util/simple_html_dom.php';
include_once $CONTROLLER_ROOT.'/Util/HttpConnection.php';
$cookies = "ali_apache_id=204.2.171.12.1450838017229.955091.8; xman_f=+N1KMGvtc3RM5GyCdrFZwcb1NdJiu0AN20NxL9hRhKTccmRYSU1ZCqDZeNBlRWWIZrVMzX8F9vViqDzQK6NlgC5Hc9h410XMej6jiHgLYlmcIG/fIkq7Vg==; ali_beacon_id=190.164.92.154.1440971976431.710151.2; cna=D7JSDqY+cXsCAb6kXJqfQzr0; xman_t=TRpywslP993AdnFEvNgndw4Yfkup7pXtCZv14COMlhka8U9fxBW9sFgLm4ZO0cyW; acs_usuc_t=acs_rt=f1c55f514d7748438d25b239eca5d1c8; xman_us_f=x_l=0&x_locale=es_ES; intl_locale=es_ES; aep_usuc_f=site=esp&region=CL&b_locale=es_ES&c_tp=USD; intl_common_forever=G3rK6WTaXMMgLiBO/W0alldJ8Fr7c4Fp8XM1d8HXvwY304BKx/uXNg==; _mle_tmp0=eNrz4A12DQ729PeL9%2FV3cfUxiK7OTLFScnUzi%2FQxsQzxN9INNfYwM7e0iAh2CjUN9DMLNfWL8DXU9XCP9DP39PTUDYkIUdJJLrEyNDE1sDC2MDYwMjAw1ElMRhPIrbAyqI0CAFeeHJk%3D; __utma=3375712.1203062094.1450838020.1450838020.1450838020.1; __utmb=3375712.6.9.1450838304807; __utmc=3375712; __utmz=3375712.1450838020.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); l=AjQ0YLh9iSHquLhtqK2mVf8PhPimaFj3; JSESSIONID=EF6YL49TO2-U3H6798XSBU5QN6U5NXM1-HGYN7III-TXT; ali_apache_track=; ali_apache_tracktmp=; isg=6580A6ED72AF7904197452966080CFAF";
$url = "http://es.aliexpress.com/category/204004798/jackets-coats.html";
$follow = true;
$header = array(
"GET /category/204004798/jackets-coats.html HTTP/1.1",
"Host: es.aliexpress.com",
"Connection: keep-alive",
"Pragma: no-cache",
"Cache-Control: no-cache",
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Upgrade-Insecure-Requests: 1",
"User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36",
"Accept-Encoding: gzip, deflate, sdch",
"Accept-Language: es-ES,es;q=0.8,en;q=0.6",
"Cookie: ali_apache_id=204.2.171.12.1450838017229.955091.8; xman_f=+N1KMGvtc3RM5GyCdrFZwcb1NdJiu0AN20NxL9hRhKTccmRYSU1ZCqDZeNBlRWWIZrVMzX8F9vViqDzQK6NlgC5Hc9h410XMej6jiHgLYlmcIG/fIkq7Vg==; ali_beacon_id=190.164.92.154.1440971976431.710151.2; cna=D7JSDqY+cXsCAb6kXJqfQzr0; xman_t=sucWKSxM8ENsyPtV1LF016KvMNPi8Z6sGNIn9tTC0KEDLb759w2aUoMdLMFr8gYH; acs_usuc_t=acs_rt=fa28e6bca957441d8b8ee14f5c609f66; _mle_tmp0=eNrz4A12DQ729PeL9%2FV3cfUxiK7OTLFScnUziwwKdjcNMNI1c%2FQ0c%2FLzNwr28nL38nLxDw%2FyDzDUjTQP8rb08vTUDTFxVtJJLrEyNDE1sDQwtDS3MDAz0klMRhPIrbAyqI0CAGF3HMI%3D; __utmt=1; xman_us_f=x_l=0&x_locale=es_ES; intl_locale=es_ES; aep_usuc_f=site=esp&region=CL&b_locale=es_ES&c_tp=USD; intl_common_forever=PDGUu+t/6qLW4IGNDOmHSS+PVRaY0EBNJExy9DYh7uROBOpLDWdRJA==; __utma=3375712.1203062094.1450838020.1450838020.1450901981.2; __utmb=3375712.4.9.1450902372702; __utmc=3375712; __utmz=3375712.1450838020.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); l=Avb2H4026wccUrpjRmfEMqd4xib4KTpR; JSESSIONID=EF6YRSG5P2-6AI6BNO2SJJGJJDOWROP1-Y7RK9JII-T4C; ali_apache_track=; ali_apache_tracktmp=; isg=8735ED90C1C7B2D42849E492D06B41DA"
);
$curl = curl_init();
//curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_HEADER, $follow);
//curl_setopt($curl, CURLOPT_REFERER, 'www.google.com');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, $follow);
$result=curl_exec ($curl);
curl_close($curl);
echo $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment