Curl & how to say i support foreign languages?!

Discussion in 'PHP' started by redhits, Dec 8, 2009.

  1. #1
    I want to quick get some data from Yahoo servers.
    The only problem is that if i am doing something like:


    $url='http://ru.search.yahoo.com/search?p=geoseo&n=10';


    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    $data=curl_exec($ch);

    I will only get from them the english text page, all russian text will be ignored.

    How i can tell to an server via CURL that i am support the russian language? ASCII or whatever?


    I am talking about this ugly things:

    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
     
    redhits, Dec 8, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    mastermunj, Dec 8, 2009 IP
  3. tguillea

    tguillea Active Member

    Messages:
    229
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Also, most mainstream search engines prevent you from doing automated queries as it is against their terms of service.
     
    tguillea, Dec 9, 2009 IP