[BETA] RSS Content Syndicator for phpBB 2.0.x

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

[BETA] RSS Content Syndicator for phpBB 2.0.x

Postby nschindler » Thu Jul 17, 2003 11:25 pm

I suppose this should live here until the MOD team responds to my submission requests.

I've put together a few different RDF content syndicators and added a few options. Firs of all, this syndicator is post-centric by default, meaning it returns posts, instead of topics. This can be overridden by using ".../rss.php?t=1". This is much better for high-traffic boards.
There is also a 'c' option to control the post count (upper limit of 50 posts), and an 'f' option to control which forums are in the feed. Use a comma-separated list for multiple forums. This defaults to all public forums. The syndicator won't ever show forums which aren't available to the public.

Anyway, give it a try, and let me know if it has issues.

Download: http://www.sins.la/N8/RSS_Content_Syndicator-2.0.2.zip
Demo (Plug this into your favorite feed reader): http://www.sins.la/phpBB2/rss.php

Update:
v2.0.2 released, 2003-07-28

Changelog:
- author is now a user profile link.
- added lastBuildDate tag to channel information.
- post times now show time zone.
- did some code clean-up.
- removed option to leave html tags intact (s=0). Normal tags break the feed, and I realized that there's no way I'd be able to make this thing work in every buggy feed reader out there. your feed reader needs to support RSS 0.92. if it does, you won't have an issue. if it doesn't, it's not my fault.

ToDo:
- more code clean-up.
- add trim count option for post body.
- add trim character option for post body.
- add date offset start option.
- add date offset end option.
- make feed respect global and per-post display settings for smilies, html, bbcode, and signatures.
Last edited by nschindler on Wed Aug 06, 2003 4:26 pm, edited 2 times in total.
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby Rapid Dr3am » Fri Jul 18, 2003 1:26 am

Demo?
Rapid Dr3am
Registered User
 
Posts: 198
Joined: Sun Jul 13, 2003 4:14 pm
Location: Incommunicado

Postby nschindler » Fri Jul 18, 2003 1:35 am

Source Demo: http://www.sins.la/phpBB2/rss.php
Parsed Demo http://www.livejournal.com/users/sinsbb

The parsed demo is broken apart into separate pages by livejournal.com.
Most feed readers would show the feed as one stream of posts. Ultimately, the feed layout is defined by the feed reader.
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby Rapid Dr3am » Fri Jul 18, 2003 2:11 am

nschindler wrote:Source Demo: http://www.sins.la/phpBB2/rss.php
Parsed Demo http://www.livejournal.com/users/sinsbb

The parsed demo is broken apart into separate pages by livejournal.com.
Most feed readers would show the feed as one stream of posts. Ultimately, the feed layout is defined by the feed reader.


Looks a tad bit messy imho.

I made a RDF hack a while ago.
Rapid Dr3am
Registered User
 
Posts: 198
Joined: Sun Jul 13, 2003 4:14 pm
Location: Incommunicado

Postby nschindler » Fri Jul 18, 2003 2:31 am

i would agree that the php file may be a little messy. i'm brand new to php... but then again, 80% of it came from other projects. Plus formatting the output for two different configurations of readers wasn't easy.
if you have suggestions in the way of code clean-up, i'm happy to hear it. Just saying 'it's messy' isn't much help, though. ;)
i don't like all of the 'if' statements i used. a couple can probably be consolidated, but in the end, the script works better than any other rdf/rss syndicator i've found posted here (that's why i built it... i needed more than what i had found), and it doesn't require any direct editing in the php or tpl files to make it work for different sites. it's also not dependant on any other MOD (such as phpbb_fetch_posts) to function.

if you're referring to the source feed, of course that looks messy... it's raw data. :)

if you're referring to the parsed feed, blame livejournal. I provided that link pretty much just to show how the description field looks after being parsed.
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby AlleyKat » Fri Jul 18, 2003 3:35 am

