Best Solution for a News Aggregation Website
I'm currently making a news aggregation website. I've looked/searched around the forum and did not see a particular topic on this, please forgive me if this has already been discussed.
I would like to make a news aggregation website that's similar to the following sites:
http://newsnow.co.uk/
http://www.christianheadlines.com/
http://www.gametab.com/
http://macsurfer.com/
The site would aggregate feeds from other sites without displaying any teaser, but only listing the titles, which will link back to the story on the original news site. I know some sites use zFeeder, but I'd like to try to achieve the same thing with Drupal.
I have experimented with the following combinations of modules, but none were exactly perfect:
Default Aggregator
With the default aggregator that came with Drupal, I could not find any easy way to "not" show teasers on the aggregation page. The only solution I found was to make blocks of aggregated contents, then place the block in a node, or use a module like panel to place the blocks on a page.
I've also tried to combine aggregator with Feed_node, and use Views to create a view that only display titles, but since Feed_node creates nodes out of the feed, the titles created by Views links to the nodes on my site, not the original site the story came from.
Leech or Feedparser
Both allows me to create nodes out of the feed, which can then be themed to display only the titles, but then I have the same problem as stated above, I'd like to have the titles link back to the original site.
What would be the best solution for such a news aggregation website? Is there a module/way to achieve this?
Cheers,
Shawn

new concept
hi
what you showed in the links is definetly a new concept for me. i have never seen sites like that before. good luck and pls. keep us informed of your progress.
thanks
__________
http://namima.in-egypt.net اجدد اخبار ممثلين
Leech
Leech is probably the best way to do this - I'm looking at developing a site which works in this vane as well but using 5.0RC1.. so I may have to work on porting a couple of modules to the new platform... i'll keep you updated on this.
Also, you might want to consider using Joomla - I build a simple version of this concept to aggregate news from the joomlasphere at large and allow commenting fairly easily: http://www.joomlafeed.com
q./
Actually I was considering
Actually I was considering Joomla, I really liked their Ajax Feed module where you could drag around the feed boxes. But with the upcoming Drupal 5, and talks of implementing similar Ajax features into Draupal, I really can't resist trying this out in Drupal (although the upcoming new version of Joomla does look very interesting as well).
Anyway, for my first attempt, I ended up making some modifications to the original aggregator module, then used Panels and some CSS hacking to get the job done. It's not perfect, and not very flexible, but I got a basic structure going:
http://www.animenewsbriefs.com/
Another thing I noticed with the default aggregator module is that, when creating categories, in most cases they're displayed alphabetically (like in the admin section). However, in the category page (/aggregator/categories), they're displayed according to their id #, so say if I create apple (1), orange (2), then peach (3), they'll be displayed in the following order:
apple
orange
peach
And there's no way to change this order (aside from messing with the database, but then you run into trouble with bunch of other problems).
I really like how FeedParser isusing the taxonomy module to handle its categories. My wish would be for one of the aggregation module to include the option to display a feed either as "summary view" or "list view" where list view only lists titled.
Another thing is the Source page (aggregator/source) it seems like the source with the latest feed gets bumped to the top, so the order of the sources keeps changing, and I can't seem to find a way to display the source alphabetically or by their categories. This could probably be solved by modifying the aggregator module itself, though I try to avoid that as much as possible.
I think I did it - with Leech
I think I have something about like what you were looking for... I wanted to only show teasers and not allow people to read the entire article without going to the original source. I wound up using Leech and creating a custom type of rss_feed_item for my items. Since I'm using a PHPTemplate theme (modified Garland) I created a node-rss_feed_item.tpl.php and edited it so that it will never show anything except the teaser.
I also put in links to follow to the source.
You want something different in your tpl.php file, but I think this might be on the right track.
This discussion was a great help:
http://drupal.org/node/128674
You can see a (no cleanup done yet) kind of example at:
http://www.craftacraft.com/leech/feed/966
If you follow one of the article links you will get the teaser, but you could modify that, I think.
<?php phptemplate_comment_wrapper(NULL, $node->type); ?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
<?php print $picture ?>
<?php if ($page == 0): ?>
<h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>
<?php if ($submitted): ?>
<span class="submitted"><?php print t('!date â~@~T !username', array('!username' => theme('username', $node), '!date' => format_date($node->created))); ?></span>
<?php endif; ?>
<div class="content">
<?php
$content = "$node->teaser<p>" .
l( t("read more"), "node/$node->nid", array( "title" => t("Read the rest of this posting."), "class" => "read-more") ) .
"</p>";
$content = node_teaser($node->body);
print $content;
?>
<p></p><a href="<?php print $leech_news_item->link ?>" target="_blank" title="[Follow external link for full article]">[Follow external link for full article]</a>
</div>
?>
The rest is a copy from my regular node.tpl.php
Very interesting... yes, the
Very interesting... yes, the purpose of this is so people have to go to the original source to read the article :)
I'm sure it's fairly easy to have the site show feeds with only a teaser, or without teaser with some modification to the templates.
Basically, what I'm trying to achieve is to only show 3 fields, the Title of the article (which links to the article's site), the date, and the source. I'll be trying out some of the new modules available for Drupal 5 such as Aggregation, Planet and SimpleFeed.
It seems what all of them are doing is creating a node for each feed... I wonder if there are options to NOT create nodes out of the feeds, but simply listing them (and after a few days they'll be gone). So far I've been hacking the core aggregator module to achieve this. Another way was to have one drupal site aggregate the feeds, then have another drupal site aggregate the feed from the first Drupal site, though I think that's too much trouble for what I'm trying to achieve here.
I, too, would love to see an
I, too, would love to see an RSS aggregator that does not create nodes. I have spent hours battling with the simplefeed, feedparser, aggregation, and built-in aggregator modules (I'm running 5.5 btw) and while I really like the simplicity of the native aggregator, I do not like how it fails to weed out duplicate items when displaying headlines from multiple feeds, nor do I like how it has no teaser option. However, with the contributed modules, I wasn't terribly impressed either, due to the fact that every time I tried to do anything it totally messed up my database, and also wouldn't display 'smart quotes' and the like properly when they occurred in headlines. Any help out there for just getting a simple sidebar with headlines+teasers from a few different feeds?
---------------------------------------
http://softpixel.com/~bbinkovitz
Drupal aggregator that DOES NOT CREATE NODES
Okay so I got impatient and did it. I plan to make it a module sometime unless someone else beats me to it, but for now it's just a hack I put in a block.
Get The Look:
1. Have Drupal 5.5 (although I suspect it wouldn't matter which Drupal version you used this with, I haven't tested it with anything else)
2. wget the Magpie rss parser from here: http://internap.dl.sourceforge.net/sourceforge/magpierss/magpierss-0.72.... . I suggest putting it in sites/all/modules because we're using it as a kind of fake "module". My code assumes it will be there, so if it's somewhere else you have to change the path or it will FREAK OUT and break your site until you go to the database and delete the block you just made and start over.
3. Edit rss_fetch.inc in the Magpie folder you just got. Just tack this little comparison function on the end, right before the last "?>"
function compareChronology($a, $b)
{
if ($a['chronology'] == $b['chronology']) {
return 0;
}
return ($a['chronology'] > $b['chronology']) ? -1 : 1;
}
4. Create a new block where you will put this news feed.
5. Copy my code into the block. Make sure you're not using a rich-text editor and your input method is set to php code.
<?php
require_once 'sites/all/modules/magpierss-0.72/rss_fetch.inc';
//Here's the stuff the user sets:
$block_limit=5; //how many stories to display at a time. change the '5' to whatever number you want.
$urls = array('http://exampleurl.net/rss.xml', 'http://anotherexampleurl.com/feed'); //change these urls to the urls of the feed you want to use. Add as many as you want separated by commas and inside of single quotes
// okay now the real code starts
foreach ($urls as $url){
$rss = fetch_rss($url);
foreach ($rss->items as $item ) {
// unique post identifier
$guid = $item['guid'];
// post title
$title = $item['title'];
$channelTitle = $rss->channel['title'];
// date and time of pub. to use for sorting.
$chronology=$item['pubdate'];
$chronology=strtotime($chronology);
// date of pub in display format.
$pubdate = $item['pubdate'];
$pubdateArray=explode (" ", $pubdate);
$pubdate=$pubdateArray[0]." ".$pubdateArray[1]." ".$pubdateArray[2]." ".$pubdateArray[3];
// shortened teaser version of the post summary.
$summary = $item['summary'];
$summary = strip_tags($summary, '<p><a>');
$bodyArray = explode(' ', $summary) ;
$bodyArray = array_slice($bodyArray,0, 25);
$body = implode(' ',$bodyArray);
// post url for creating a link.
$url = $item['link'];
// display original author
$creator = $item['dc']['creator'];
// array that holds all the post parameters
$myArray[$guid] = array('title'=>$title, 'channelTitle'=>$channelTitle, 'chronology'=>$chronology, 'pubdate'=>$pubdate, 'creator'=>$creator, 'url'=>$url, 'body'=>$body);
}
}
function compareChronology($a, $b)
{
if ($a['chronology'] == $b['chronology']) {
return 0;
}
return ($a['chronology'] > $b['chronology']) ? -1 : 1;
}
//sort them by date
usort ( $myArray, "compareChronology");
$counter = 0;
//there's some stylesheet stuff here and there for your convenience. feel free to change or ignore the html tags.
print'<div id="rssfeed">';
//output each story
foreach ($myArray as $guid => $tempArray) {
echo '<div class="rss-thing" id="'.$tempArray['chronology'].'"><a href="'.$tempArray['url'].'" title="'.$tempArray['title'].'"><h3>'.$tempArray['title'].'</h3></a><div id="meta-info">'.$tempArray['channelTitle']."<br>".$tempArray['pubdate']." :: ".$tempArray['creator'].'</div><div id="rssteaser">'.$tempArray['body'].'... [<a href="'.$tempArray['url'].'" title="'.$tempArray['title'].'">more</a>]</div></div>';
$counter ++;
if ($counter>$block_limit) {break;}
}
print'</div><!--/rssfeed-->';
?>
Okay, I think that's it! I have no idea what various types of feeds it can parse, etc. but I'm using it pretty happily right now. I hope you enjoy it. If you break it, let me know so I can troubleshoot. Or if you see something else similar already out there so I can stop busting my butt reinventing the wheel.
---------------------------------------
http://softpixel.com/~bbinkovitz
Subscribed.
Subscribed.
Some problems...
It's been bought to my attention that I shouldn't have advocated modifying the magpie code because it's bad practice.
Instead of pasting anything into the Magpie code, give this chunk of code:
<?phpfunction compareChronology($a, $b)
{
if ($a['chronology'] == $b['chronology']) {
return 0;
}
return ($a['chronology'] > $b['chronology']) ? -1 : 1;
}
?>
the name "chronology.inc." in the directory folder_where_you_keep_your_hacks and include the following line near the beginning of your block code:
require_once 'folder_where_you_keep_your_hacks/chronology.inc';
---------------------------------------
http://softpixel.com/~bbinkovitz
Also, I should point out
Also, I should point out that when you set $block_limit = n, it will actually render n+1 headlines.
---------------------------------------
http://softpixel.com/~bbinkovitz
Hi, Wouldn't it be great to
Hi,
Wouldn't it be great to have this Magpie code used through feedapi (www.drupal.org/project/feedapi)
Are you willing to make a new parser with magpie for feedapi? Then you can also make nodes with taxonomy support of the newsfeeds :)
I don't have enough php and feed knowledge to get it done. May be togetther we can get it rocking. I am looking for the same solution as yours in a block, but with feedsupport (http://drupal.org/node/176843) , but through the NEW feedapi support would be great.
Greetings,
Martijn
subscribing
- yeeloon
I've written a news
I've written a news aggregation website and used drupal as the front end and .net as a backend. It's a little bit more work to do this but takes a load off the web server and lets it concentrate on more important things like serving up web pages.
The site is still in development but can be seen at www.sportymule.com . I hope to have a fully working version up within a month so for now I'm not advertising it heavilly.
The site is my first ever in drupal so I'm still learning all the ins and outs.
subscribed
subscribed