Recently, I was asked to do something new, which involves RSS and feeds. I've read codes and concepts and I am beginning to understand the use of these things.
Basically I have been asked to extract the contents of a table found in a remote page and display those contents on a table on the local page. The setup is the following: there is a table at the right with news, and a link that says "Read whole article", so when you click on the link you are supposed to get the whole article on the same page but in the center table (which normally only has a "welcome" text).
I tried the following:
Code: Select all
//the following code is inside a for loop
$cont = '<div class="feedstory"><h3>'.$rs["items"][$i]["title"]."</h3> \n"; //$rs is an array, [items] is an array and each index is an array containing the title, the publish date, the overview of the article and the link to the whole article
$cont .= '<p align="justify"><font style="color:#ccc; font-size: 9px;">'.$rs["items"][$i]['pubDate']."</font></p>\n";
$cont .= "<p align=\"justify\">".html_entity_decode($rs["items"][$i]["description"])."</p>\n";
$cont .= "<p><a target=\"_self\" href=\"".$rs["items"][$i]["link"]."\">"._READ_WHOLE."</a></p>\n";
$cont .= "<div style=\"clear:both;\"></div>\n</div>\n\n";Code: Select all
$rs2 = $rss->get($rs["items"][$i]["link"] //$i is the index of the article selected, so I'm trying to get to the link where the whole article resides
$cont .= '<div class="feedstory"><h3>'.$rs2["items"][0]["title"]."</h3> \n";
$cont .= '<p align="justify"><font style="color:#ccc; font-size: 9px;">'.$rs2["items"][0]['pubDate']."</font></p>\n";
$cont .= "<p align=\"justify\">".html_entity_decode($rs2["items"][0]["description"])."</p>\n";
$cont .= "<div style=\"clear:both;\"></div>\n</div>\n\n";However, this does not work (nothing is displayed), and since I don't have much experience with RSS and feeds I'm quite lost now as to what to look for.
Any suggestions or comments? Thanks in advance.