8O I must'ave hit your mod minutes after you made that initial post!

Anyway, I wanna say it's a great initiative! I know, there are others - but this seems pretty promising, indeed.

I can provide you with the first error message, I guess: My Miranda (Instant messenger, replaces & handles ICQ, MSN etc.) has a built-in rss-reader which i've never had trouble with before.
Code: Select all
Hardware & Handel - Spørsmål og (måske) svar, pristips... :: Hardware-hjørnet ta'r med tak imod indlæg
http://(mysite)/phpBB2/viewtopic.php?p=5#5
Author: AlleyKat<br />
Subject: Hardware-hjørnet ta'r med tak imod indlæg<br />
Posted: Thu 03. Jul, 2003 4:47 pm<br />
Topic Replies: 0<br /><br />
<span class="postbody">Når du nu lige sidder efter en go'/dårlig oplevelse med et stykke hardware eller en forhandler - lad det komme til udtryk hér! Anmeldelser, tips, tricks og kommentarer er meget velkomne.
<br />
<br />
<img src="http://(mysite)/phpBB2/images/smiles/icon_arrow.gif" alt="Arrow" border="0" />  Vær bare lidt objektiv; en 160 GB HD lukket inde i en flytbar ramme KAN ikke undgå at brænde af hvis den ikke kan komme af med varmen...
<br />
<br />_________________<br /><span style="color: darkgreen"><span style="font-size: 11px; line-height: normal"><span style="font-style: italic">AlleyKat</span></span></span></span><br />

This is how it looks in my reader, using (mysite)/phpBB2/rss.php?s=0
(with or without the s=0 i'm afraid) it's the <br /> and <span> and all that which bothers me... Is it me? My reader? Some obscure settings that I don't get?

Thanks! :D
User avatar
AlleyKat
Translator
 
Posts: 1024
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark

Postby nschindler » Fri Jul 18, 2003 3:54 am

great... so there's another one. :)
I suppose yours wants "/n" instead of "<br />". i convert the other way for the other readers. initially, i would say that your reader only supports rss 0.9 or 0.91. stripped tags weren't supported until rss 0.92

I'll look into it, and see what i can do. :)
Can you tell me where i can get a copy of your reader?
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby AlleyKat » Fri Jul 18, 2003 4:14 am

:) I sure can... err I was pretty sure it did follow the standard, actually :lol: never had one show up like that before.

I'm afraid the source isn't available for this one (if it's of use anyway). It is integrated in this smooth&wonderful IM:
http://www.miranda-im.org
I don't think you need any protocols online (icq/aim/msn etc), but you'll need the popup plugin and the RSS-News plugin itself. :)

edit: I've finally gotten meself chewed through the RDF thread! And I have to mention - I get content (and have for some time now) from Frolds site. It works excellent. If I get the chance, I'll look into it later tonight.
User avatar
AlleyKat
Translator
 
Posts: 1024
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark

Postby nschindler » Fri Jul 18, 2003 6:12 am

I found it after I had posted. I like miranda. very cool. it's about time there was an all-in-one open source messenger... er, i guess there probably has been for a while, but it's news to me. :)

It makes sense that the html tags aren't parsed, considering that the final output isn't html. I would still assume he's expecting rss 0.9 or rss 0.91. In order for this to work... from what I've seen so far, "<br />" would have to be converted to "/r/n". That just takes care of line feeds. All the other stuff that would be found within the post text, like spans, tables for quotes, font formatting, images, any other bbcode, etc. would need to be removed. Miranda doesn't seem developed enough to display formatted text.... or at least I couldn't find a place to do it in the 10 minutes I messed with it. I could fix the line feeds, but you'll still either have html tags all over the place, or you'll have chunks of the post missing.

Still, I'd like to see some of the feeds you read from this. Can you provide some urls to the feed sources?

RSS is a pretty screwed up standard. RSS readers are definitely not created equal. I'm interested in making this syndicator as flexible as I can so that it works in most readers, but in the end, this is by default a valid RSS 0.92 feed syndicator, and if it doesn't show up correctly in the reader, it's not really the syndicator's fault. It may be that the reader is only able to read RSS 0.9 or 0.91, or it may be that the reader has a bug. Regardless, I'm willing to look into it further. :)
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby AlleyKat » Fri Jul 18, 2003 7:52 am

nschindler wrote:(..) I like miranda. very cool. it's about time there was an all-in-one open source messenger (..)
Yup, I've sure become a fan, too. And generally excellent support, too, althou I'd like Corsario (RSS plugin author) to show his face more.

Corsario wrote:0.0.0.3
- More bug fixes.
- UI improvements.
- More bug fixes.
0.0.0.2
- Some bug fixes.
- Better RSS 1.0 support.
0.0.0.1
- First release.

I gotta say right away: I have no idea what format it reads or how; I DO know it shows more than just a header. It isn't, however, too well handled. When I get (too) long news from my main danish provider, the start of the popup is sometimes outside the other side of the screen.

nschindler wrote:In order for this to work... from what I've seen so far, "<br />" would have to be converted to "/r/n". That just takes care of line feeds. All the other stuff that would be found within the post text, like spans, tables for quotes, font formatting, images, any other bbcode, etc. would need to be removed.
Yes but as mentioned: I already get (perfect) feeds from Frolds site. See this thread (never mind the language - its the 2 first links). Maybe it's related to the
Code: Select all
$remove = array("[url", "[/url", "[img", "[/img", "[b", "[/b", "[i", "[/i", "[size", "[/size", "[color", "[/color", "[*", "[code", "[/code", "[quote", "[/quote", "[list", "[/list");
(...)
part of the script I'm guessing that Frold is using.

nschindler wrote:(...)Still, I'd like to see some of the feeds you read from this. Can you provide some urls to the feed sources?

Above; most of the rest comes from http://rss.asdf.dk (DR, TV2), 2 Moreover-feeds (CNN), and ITN News (when online). :D
nschindler wrote:(...) I'm interested in making this syndicator as flexible as I can so that it works in most readers, but in the end, this is by default a valid RSS 0.92 feed syndicator, and if it doesn't show up correctly in the reader, it's not really the syndicator's fault. (...)
I agree, absolutely. And maybe this needs to be another mod or at least version. I'm pretty sure 'my problem' is just a minor detail anyway, and quite easily fixed (re. the solution I'm pointing out myself). But a nice, flexible syndicator like this should, imho, have even more features;
    I maybe imagine a general set of var's at the start, defining admin-side stuff like
  • limiting the post itself in length
  • limiting till certain character
  • maybe possible to make combinations
  • maybe set max width of output; maybe (re-)format it?
  • limit # of posts it's possible to pull
And for user side, maybe also possibility to set max. length; maybe other features?

Well, I'll grab a few Z's, I spend far too much time online :oops: - thanks for taking time looking into it. :D
Oh, and just ask if there's something you want to know about Miranda :wink:
User avatar
AlleyKat
Translator
 
Posts: 1024
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark

Postby nschindler » Fri Jul 18, 2003 8:38 am

Just a quick reply for now :)

"Better RSS 1.0 support."
It may very well be possible that this guy supports RSS 2.0 tags even, but entity encoded html tags within the discription field are allowed in rss 0.92 and up... so the reader should be ready for them, even if it can't properly translate them into something meaningful.

The feeds you've listed don't use any entity encoded html tags, and the line feeds appear to be /r/n. It'd be /really/ hard to strip phpbb post text down that much, but that piece of code you pasted is a pretty good start. I agree... if this were done, it should be a separate script.

as far as the admin-side stuff goes:
-post length - existed in one of the projects I stole.. er.. borrowed code from; phpbb_fetch_posts. i didn't bring it in to this one, because I had no use for it. I think that could be useful.
-limiting at certain char - same response as 'post length' :)
- combinations - huh?
- output - not so sure about that one... i think that's better left to the reader. changing this may cause problems.
- count limit - already there. "../rss.php?c=<how many>"

I'm trying to make all configurable items html variables so they can be controlled by admins or users. as long as it doesn't pose a security threat, i think this is best.
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby AlleyKat » Fri Jul 18, 2003 1:47 pm

Combinations... here my sleepy brain was thinking advanced combinations of limiting, like "to first period after 100 chars" and stuff like that. Kinda silly. Just forget it. :D

MY problem in all this is, that it's been a pretty darn long time since I worked with SQL, so I simply can't remember the exact way to handle the sql statements :wink: I just find myself with the same problems a lot of the other 'n00bs' in the RDF-tread has, hehe. Just gotta read up on it...

Well, don't mind me, now, I think I'm getting the hang of it and make the corrections myself. The code won't be pretty, but I'm sure it'll work. :lol:
The code snippet is part of what 'chadsmith' suggested here, which, I guess, should give me all I need (when adding '23degrees' & 'gryu' 's suggestions and fitting it to my needs).

Keep up the good work - I'm still all for the idea.
User avatar
AlleyKat
Translator
 
Posts: 1024
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark

Postby nschindler » Fri Jul 18, 2003 4:26 pm

I used gyru's suggestion in mine, too. I saw limitless count as a pretty big security issue as well.

I think, once I can honestly consider my mod "stable" in a web environment, I'll probably add an "s=2" option for non-html readers, like yours and chadsmith's.
Limiting the length is most likely something else I'll do. I kinda wanted to include all of the phpbb_fetch_post options, like date ranges, disabling smiles/bbcode, showing only announcements, sticky topics, etc. But at the same time, I didn't want to bloat this that much. I'll probably end up just taking a couple of important options from it.

If you're having trouble with sql, what I've been using that seems to help a lot is phpMyAdmin. You can graphically build an sql query, and once you see that you're selecting everything okay, you can just click the link to convert it to php code. Once there, you just have to follow phpbb's method of turning table names into variables. :)
My problem is still figuring out which function to use for certain things. php itself has /way/ too many functions to begin with, then phpBB has a whole slew of their own on top of that. htmlspecialchars vs. htmlentities for example... wtf? it's a lot of reading to figure this crap out. :?

I'm gonna let this sit here for a week or so, and give people a chance to test it. I also just need a break for a few days. I'll add a second level of tag stripping for these non-html readers, and character limits to my todo list.
If you use my script as a base, and you happen to beat me to these things, post your changes. :wink:
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Postby PhilippT » Thu Jul 24, 2003 6:08 pm

great..... absolutley what i searched for..... [going to test it]

EDit:

Works great on my feedreader 2.5 b610

but im not shure.... to make the username as a
Code: Select all
?mode=viewprofile&u=____


a idea ??? (good/bad)
PhilippT
Registered User
 
Posts: 419
Joined: Mon May 06, 2002 5:59 pm

Postby nschindler » Thu Jul 24, 2003 11:22 pm

PhilippT wrote:great..... absolutley what i searched for..... [going to test it]

EDit:

Works great on my feedreader 2.5 b610

but im not shure.... to make the username as a
Code: Select all
?mode=viewprofile&u=____


a idea ??? (good/bad)


Not quite sure what you mean... your above code would usually append to profile.php to show user details, correct? how would this apply to an rss feed? You want the username to link to the user's profile? If that's what you mean, it's a damn good idea! :twisted:

Edit:

I hadn't ever seen feedreader until now. that thing rocks for alpha software!
User avatar
nschindler
Registered User
 
Posts: 101
Joined: Tue Jun 17, 2003 12:24 am
Location: Los Angeles, CA, USA

Next

Return to [2.0.x] MODs in Development

Who is online

Users browsing this forum: No registered users and 4 guests