Как выпарсить кейворды из Dogpile

October 22, 2008

Раньше при загрузке dogpile.com/info.dogpl/searchspy/inc/data.xml можно было вытягивать кейворды по которым осуществлялись запросы. Теперь там яваскриптом показывают слова. Как из яваскрипта их тянуть - хз.

Решение: Код на php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ’http://www.dogpile.com/dogpile/ws/service/DPServices.asmx/GetSearchSpy’);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(’Content-Type: 
application/json’));
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, ’{"numTerms":50,"filter":true}’); 
// numTerms - кол-во кеев за раз ;)

$response = curl_exec($ch);
curl_close($ch);

$feed = new SimpleXMLElement($response);
foreach ($feed->channel->item as $item) {
    echo (string)$item->title . ’<br />’;
}  

 Копия на livepad

Comments »

The URI to TrackBack this entry is: http://intrex.blogsome.com/2008/10/22/p78/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.