Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Latest blog in postbit - magpierss Details »
Latest blog in postbit - magpierss
Mod Version: 1.00, by vauge (Member) vauge is offline
Developer Last Online: Dec 2013 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.0 RC2 Rating: (0 vote - 0 average) Installs: 9
Released: 02 Aug 2005 Last Update: Never Downloads: 108
Not Supported Uses Plugins Template Edits  

For this hack, we are using magpierss - simple and GPL.
===========================================================
MagpieRSS provides an XML-based (expat) RSS parser in PHP.

MagpieRSS is compatible with RSS 0.9 through RSS 1.0. Also parses RSS 1.0's modules, RSS 2.0, and Atom. (with a few exceptions)

http://magpierss.sourceforge.net/
===========================================================
Idea came from DigitalPoint. I have actually been using this for several months on my forum.
But with the new plugin system, it's even easier to share.

Install instructions:

Step 1)
Magpierss

Download & Install: http://magpierss.sourceforge.net/

Create a "cache" directory or make sure path is ok in: MAGPIEDIR/rss_cache.inc


Step 2)
Create a new profile field for the Blog - Note the field#
The example below is field 7.


Step 3)
Edit magpierss.xml
1. include your full path to magpierss/rss_fetch.inc
2. Change field 7 to applicable field.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 4)
Import magpierss.xml


Step 5)
In your postbit template add the following (note field #!):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

===============================================
Attached files: 2
Template Edits: 1
Simplicity: Easy
Time: < 30 mins, 5 mins for advanced users

Attached is a screen from another nevetS's Blog Feed parser using Carp - it is just as relivant.
http://www.vbulletin.org/forum/showthread.php?t=91781

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	postbit.jpg
Views:	928
Size:	25.9 KB
ID:	32795  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Mini Mods Display latest blog post in postbit using Magpie RSS pmkb vBulletin 3.6 Add-ons 37 24 Aug 2009 22:38
Latest Blog Feed in Postbit using Carp RSS nevetS vBulletin 3.5 Add-ons 81 15 Apr 2009 11:53

Comments
  #2  
Old 12 Aug 2005, 11:08
WonderWorm WonderWorm is offline
 
Join Date: Jun 2002
Thanks clicked the Install .. going to check it out now.

- - - - -

Edit: I can't seem to get any output after installing this plugin.

I have installed MagpieRSS correctly. I created a directory called magpierss and uploaded the 4 main files along with the directory called extlib with the file Snoopy.class.inc in that directory. I then created a cache directory and set the proper permissions.

Next I created the profile field which was number 7 for me. Just a basic one line text field.

I then edited the xml file for the plugin and added my full path and double checked the field number which was already at 7. Then I used the plugin manager to upload the plugin xml file and it was added correctly.

Then I edited my postbit template with the if statement.

Now comes the problem .. the cache works fine and when I open the cache file in my editor it is reading the RSS feeds I am testing with just fine but on my post it never shows the post title or link.

Anyone else have this issue or am I missing something?

Example of where I have it .. maybe the placement? but the hook seems to be for the whole postbit so not sure there.

http://forums.emufanatics.com/showth...=5751#post5751

- - - - - - -

Edit2: I did a standalone test just using MagpieRSS .. and it works so at least I know it's not the server. .. http://forums.emufanatics.com/rsstest.php

- - - - - - -

Edit3: Sorry for so many edits. After checking out some of the included documentation for MagpieRSS I noticed in the recipes file they showed how to limit the number of posts to show .. so I went ahead and stuck this into the plugin and now it works perfectly for me. Here is the code I used.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Many thanks for this great plugin.
__________________
- Keith | My EFx2Blogs Dev Blog | EFx2Blogs Forums | EFx2Blogs - Sign Up For Your Own Free EFx2Blog Today!

Last edited by WonderWorm; 12 Aug 2005 at 12:59.
Reply With Quote
  #3  
Old 13 Aug 2005, 13:57
vauge vauge is offline
 
Join Date: Oct 2004
Awesome - thanks for the catch.

I didn't limit it, in case I wanted to pull the RSS for other pages.
__________________
Forum
Political Forums
Reply With Quote
  #4  
Old 17 Aug 2005, 00:11
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
Since there's a cache I'm assuming that this doesn't mean every time showthread.php is called that it's a hit on all the feeds of that page, does it?
Reply With Quote
  #5  
Old 17 Aug 2005, 00:19
vauge vauge is offline
 
Join Date: Oct 2004
Originally Posted by GilbertZ
Since there's a cache I'm assuming that this doesn't mean every time showthread.php is called that it's a hit on all the feeds of that page, does it?
Only if someone has a blog link in the thread and only the amount of time between caches.
I have mine set on an hour. If 3 folks in the thread have blogs it could potentially be 3 hits getting feeds.
__________________
Forum
Political Forums
Reply With Quote
  #6  
Old 17 Aug 2005, 00:26
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
Meaning if there are 3 blogs then it can be up to 3 hits per hour?

Although this hack is working for me, I looked in my cache directory and it's empty. I went into a thread where I know there are a couple blog links and same story.

Do you see data in your cache?

Any suggestions to debug this? I'd like to test it in a way to see what error messages would come up when trying to create the cache.

Just as a test I made the most lenient permissions on the cache directory yet nothing comes up.
Reply With Quote
  #7  
Old 17 Aug 2005, 03:45
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
I fixed it. If you don't see a file in your cache directory, that means cache isn't working for you. To debug this, open your rss_fetch.inc file.

Explicitly define the full path to your cache directory.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Turn on DEBUG mode.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Make sure permissions are good for the cache directory. Then create a simple test.php file containing this, but replace your data where necessary:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then call that page and if you see an error that should help you debug it. If you see the feed, you should be all set, but "ls cache" and look for files to be sure. ALSO, don't forget to turn DEBUG back off.


One more point on the hack the way it's currently put. I believe you are calling this in global.php unneccessarily. This adds an include on every single page of vbulletin. Instead of two hooks, just remove the hook to the global and stick that line
require_once '/path/to/magpie/rss_fetch.inc';
in the postbit hook and it'll work fine and reduce load.

Last edited by GilbertZ; 17 Aug 2005 at 06:22.
Reply With Quote
  #8  
Old 17 Aug 2005, 04:26
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
Sorry for the serial posts, but there is a huge problem with this hack. If a user puts in a bogus entry, any thread with that user will get a big error message passed from magpie. There needs to be a way to suppress errors.

It would also be a good idea when creating the custom profile field to get a good REGEXP to validate URLs. I'm looking for some code that will work. If you have it, please post to this thread:

http://www.vbulletin.com/forum/showt...486#post943486

Last edited by GilbertZ; 17 Aug 2005 at 04:37.
Reply With Quote
  #9  
Old 17 Aug 2005, 04:57
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
Although I'm still missing a good regexp for url validation that works w/ vb, I did fix everything else. Here's how. Modify your plugin to look like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #10  
Old 21 Aug 2005, 13:07
vauge vauge is offline
 
Join Date: Oct 2004
Originally Posted by GilbertZ
Although I'm still missing a good regexp for url validation that works w/ vb, I did fix everything else. Here's how. Modify your plugin to look like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Since I am pulling whole thing, might not be applicable to your changes.
I tried checking for XML or RSS in the URL before it runs. So far, it appears to be working for me.
__________________
Forum
Political Forums
Reply With Quote
  #11  
Old 21 Aug 2005, 19:09
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
What do you mean "pulling the whole thing"?
Reply With Quote
  #12  
Old 21 Aug 2005, 22:46
vauge vauge is offline
 
Join Date: Oct 2004
My code is pulling all the items into an array, then doing an array_slice.
(in case I ever want to display more than one)

Your code is only pulling & cacheing 1 item.
__________________
Forum
Political Forums
Reply With Quote
  #13  
Old 22 Aug 2005, 11:10
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
OK, that's what I thought but I wanted to double check.

My code wasn't really related to that. It's just to do some error checking. For example let's say a user puts this in their blog field:

"htpt:\\theirdomain.com/ url.html"

you will have a bad error. The error checking should save some nasty errors on top of the page of any thread that user posts in.
Reply With Quote
  #14  
Old 22 Aug 2005, 11:37
vauge vauge is offline
 
Join Date: Oct 2004
I wonder if error checking would be better in the CP instead of runtime?
__________________
Forum
Political Forums
Reply With Quote
  #15  
Old 22 Aug 2005, 16:11
GilbertZ GilbertZ is offline
 
Join Date: Nov 2004
You definitely want to error check at runtime (as well as CP) because a url that's good today can be bad tomorrow.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:20.

Layout Options | Width: Wide Color: