Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds

Started by Oldiesmann, January 20, 2005, 12:55:32 PM

Previous topic - Next topic

jay.clark

I am still trying to figure out the string required to log into a SMF system and do a scoop of an RSS feed for a specific forum.  Everything works fine when the forum I want to get an RSS feed for is readable by guests.

However when you have to be a member in order to read the forum, my code does not work. I figure that I have to add a userID and passWord to the string but I am clueless as to how to do this.

Can anyone help me out?

Thanks in advance - JayR
SMF 1.11- SMF 2.0 RC2/RC3 - - RSS Feed Poster 2.2,RSS Feeder 1.1.4, Downloads System Pro 1.0.17.1, SMF Classifieds 1.3.5, SMF Gallery Pro 3.0.2, SimpleDesk - Integrated Helpdesk for Simple Machines Forum 1.0 Felidae, Aeva Media 1.1b, Ultimate Profile     0.9, Google Analytics Code 1.1, Twitter and Facebook Publisher mod 2.4, Stop Spammer 2.3.7, SMF Links 2.2, Site map 2.1.2, AjaxChat Integration 3.2.1, Ad Management 2.3.6

SMF (Donated) SMF Links (donated) - Ad Manager (donated) - phpMyChat (donated)

Paracelsus

Quote from: jay.clark on August 10, 2010, 12:11:53 PM
I am still trying to figure out the string required to log into a SMF system and do a scoop of an RSS feed for a specific forum.  Everything works fine when the forum I want to get an RSS feed for is readable by guests.

However when you have to be a member in order to read the forum, my code does not work. I figure that I have to add a userID and passWord to the string but I am clueless as to how to do this.

Can anyone help me out?

Thanks in advance - JayR

Can this be done? Never heard of such thing...

Pillas

Is it possible to have RSS public? Because rss irc bots etc can't authenticate anywhere to get the rss data. So is it possible to view the rss without logging in?

Dzonny

Quote from: Pillas on August 21, 2010, 06:53:07 AM
Is it possible to have RSS public? Because rss irc bots etc can't authenticate anywhere to get the rss data. So is it possible to view the rss without logging in?
No, except if you open your forum for guests, then rss can be viewed by those bots.

Frantix

Thanks for the info... I'm working on trying to integrate without changing from SMF, even though it seems it would be easier.
Success breeds complacency. Complacency breeds failure. Only the paranoid survive. -Andy Grove

Neol

Is there any way to get only the new opened topics and not the new posts in a topic?!

Neol


Oya

put ;sa=news in teh url

and please dont bump in less than 24 hours in future everyones a volunteer here

TheMortician4

Okay, I am confused, where do I enter or add these lines like:

"Sub-action": recent
Default: Shows 5 most recent posts
Available options:
limit=x - display the "x" most recent posts (if number is less than 5, it will display 5. If number is larger than 255, it will display 255).
board=y - display only the recent posts from board "y"
boards=x,y,z - display only the recent posts from the specified boards
c=x or c=x,y,z - display only the recent posts from boards in the specified category/categories


TheMortician4

Quote from: Oldiesmann on January 20, 2005, 12:55:32 PM
One of the best features in SMF is its news feeds. However, many people aren't aware of how many options there are, or that this is even available. So, here's a list of available options and what they do...

First, make sure you've enabled the feeds:

Admin -> News and Newsletters -> Settings
Check the box next to "Enable XML/RSS News".
The "Maximum post length" value determines how many characters of a post are output in the feeds. The default value (255) is fine for now


I enabled this RSS feed in the Admin Sections, excuse my ignorance as I am still learning how to do this stuff, but could you explain to me step by step how to get this to work? As I am apparently not getting the grasp of how to set up a feed for the site.

Now, on to the fun stuff.

All of the XML content is accessed via the ".xml" action...
Other formats can be achieved by adding one of the following to the URL:
;type=atom - Atom
;type=rdf - RDF
;type=rss - RSS 0.91
;type=rss2 - RSS 2.0

The default feed is the 5 most recent posts:
http://www.simplemachines.org/community/index.php?action=.xml

There are several "sub-actions" available to this action, specifying exactly what to display:

Recent Posts (displays the most recent posts that you can see)
"Sub-action": recent
Default: Shows 5 most recent posts
Available options:
limit=x - display the "x" most recent posts (if number is less than 5, it will display 5. If number is larger than 255, it will display 255).
board=y - display only the recent posts from board "y"
boards=x,y,z - display only the recent posts from the specified boards
c=x or c=x,y,z - display only the recent posts from boards in the specified category/categories
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=recent;board=72;limit=10

News (displays the first post from the most recent topics that you can see)
"Sub-action": news
Available options:
limit=x - display only "x" items
board=y - display only news topics from board "y"
boards=x,y,z - display only news topics from the specified boards
c=x or c=x,y,z - display only news topics from boards in the specified category/categories
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=news;board=72;limit=10

Members (displays most recent members):
"Sub-action": members
Available options:
limit=x - display only the "x" most recent members
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=members;limit=10

Profile (displays the "profile summary" data in a nice XML feed for the specified user)
"Sub-action": profile
Required option:
u=x - display the profile info for user whose ID is "x"
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=profile;u=150

Now - you're probably wondering what you can do with this. Quite a bit actually.

You can syndicate this stuff by giving people these URLs to use on their sites (they will need to have their own RSS parser to deal with it though - CaRP is a good free one (requires PHP)). You can also use PHP's XML Parser Functions to format the output the way you want it (although you can also do this using SSI.php). There are also several free sites that will parse the feeds for you, including www.rss2javascript.com and www.feedburner.com.

You can also subscribe to these feeds through an XML reader, Firefox, Thunderbird or any other software that supports XML or RSS feeds (note - Outlook and Outlook Express do not support this...) - you will need to have either "type=rss" or "type=rss2" somewhere in the URL for it to work. If you would like to know how to set this up in Firefox or Thunderbird, let me know. Enjoy!

EDIT: Updated post to reflect options available in 1.1.
EDIT again: Fixed typo (";type=rss - RSS 2.0" -> ";type=rss2 - RSS 2.0" - thanks to Sarge for pointing that out)

TheMortician4


TheMortician4

I am getting this error 


XML error: Not well-formed (invalid token) at line 1

Oya

that's because as per your other topic, the board is not available to guests and throws up a login form instead of the rss feed

Paran0ia

Quote from: Oldiesmann on August 03, 2006, 11:53:19 AM
Quote from: iago23 on June 01, 2006, 11:59:30 AM
Quote from: Oldiesmann on December 04, 2005, 07:57:16 PM
Not unless your RSS reader supports cookies, and you're logged in to that particular board.
Wow.  Huh.  Okay, I'm crushed.  I'd hoped SMF was more up to the task than I thought it was, but clearly it's not.  Cookies should never be necessary for this sort of thing; requiring them just seems silly.

SMF doesn't support remote logins (ie passing the username and password through the URL instead of through a form) because it's extremely insecure. What other option do we have? We can't just ignore board access simply because it's a news feed.

I know I'm quoting an old-old post, but it looks like it still hasn't been changed. Encryption is the way to do it: there needs to be a feature where you can click on 'get rss url' or something along those lines and be given a unique url with something along the lines of 'index.php?action=.xml;type=rss&user=Paran0ia;passkey=1645f6gs52df46a139e3460c6baca990'

Is this something that has been considered/has been added/will be added/could be considered? To go 5 years and still not address an issue that's been brought up by customers repeatedly seems... well, stupid.

And I apologize a million times over if this issue has been resolved, but I'm a regular user, and I'm having a darn hard time finding it. There needs to be a non-cookies way to view your RSS feeds.

TheMortician4

Quote from: Oya on October 22, 2010, 05:15:47 PM
that's because as per your other topic, the board is not available to guests and throws up a login form instead of the rss feed

Well I have resolved the guest view issue.


Now the question comes down to this....If I want to feed this board URL to say facebook. How do I do that?

Board url (guest viewable): http://www.bbiclan.com/forum/index.php?board=1.0

and feed to the page: http://www.facebook.com/pages/Body-Bags-Included-Clan-Fan-Page/149224221787491?v=wall

Oya

you use something like twitterfeed to check the feed and repost

the feed url http://www.bbiclan.com/forum/index.php?action=.xml;type=rss;sa=news;board=1 (like the information in the first page of this thread)

TheMortician4

I copied and pasted that feed into the URL, and got this error still....


XML error: Not well-formed (invalid token) at line 1


Where am I going wrong here?

Oya

i don't get that error, looks like correct xml to me (rss is an xml format)

TheMortician4

Quote from: Oya on November 06, 2010, 05:50:39 PM
i don't get that error, looks like correct xml to me (rss is an xml format)

That is where I am lost...!!! I don't get what I am doing wrong, or where the error is occurring from...

Advertisement: