Witam,
Mam ogromny problem z poprawnym wyświetleniem wyników z wyszukiwarki Bing poprzez kanał RSS
Kodzik:
$search = http://www.php.net/htmlentities(http://www.php.net/urlencode($_GET['search'])); require_once 'temp/apicall.inc'; $replace = " "; $with = "+"; $replace = "-"; $with = "+"; $search = http://www.php.net/str_replace($replace, $with, $search); $apicall ="http://www.bing.com/search?q=Doda&format=rss"; $rss = fetch_rss($apicall); foreach ($rss->items as $item ) { $title = $item["title"]; $title = mb_convert_encoding($title, 'HTML-ENTITIES', "UTF-8"); $url = $item["link"]; $description = $item["description"]; $description = mb_convert_encoding($description, 'HTML-ENTITIES', "UTF-8"); $title = http://www.php.net/str_replace("$search", "$search", $title); http://www.php.net/preg_match("/^(http:\/\/)?([^\/]+)/i", "$url", $matches); $host = $matches[2]; http://www.php.net/preg_match("/[^\\/]+\.[^\.\/]+$/", $host, $matches); $baseurl = $matches[0]; $title = http://www.php.net/str_replace('"', '', $title); $title = http://www.php.net/str_replace("'", "", $title); $tpl->assign('rss', $rss);
{foreach item=link from=$rss} <http://december.com/html/4/element/a.html href="{$url}" title="{l}Read more about{/l}: {$title|escape|trim}">{$title}</http://december.com/html/4/element/a.html><http://december.com/html/4/element/br.html /> {/foreach}
pokaż wynik (dodaj na samym końcu) :
http://www.php.net/print_r($rss);
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)