Archived : Techno Babble

This is the archived version of my b2evolution code blog.
If you require any help regarding b2evolution then
visit it's support forums

You can find my current blogs here
Code : {@link : WafflesOn}
Personal : {@link : InnerVisions}

« Magento anybody?tinkering with the bloglist »

Playing with an RSS reader

Posted on 3rd Jan 2008 in : Plugins & Widgets

SimplePie gets widgetised

After being nudged by Danny about an RSS reader I started a fair while back and never finished, mainly because I didn't have a use for it, I felt obliged to create an RSS Reader widget .... mainly to stop him nagging my arse off ;). Fortunately I'd come across an RSS Reader class a tad ago called SimplePie which would make the task a LOT easier, although it took a bit of pissing about to get it working the way I wanted. If you want to skip all the usual babble you can download the current version of the plugin here ( AM RSS Reader ), it does come with some system requirements which can be found on SimplePies System requirements page.

Installation and usage

Installing is the same as every other widget, download the file, unzip it, upload the am_rss_reader_plugin folder to your blogs folder. Meander over to admin > global settings > plugin install > install new plugin ( damn that's a hell of a path ), click the install link for the plugin. Now wander over to your skins widgets and click add new widget for whatever skin container you want it in. On the widgets settings page choose a custom title for the feed, the maximum number of items you want to display and slap in the feeds url ( note to self : validate the feed url ). If you feel brave you can play with the items html ( see the readme for replacement values ), the chances are that you won't need to change it. Once you have all your settings done, hit save. That's it, you now have the feed in your skin wherever your container is.

So, what can it do?

The short answer is "quite a bit actually", the long answer is that it has a bunch of settings which it utilises in a magic ceremony that results in the RSS feed being spat out, wherever you placed the widget, in a totally customised way. This magic is carried out by unemployed elves who are desperate for work now that christmas is over. So not only will you have a really cool widget, you'll also be helping save the elves, now is that cool or what? Of course this means that the widget stops working around the beginning of december for a few weeks but such is life ;) Rather than repeat all of the settings, what they do, why and how I actually made a readme ( yeah I know, me write a readme, whatever is the world coming to? )

Semi-technical stuff

Due to the fact that I dislike having folder permissions set to "let the world rape me", which is unavoidable on some shared hosting, I decided not to use SimplePies caching system, which uses files, and instead the results are cached in the database. You can set the cache duration to absolutely anything you like, the default is 60 minutes. At the moment I've only enabled the simplest of the SimplePies abilities, ( ie/ you can get post author, content, url, date, title ), but if anybody really wants some of the other functionality that's available with the class then just holler, it's not that difficult to incorporate them.

As always this is a pre-release version, although it's been tested in most 2.x flavours, so if it breaks let me know .... if it doesn't break then it'll be released as soon as I come up with a post that doesn't involve elves ;)

¥

*edit* You can now see the widget in action on my Feeds I read page.

47 comments

Comment by Danny { @link http://www.brendoman.com/dbc } on 03/01/08
If I had known that it was as easy as that, I'd have been asking for a something new every day for the last year.
Comment by ¥åßßå on 03/01/08
Lol, and you'd probably still only have one widget :P

¥
Comment by Ryan Parman { @link http://simplepie.org } on 05/01/08
This is Ryan from the SimplePie project.

Based on your description, I'm not sure if this is a plugin for blog software or not, but if so, I would encourage you to post a new wiki page to our plugins list. http://simplepie.org/wiki/plugins/start

You also said that "it took a bit of pissing about to get it working the way I wanted." What kinds of problems did you encounter? Did you check the documentation? Did you ask your questions on the forums? What things can we do to make these kinds of things easier/simpler?

Thanks!
Comment by ¥åßßå on 05/01/08
Hi Ryan,
Congratulations on writing such a cool API :D

This is a plugin ( widget ) for the 2.x series of b2evolution software that powers my blog. As soon as I do a "real" write up I'll add it to your wiki, thanks for the invitation.

Most of the problems I had were answered by reading your documentations and hints 'n' tips pages, the rest were to do with DIGG not returning any content when called via CURL. I know you've read my post on your forums by now so you'll have already seen my solution. It might be an idea to have a default user-agent for SimplePie_File() though?

Another feature that would be nice would be the ability to get the raw content of the feed without having to use the SimplePie_File() class, but that's just a usability enhancement and not a *problem*, although it did take me a while to find the solution.

I haven't had a chance to play with all of the abilities of SimplePie yet so there may be other suggestions in the future. If I have any I'll make them on your forums as that kinda feels like the appropriate place and would allow your other members to chime in without having to assault their senses by reading my blog ;)

Happy New Year :D

¥
Comment by Gary { @link http://garysblog.co.uk } on 08/01/08
Kinda neat Paul, thats a nice feeds reading page you got yourself.
Hope you are well, we are busy at work (thank goodness) lets hope its a good sign for the New Year ;)

Gz
Comment by ¥åßßå on 09/01/08
Hi Gary, with a tad of luck I'll get chance to wander down tomorrow (urm, that'd be today, but after next sleep ), I'll show you how it all works and quietly throw in "move you to a new server" ... cos I'm subtle like that ;)

Hope you and yours have the very best of new years :)

¥
Comment by Gary { @link http://garysblog.co.uk } on 09/01/08
Cheers Paul, same to you and yours.
You got a new server then ?
Or have they just put a new HDD in the Linux Box ?

Gz ;)
Comment by ¥åßßå on 09/01/08
It's a new one ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 09/01/08
Oh nice one, Linux or Windows based ?

Gz
Comment by ¥åßßå on 09/01/08
It's a sweet lil quad core linux job ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 09/01/08
..........with a good HDD I hope 88|

Gz
Comment by ¥åßßå on 09/01/08
Definitely a better HDD than the last one ;)

I'm on my way to yours now, I'll give yah a tour when I get there

¥
Comment by Gary { @link http://garysblog.co.uk } on 09/01/08
Lol, nice to see you again Paul.
Even though somebody else wished you a Happy Easter before me !!!

Thanks in advance for upgrading my blog, I look forward to playing with it ;)

Well we finally got all those parcels packed-up and they are on their way to the customers, job well done :)

Catch you soon.

Gz ;)
Comment by ¥åßßå on 09/01/08
Yeah, but you clinched it with halloween ;)

I'll move your blog sometime tomorrow, it can take up to 24 hours for the dns changes to show though, but I'm sure you'll be able to tell when it lands ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 10/01/08
Cheers Paul, thanks for that.
Gz :p
Comment by Gary { @link http://garysblog.co.uk } on 10/01/08
Thanks for all your help Paul with the new server, blog upgrade / validation today.
It is most appreciated of you old chap ;)


Gz
Comment by ¥åßßå on 10/01/08
No problem old bean ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 10/01/08
Just so I know, How can I get into the control panel for my space on your server.

Can you email me the details please (URL)

Thanks
Gary
Comment by ¥åßßå on 10/01/08
Hi Gary, hit admin on this blog and there's a draft post with the urls ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 11/01/08
Good Morning or should I say Yabba-daba-do.

The only draft post I can see is 'Do your relatives follow?'

I am sure I am losing the plot :oops:

Gz
Comment by ¥åßßå on 11/01/08
Make sure you're on the right blog, I have a few huh ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 11/01/08
Lol, you mutli blog person you :)
I found that that, but is there not a CP for my webspace.
or is it only for the whole server ?

BTW I was looking for the formatting.php page to allow objects and styles, can I find it, can I heck.
Where have they hidden it this time ;)
Hope your having a good day, I am stuffing my face :p

Gz
Comment by ¥åßßå on 11/01/08
There's two links, the second one is your user control panel ;)

They hid the formatting options here :|

¥
Comment by Gary { @link http://garysblog.co.uk } on 11/01/08
Lol :p, thanks Paul ;)

Have a great weekend

Gz :D
Comment by Gary { @link http://garysblog.co.uk } on 11/01/08
Hey, that's a might good box of tricks in the C.P
I am well impressed with it. :p

I am now a fully signed up member of the blogs forum. :)

Gz ;)
Comment by ¥åßßå on 11/01/08
88|

¥
Comment by Gary { @link http://garysblog.co.uk } on 12/01/08
Yes, I have been posting on the forums and looking around your new severs C.P.
I am very impressed. :p

My girls have found a use for keljem.com ;)

Kelsey found a good use
and so did Jemma

They only started tonight but were having fun:)

Gz
Comment by ¥åßßå on 12/01/08
Bloody hell *runs off to disable KelJem.com before I get a rep for hosting pink sites* ...... ooops hang on, I used to have a pink site ( lol, must resurrect that look one day, it was very .... bright )

