...

View Full Version : "Bio" site aggregator



ajhauser
09-11-2012, 06:57 PM
I am thinking about putting together a website that displays multiple feeds from the different websites and services I am involved with. This is probably a stupid question, but how would some of you go about the process of creating a personal site that pulled and displayed feeds from multiple sources all in one location?

I'm curious about methods and options, as this is entirely new territory for me.

I was thinking it would be neat to have 2 different views possible: 1 would be more of a dashboard look with different modules to display feeds and updates, and 2 would just be a single column displaying everything in order by date like an RSS reader.

Very curious.
Thanks!

mlseim
09-11-2012, 07:16 PM
Very easy to do using PHP.

Give us an example of a couple of those sites (the RSS feeds),
and what info you wish to pull out of the feeds.

ajhauser
09-11-2012, 07:55 PM
I was thinking text for recent blog posts here:
http://hauserdesigngroup.com/wordpress/feed/

Recent twitter posts and facebook posts WITHOUT relying on the clunky widgets provided.

In the future there would be 2 or 3 other RSS feeds.

At this point, that's essentially it.

mlseim
09-12-2012, 01:01 AM
Here's an example using your RSS link:



<?php
// rss page -
$feed_url = "http://hauserdesigngroup.com/wordpress/feed/";

// INITIATE CURL.
$curl = curl_init();

// CURL SETTINGS.
curl_setopt($curl, CURLOPT_URL,"$feed_url");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);

// GRAB THE XML FILE.
$xmlFile = curl_exec($curl);

curl_close($curl);

// SET UP XML OBJECT.
$xml = simplexml_load_string($xmlFile);

// DISPLAY ONLY 5
$count=5;

foreach ($xml->channel->item as $item) {
if($count > 0){
// In case they have non-closed italics or bold, etc ...
echo"</i></b></u></a>\n";
// Remove strange characters that cannot be defined ...
$desc = preg_replace('/[^\x20-\x7F]+/', '', $item->description);
$title = preg_replace('/[^\x20-\x7F]+/', '', $item->title);

echo"
<div style='font-family:arial; font-size:.8em;'>
<b>".$title."</b><br />".
$desc." <br />
Add your own read more link ... <a href='{$item->guid}'>read more</a>
<br /><br />
</div>
";
}
$count--;
}

?>

ajhauser
09-12-2012, 01:26 AM
Oh man - thank you! I look forward to checking this out in depth.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum