It appears you have not yet registered with our community. To register please click here...

DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now!
Register Now for FREE!
Our records show you have not yet registered to our forums. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:  
Birthday:       I agree to forum rules 

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion
Start your Domain Reseller Business Today and Earn Money!
Reply
 
LinkBack Thread Tools Display Modes
Old 10-19-2004, 09:30 AM   #1 (permalink)
DNF Addict
 
seeker's Avatar
 
Last Online: 07-10-2008 02:08 PM
iTrader: (21)
Join Date: Jun 2003
Posts: 4,175
DNF$: 7,245
Location: Athens
Country:


RSS feeds

Anyone know where I can get a complete resource as to what an RSS feed is (I know a little, not enough), and how one can incorporate it into a site...etc...?

I gogled it, but too much info, and not a how to etc...

Much appreciated.
__________________
Seek... And you shall Find
seeker is offline   Reply With Quote
Sponsored Links
Old 10-19-2004, 10:36 AM   #2 (permalink)
Platinum Lifetime Member
 
Ross1982's Avatar
 
Last Online: 05-15-2008 11:24 AM
iTrader: (4)
Join Date: Aug 2004
Posts: 693
DNF$: 593
Location: England


Re: RSS feeds

It's just a news feed that lists the news or sporting results etc etc into a java scroller type thing, to install it I think it's just a copy and paste job.
Ross1982 is offline   Reply With Quote
Old 10-19-2004, 11:23 AM   #3 (permalink)
DNF Addict
 
seeker's Avatar
 
Last Online: 07-10-2008 02:08 PM
iTrader: (21)
Join Date: Jun 2003
Posts: 4,175
DNF$: 7,245
Location: Athens
Country:


Re: RSS feeds

mmmm, in google I get all kind of results.
__________________
Seek... And you shall Find
seeker is offline   Reply With Quote
Old 10-19-2004, 11:39 AM   #4 (permalink)
DNF Regular
 
theparrot's Avatar
 
Last Online: 12-09-2005 02:51 AM
iTrader: (2)
Join Date: Mar 2004
Posts: 641
DNF$: 297


Re: RSS feeds

An RSS feed is supposed to be an XML file that meets the RSS dtd. Problem is it developed more ad hoc then it should have so there are more then one DTD for RSS that are not really compatible. So many just use regexps to parse them. ATOM is suppoed to be the format to fix this. I think that the concept itself it flawed and should be replaced.

In any case, what you need is a snippet of code to transform the rss/xml to html or whatever output format you desire. If you can't find something by tonight when I am back home I can probably dig something off my HD for you.
theparrot is offline   Reply With Quote
Old 10-19-2004, 11:43 AM   #5 (permalink)
DNF Addict
 
seeker's Avatar
 
Last Online: 07-10-2008 02:08 PM
iTrader: (21)
Join Date: Jun 2003
Posts: 4,175
DNF$: 7,245
Location: Athens
Country:


Re: RSS feeds

would really appreciate it.

I am lost in the maze, and would love to have live feeds for some sites.
(as painlessly as possible)

Thanks!
__________________
Seek... And you shall Find
seeker is offline   Reply With Quote
Old 10-20-2004, 08:31 PM   #6 (permalink)
Acro.net Αdministrator
 
Acro's Avatar
 
Last Online: Yesterday 05:56 PM
iTrader: (365)
Join Date: Feb 2004
Posts: 19,112
DNF$: 15,828
Location: Domainistan
Country:



Re: RSS feeds

Ela Seeker. I have an instant RSS solution for Yahoo! feeds if your sites are on Windows servers. It might take a while to convert it to unix/linux servers.
__________________

Acroplex.com • Professional Web & Graphics development
Acro is offline   Reply With Quote
Old 10-20-2004, 11:04 PM   #7 (permalink)
DNF Addict
 
Nexus's Avatar
 
Last Online: 03-28-2008 10:46 AM
iTrader: (2)
Join Date: Sep 2002
Posts: 1,474
DNF$: 1,379
Location: Boston, MA


Thumbs up Re: RSS feeds

Quote:
Originally Posted by RADiSTAR
Ela Seeker. I have an instant RSS solution for Yahoo! feeds if your sites are on Windows servers. It might take a while to convert it to unix/linux servers.
The folowing code has served me extremely well. It parses through XML content, and sends you an array you can pull data out of.
Code:
function GetXMLTreeData($data) 
{ 
  $parser = xml_parser_create('ISO-8859-1');
// xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 
  xml_parse_into_struct($parser, $data, $vals, $index); 
  xml_parser_free($parser); 

  $tree = array(); 
  $i = 0; 
  
  if (isset($vals[$i]['attributes'])) {
    $tree[$vals[$i]['tag']]['ATTRIBUTES'] = $vals[$i]['attributes']; 
    $tree[$vals[$i]['tag']][] = GetChildren($vals, $i);
  }
  else
    $tree[$vals[$i]['tag']][] = GetChildren($vals, $i); 
  
  return $tree; 
} 

function GetChildren($vals, &$i) 
{ 
  $children = array();     // Contains node data
  
  /* Node has CDATA before it's children */
  if (isset($vals[$i]['value'])) 
    $children['VALUE'] = $vals[$i]['value']; 
  
  /* Loop through children */
  while (++$i < count($vals))
  { 
    switch ($vals[$i]['type']) 
    { 
      /* Node has CDATA after one of it's children 
        (Add to cdata found before if this is the case) */
      case 'cdata': 
        if (isset($children['VALUE']))
          $children['VALUE'] .= $vals[$i]['value']; 
        else
          $children['VALUE'] = $vals[$i]['value']; 
        break;
      /* At end of current branch */ 
      case 'complete': 
        if (isset($vals[$i]['attributes'])) {
          $children[$vals[$i]['tag']][]['ATTRIBUTES'] = $vals[$i]['attributes'];
          $index = count($children[$vals[$i]['tag']])-1;

          if (isset($vals[$i]['value'])) 
            $children[$vals[$i]['tag']][$index]['VALUE'] = $vals[$i]['value']; 
          else
            $children[$vals[$i]['tag']][$index]['VALUE'] = ''; 
        } else {
          if (isset($vals[$i]['value'])) 
            $children[$vals[$i]['tag']][]['VALUE'] = $vals[$i]['value']; 
          else
            $children[$vals[$i]['tag']][]['VALUE'] = ''; 
		}
        break; 
      /* Node has more children */
      case 'open': 
        if (isset($vals[$i]['attributes'])) {
          $children[$vals[$i]['tag']][]['ATTRIBUTES'] = $vals[$i]['attributes'];
          $index = count($children[$vals[$i]['tag']])-1;
          $children[$vals[$i]['tag']][$index] = array_merge($children[$vals[$i]['tag']][$index],GetChildren($vals, $i));
        } else {
          $children[$vals[$i]['tag']][] = GetChildren($vals, $i);
        }
        break; 
      /* End of node, return collected data */
      case 'close': 
        return $children; 
    } 
  } 
} 

function array_detail($obj) {
  global $__level_deep;
  if (!isset($__level_deep)) $__level_deep = array();

  if (is_object($obj))
    print '[obj]';
  elseif (is_array($obj)) {
    foreach(array_keys($obj) as $keys) {
      array_push($__level_deep, "[".$keys."]");
      printa($obj[$keys]);
      array_pop($__level_deep);
    }
  }
  else print implode(" ",$__level_deep)." = $obj";
}
I've used this code to pull results from different RSS sources. Just use the "print_r" function in php to see what you got, and just refer to whichever node you need.

Here's some code to READ the RSS from a remote server, and save the latest feed locally as a text document (so you're not pull the RSS every time someone views your page):
Code:
$url = "http://rss.topix.net/rss/food/dieting.xml";
$url = parse_url($url);

$sock = fsockopen($url["host"],"80",$errno,$error);
if (!$sock)
{
  echo ("<b>Could Not Connect To Server.</b> ERROR No.: <I>$errno</I> | ERROR: <i>$error</i>");
  exit;
}$result = "";

$useragent = $_SERVER['HTTP_USER_AGENT'];

$header = "";
$header .= "GET ".$url["path"]." HTTP/1.0\r\n";
$header .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg\r\n";
$header .= "Accept-Language: en-us\r\n";
$header .= "Host: ".$url["host"]."\r\n";
$header .= "User-Agent: $useragent\r\n";
$header .= "\r\n\r\n";

fputs($sock,$header);
$getcontent = 0;
while(!feof($sock)){
 if($getcontent<1 && $result!="\r\n") 
  $result = fgets($sock,128);
 else 
  {
   if($getcontent<1)$result="";
   $result .= fgets($sock,128);
   $getcontent++;
  }
}
fclose($sock);

$filename = "dieting.xml";
// Let's make sure the file exists and is writable first.
if (!file_exists($filename)||is_writable($filename)) {

   // In our example we're opening $filename in append mode.
   // The file pointer is at the bottom of the file hence 
   // that's where $result will go when we fwrite() it.
   if (!$handle = fopen($filename, 'w+')) {
         echo "Cannot open file ($filename)";
         exit;
   }

   // Write $result to our opened file.
   if (fwrite($handle, $result) === FALSE) {
       echo "Cannot write to file ($filename)";
       exit;
   }
   
   echo "Success, wrote ($result) to file ($filename)";
   
   fclose($handle);
                   
} else {
   echo "The file $filename is not writable";
}
print "<hr>";
print $result;
Finally, this code will READ the XML formatted document (using the functions I first quoted above), and display the results in HTML...
Code:
$output = file("newsfeed/dieting.xml");
$output = implode("",$output);

//In Case of Problem
if(!$output){$output = file("newsfeed/dieting_backup.xml");$output = implode("",$output);}

require_once('./newsfeed/functions_extra.php');
$output = GetXMLTreeData($output);

$feed = $output["RDF:RDF"][0]["ITEM"];

$newsfeed = "";
foreach($feed as $nf){
 //TITLE,LINK,DESCRIPTION
 $newsfeed .= "<a href=\"".$nf["LINK"][0]["VALUE"]."\" style=\"font-size:12px;color:#000000;\"><b>".$nf["TITLE"][0]["VALUE"]."</b></a><br>";
 $newsfeed .= "<small style=\"font-size:11px;color:#000000;\">".$nf["DESCRIPTION"][0]["VALUE"]."</small><br><br>";
}

$newsfeed = "<table cellpadding=10 cellspacing=0 border=0><tr><td>".addslashes($newsfeed)."</td></tr></table>";
You'll have to crawl through the details, but once it makes sense, you'll pretty much be unstoppable with grabbing RSS feeds. You just have to know a little PHP.

For a more "packaged" solution, here's a moldy oldey that you might be able to modify to your own needs.
http://www.dansteinman.com/php/pheadlines/

DEMO:
http://www.dansteinman.com/php/phead...headlines.php3

This bad boy works like a charm, caches results, but... I'm not sure how up-to-date it is (and doesn't show examples from Yahoo's feeds).

Cheers,
~ Nexus
__________________
FreeWho.com - Free Internet Tools!
Nexus is offline   Reply With Quote
Old 10-20-2004, 11:32 PM   #8 (permalink)
Administrator
 
MediaHound's Avatar
 
Name: Jarred
Last Online: Yesterday 01:36 PM
iTrader: (82)
Join Date: Feb 2004
Posts: 4,704
DNF$: 8,110
Location: Florida
Country:


Re: RSS feeds

My friend Alex, here's some RSS resources that I use:
http://www.rssforums.com
http://forum.free-templates.com/forumdisplay.php?f=34
MediaHound is offline   Reply With Quote
Old 10-21-2004, 02:43 AM   #9 (permalink)
DNF Addict
 
seeker's Avatar
 
Last Online: 07-10-2008 02:08 PM
iTrader: (21)
Join Date: Jun 2003
Posts: 4,175
DNF$: 7,245
Location: Athens
Country:


Re: RSS feeds

Thanks everyone!!!

excellent resources, codes, and links. I apprciate it.
__________________
Seek... And you shall Find
seeker is offline   Reply With Quote
Old 10-21-2004, 07:24 AM   #10 (permalink)
Gold Lifetime Member
 
schmidte's Avatar
 
Last Online: 10-10-2008 12:46 PM
iTrader: (0)
Join Date: Nov 2002
Posts: 374
DNF$: 692
Location: Illinois


Re: RSS feeds

Here's a site I use that will generate a code for just about any news subject, you can customize with style sheets.
ED

http://anyrss.maquis.org/
schmidte is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
data Feeds added to dnforum.com DotComGod DNForum Site News 20 03-30-2005 12:21 PM
help - live feeds? iBizStart Website Development and Design Discussion 3 02-14-2004 11:50 AM
Farmer Feeds the World with Domain Data: New DNJournal.com Cover Story About Exody Duke Advertising and Related Offers 14 07-17-2003 07:18 PM
Free java script news feeds... biggedon Website Development and Design Discussion 9 10-13-2002 05:04 PM
Info Feeds HLK Website Development and Design Discussion 3 08-19-2002 10:28 PM


All times are GMT -4. The time now is 02:06 AM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains