The view from here
11 Apr
For a while, I have been using PopURLs as a quick and dirty way of scanning interesting websites for what’s new. It is not a RSS reader substitute, but if I have a couple of minutes and just want to see something new, it’s a good spot to stop. A few weeks ago, with a few free cycles, I wondered just how difficult it would be to roll my own. Nothing as pretty, but something that would give me some exposure to what’s under the covers.>
A couple of days ago, buzz started to build around Alltop which was built by Guy Kawasaki’s Nononina, also behind the site Truemors. Alltop is a very pretty site with a wide variety of content, but it too is based on the same content (and looking at the page sources, potentially the same code base).
If you want to build your own, I offer you my findings, code and lessons learned
Technorati Tags: php, popurls, alltop
As this is a quick and dirty implementation, I apologize if the code base contains some minor bad practices. In most cases, I’ve adhered to standards that should allow you to unzip and deploy, but if something doesn’t quite work, take a look at the code. It was intended to be deployed on the URL news.delic.com so take a look for any part of that string if paths don’t work.
Please leave all of the GPL, BSD, CC and other licenses in the code intact, if you publish this. Any changes I have made to the code are extensions of these licenses. You are free to reuse any code I have written, but if there’s a license embedded in there, you should leave it there.
News aggregation source code (zip format, 490Kb)
If you are interested in rolling your own version of the aggregator, I have listed the components below, along with links to some of the relevant installation instructions and documentation
If you are hosted on Dreamhost and running PHP 5+, you will have all of the minimum and recommended components listed above available to you via the php5 default install.
<?php echo newsblocks::render (’http://digg.com/rss/index.xml’); ?>
The SimplePie Documentation has all of the options one might need to increase the number of articles pulled from the feed, the cache periods, etc.
To get Cluetip to work, there are two necessary steps:
<script type=”text/javascript”>
jQuery.noConflict();
// Put all your code in your document ready area
jQuery(document).ready(function($){
// Do jQuery stuff using $
$(”a.ctip”).cluetip({
splitTitle: ‘|’, // use the invoking element’s title attribute to populate the clueTip…
// …and split the contents into separate divs where there is a “|”
showTitle: false // hide the clueTip’s heading
});
});
</script>
$html .= ‘<li class=”‘ . $class . ‘”><a href=”‘ . $item->get_permalink() . ‘” title=”‘ . newsblocks::cleanup ($item->get_description(), $length) . ‘”>’ . $item->get_title() . ‘</a> </li>’ . “\n”;
and change it to:
$html .= ‘<li class=”‘ . $class . ‘”><a class=”ctip” href=”‘ . $item->get_permalink() . ‘” title=”|’ . newsblocks::cleanup ($item->get_description(), $length) . ‘”>’ . $item->get_title() . ‘</a> </li>’ . “\n”;
* = Alltop and PopURLs are registered trademarks and/or servicemarks of Nononina and Thomas Marban respectively. This site is not affiliated with them in any way.
"Ratchet and Clank Future":
21 Responses for "Building your own Alltop or PopURLs*"
This is a fantastic tutorial! I’ve added it to our tutorials page: http://simplepie.org/wiki/tutorial/start . If you write any more tutorials for SimplePie, feel free to add them yourself.
ive been having problems with my website. I used also the simplepie tutorial but i have a problem with the tooltip. It is working in my localhost but when i upload it to my server is not working. What do you think is the problem?
Thank you very much
Can you give me a URL? There’s not a lot of detail to go on in your post - if I can see more, I might be able to diagnose
Thanks a million for this code. It was exactly what I’ve been looking for.
I’m having a bit of a problem with the spacing at the top of the page between the header and the news feeds. I would like to mostly eliminate it, but I’m not sure how. I was able to get rid of 30px of it from .clearer, but there’s still 50-60px that I can’t figure out where it’s coming from. I’ve added an image to mine but the gap appears either way.
Thanks again,
Mike
resolved Mike’s issue - he needed to remove the div with the id of “header”
Question - is there an easy way to pull the first image url out? Or perhaps an easy way to pull / render an ebay feed ?
Thanks
@ patrick
tags.
yes. look in the newsblock.inc file for the render_flickr function. This will look at the item description and pull out the
If your description has multiple
tags in it, replace the code:
foreach ($matches[0] as $match)
{
// Add the images (only) back to $s.
$s .= $match;
}
with:
//Take only the first image match and be done with it
$s = $matches[0][0];
(replace the entire foreach loop with the above statement.
I’ve also been busy with simplepie newsblock and created a celebrity url hyve.
http://www.richyshameless.com
Still busy working on it checking new feeds etc.
In addition to my post above.
Do any of you know how to center align the contente of the wideblock? (the video thumbnails) They are always aligned to the left and i can’t figure out how to center them.
There’s no immediate way to do this, but you could adjust the padding on the wideblock class. Since the entire container is 950px wide, and you know the size of the thumbnails and number of thumbnails per row, you could do some quick math to figure out the appropriate padding
Hi,
Great tutorial! I really appreciate it…
I’ve downloaded your example-package, and uploaded it to my FTP ( http://www.marcfalk.com/ag/ ) , but the javascript doesn’t seem to work, how come? any idea..?
Help is appreciated! Thanks in advance…
Marc
Hmm. It appears that the zipfile doesn’t include the scriptaculous subdir in the js/ sub-dir. I reupped the zip file. If you uncompress it, it will unzip into a directory called “news.delic.com”. You can move the contents to the right place, or just the news.delic.com/js/scriptaculous/ directory into your js directory.
Let’s see if that works
Raj
Hey, thanks for the answer! But I’m sorry to say it didn’t work out as expected. I actually think the scriptaculous dir was already in place, but I upped the new zip anyway, and it still looks like this: http://www.marcfalk.com/ag/ or http://www.houseofsaints.dk/ag/
Hmm.. It doesn’t make any sense! :/
Marc
Oh, I red this (http://tech.groups.yahoo.com/group/simplepie-support/message/1130) and it helped me. It seems like you have to remove the .htaccess-file, now it works.
What did that .htaccess do? Do I need it?
Marc
The .htaccess file is used to tell the webserver who should have access to the directory and what they can do (for example, anonymous users can’t read the directory listing, or you need to supply a username and password to access a file).
I think the .htaccess file came from your webserver (I can’t find one in my zip file, if anyone does find one, let me know).
Not having it there isn’t really an issue, but don’t put anything you don’t want the world to be able to see into this set of directories
Raj
how do i change the background and text color of boxover? Where can i edit the mouse over effect?
everything else is great.
Thank you.
I just uploaded the whole folder to my server and it worked!!
It-s that easy ??
Thank you.
Thinking it would be easy I uploaded the whole folder to my server but it didn’t work. I’m getting:
Warning: ./cache/43d45d4504fae280ade72bf910736904.spc is not writeable in /php/includes/simplepie.inc on line 1769
Warning: cannot yet handle MBCS in html_entity_decode()! in /php/includes/newsblocks.inc on line 744
Warning: cannot yet handle MBCS in html_entity_decode()! in /php/includes/newsblocks.inc on line 744
Warning: cannot yet handle MBCS in html_entity_decode()! in /php/includes/newsblocks.inc on line 744
Warning: cannot yet handle MBCS in html_entity_decode()! in php/includes/newsblocks.inc on line 744
Warning: cannot yet handle MBCS in html_entity_decode()! in php/includes/newsblocks.inc on line 744
Warning: cannot yet handle MBCS in html_entity_decode()! in php/includes/newsblocks.inc on line 744
can anyone help?
I believe your cache directory does not have the right permissions.
see: http://simplepie.org/wiki/setup/setup#step_3
Great stuff! I have only one question, how can you either remove the “more” link at the bottom of feeds (I noticed the newsblock has this whole 2nd div for it but no one has it working) or actually put it to use? Thanks in advance!
Since i am having a big problem with tooltips here at my news aggregator site ( http://malayapark.com). I think this is a very good option for me. Thanx for the sharing
Leave a reply