GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php script to include rss feed into html page (https://gfy.com/showthread.php?t=1057371)

Fletch XXX 02-12-2012 07:40 PM

php script to include rss feed into html page
 
anything? have tried a few free ones with no luck...

dont need to morph it or change it just include it as is...

Zoxxa 02-12-2012 08:17 PM

I thought you became a coder within the past months? Grab the feed with file_get_contents or curl, Run it through a new simplexmlelement class to create an object from it and run through it with a while loop. Done.

Tube Ace 02-12-2012 08:24 PM

PHP Code:

<?php

$feedURL 
"http://rss.cnn.com/rss/cnn_topstories.rss";

$xml simplexml_load_file($feedURL);
    
foreach (
$xml->channel as $record){
    
    
$title $record->title
    
$link =  $record->link
    
$description $record->description;
    
$image_url $record->image->url;
    
    echo 
"<a href=\"$link\">$title</a>";
    echo 
"<br /><img src=\"$image_url\">";
    
}

foreach (
$xml->channel->item as $record){
                    
    
$title $record->title
    
$link $record->link;      
    
$description $record->description;   
    
$pubDate $record->pubDate;   
    
    echo 
"<br /><br /><a href=\"$link\">$title</a> $pubDate";
    echo 
"<br />$description";

}

?>


Fetish Gimp 02-12-2012 08:52 PM

My vote is for SimplePie, a PHP class to handle the dirty work, has caching which is nice. Google "SimplePie tutorial" and you'll get plenty of examples on how to use it.

Zoxxa 02-12-2012 09:02 PM

Dirty work? This has to be one of the easiest things to do.

Fletch XXX 02-12-2012 09:12 PM

Quote:

Originally Posted by Zoxxa (Post 18755503)
Dirty work? This has to be one of the easiest things to do.

I have nothing but respect to those of you who can just conjure this stuff man. I thank anyone for help but no i am not a coder, and if you are perhaps I can use you on some projects :)

Deej 02-12-2012 09:18 PM

simple pie...

its cake!

Fletch XXX 02-12-2012 09:19 PM

Quote:

Originally Posted by Tube Ace (Post 18755457)
code

thank you, it works perfect.

Zoxxa 02-12-2012 09:36 PM

Quote:

Originally Posted by Fletch XXX (Post 18755513)
I have nothing but respect to those of you who can just conjure this stuff man. I thank anyone for help but no i am not a coder, and if you are perhaps I can use you on some projects :)

I meant no disrespect, I have just seen you posting around the board about your android apps and C based language skills.


All times are GMT -7. The time now is 05:44 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123