Seen yer posts on the forums, even answered one of your questions ( in a bloody long line of questions of yours that I've answered ;) ) .... told yah the members would be able to help you huh? ;)

¥
ps. you need to learn bbcode for the forums, I'll show you some next time I'm at yours ( it's pretty much the same as the bbcode on your blog ;) )
Comment by Gary { @link http://garysblog.co.uk } on 13/01/08
Cheers Paul,
Catch ya on the forums !!!

Gz :p
Comment by Gary { @link http://garysblog.co.uk } on 13/01/08
Paul,
Just found this on Ed B's blog.

Enable Javascript and give the page time to load and then wait a few seconds - its well worth it.

Best shopping website ever

Gz ;)
Comment by ¥åßßå on 13/01/08
lol, yer playing catch-up ;)

¥
Comment by Gary { @link http://garysblog.co.uk } on 13/01/08
Its good though, isn't it ?

Gz:)
Comment by ¥åßßå on 13/01/08
it's certainly imaginative ;)

¥
Comment by EdB { @link http://wonderwinds.com } on 17/01/08
Sorry to go off-topic, but I wanted to talk about the SimplePie plugin thingie. I FINALLY got back to giving it a go and it hung and hung and hung and hung. Did I mention it hanged up my page?

I'm pretty sure the issue is that it was trying to read the feed from h t t p : / /, which it pretty much couldn't do. Therefore I would suggest the default "what feed to read" be b2evolution's news page, or whatever.

And the forum thread where you described how you made it a stand-alone page is in my "watched" list because that is really the coolest functionality imaginable. Lots of feeds out there yah?

Sorry all. We can now go back to ... what was it being discussed here?
Comment by ¥åßßå on 17/01/08
Did your page hang? :roll:

I need to add some validation to the plugin for the feed url but having it default to evo news sound like a plan I can live with ;) We'll hopefully be making a release version soon which will include the checks.

You should bookmark all my forum posts, they're all cool :D

As an aside, and still nowhere near the topic, I've pretty much got the new version of BOPIT running on astonishme, fancy having a play from a plugin developers perspective? ;)

¥

ps. I note you didn't mention the fact that clicking on my smilies work now, after all your bitchin' about it :|
Comment by EdB { @link http://wonderwinds.com } on 25/01/08
:?: Hooray!

Yeah sure re bopit. I'm seeing where it doesn't do much right now yah? Like I'm guessing reading the xml file is a thing of the past? I was just in astonishme's backside and the controller was active but I didn't see anything that made sense for me to do about it knowing a plugin of mine is updated.

Many things on my plate again. Too much perhaps?
Comment by ¥åßßå on 26/01/08
Hi EdB,
I've just updated the developer notes ( BOPIT for developers ) on the original post, hopefully it explains everything you need to know.

Maybe you just need a bigger plate? :roll:

¥
Comment by Troy { @link http://freesite.iblogger.org } on 27/02/08
I can't get the widget to reed my Stumbles feed

http://www.stumbleupon.com/syndicate.php?stumbler=4857980

It validates fine, any suggestions?

Comment by ¥åßßå on 27/02/08
Hi Troy,
I just added that url to my feeds page with absolutely no problem. It might be worth looking at your php info and seeing if you have curl and/or fsock available.

¥
Comment by E. I. Sanchez { @link http://www.theChristianAlert.org } on 28/02/08
Thanks for the great plugin. My only comment is that I wish I could have multiple copies of the widget running on my page.

I tried embedding two copies of the RSS plugin. One on the top and one on the right sidebar but the plugin seems to take the style from the first instance. Even if I type a style under the CSS Class text box, it doesn't take it.

Is this something you can fix?

another idea would be to have this plugin display items from multiple feeds. Great job other wise.
Comment by ¥åßßå on 28/02/08
The chances are that if you download the plugin again then you'll find the css stuff is cured ;)

SimplePie does have the ability to combine multiple feeds into a single feed, but I'd need to have a play to see if this is still possible whilst using the database instead of files to cache the feeds.

¥
Comment by E. I. Sanchez { @link http://www.TheChristianAlert.org } on 28/03/08
I tried using the Max Length: "This is the maximum number of words to display of the items content, 0 = complete content"

But it didn't work for me. I kept getting an error on line 363 of the plugin.

Instead of words, is there a way to limit by # of characters?
Comment by ¥åßßå on 29/03/08
Hmm, that's a tad weird because in my version that line is a comment :p

I'll go find the latest version and zip it up for you so that we're both on the same page. Hopefully that will also cure your error.

The code can probably be amended to limit by number of characters, I picked "words" so that you didn't end up with some gibberish half word when the limit was hit, although there are plans for curing that as well ;)

¥
Comment by tilqicom on 04/10/08
bloody terrific!!!:crazy:
Comment by Filthio { @link http://mattandcat.co.uk/reviews } on 09/02/09
Installed plugin on my 2.4.5 with some excitement. This plugin is exactly what I'd been looking for. Seemed to work for a bit, then page hung showing only sidebar, and then Firefox did that thing it very occasionally does, when it opens loads of blank tabs. Ever get that? PITA. Anyway, I've turned off the plugin with great reluctance. Not sure what's wrong there. Will give you a login ¥ if you want a look.
Comment by ¥åßßå on 10/02/09
That's a tad weird @ tabs. The "hang" is probably when it's updating the feed data, it's governed by the speed of the server(s) it's calling.

A login would be cool ;)

¥
Comment by Lurker on 11/02/09
Yes, that tab thing happens occasionally with javascript I've found. Usually the stuff I write myself. Anyway, panic over, I've found another way to do it
http://remysharp.com/2007/05/18/add-twitter-to-your-blog-step-by-step/

Although that had to be conditional commented to keep out IE6.

Thanx v much for the offer of help Mr ¥, and keep those plugins coming.
Page archived : 11th Nov 2009
 

X