• Welcome to Simple Machines Community Forum. Please login or sign up.

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

Miz

Hi every one. I really wanted to thak you all for this thread it really helped me out alot.

One question though... Right now my rss reads:
/index.php?type=rss;action=.xml;sa=news;limit=5

Which works fine. Displaying the topics on the main site. However it displayed the topics in the order that the toptic it self was started. Which leads to my question...

How could I write this so that I can  order those topics listed in the rss in the order of most recent post inside them?

Thanks again and any help you could offer would be greatly appreshated!
Miz

[Unknown]


TriGrrrl

Is there a way that my users can get a feed for "upcoming events" from the calendar?


Thanks,

TG

DeadMetal

QuoteIn 1.1, you can use boards=1,2,3,4.

-[Unknown]

... to show items from multiple boards does not work! I also used board=1,2,3,4 instead of boards=1,2,3,4 as I assume that was meant by [Unknown]

When I do board=8,4 it only shows items from 8. When I do board=4,8 it only shows items from 4.

Has this function not been implemented yet?

LukaszP

Quote from: Oldiesmann on January 20, 2005, 12:55:32 PM
Some time ago, I posted a thing on how to advertise SMF's RSS feed in certain browsers (see the Tips and Tricks topic for a link to that). However, many people are unaware that SMF even has these features. So, here's a list of available options and what they do...

First, make sure you've enabled RSS output.

Admin -> Edit Features and Options
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.

Now, on to the fun stuff.

All of the XML content is accessed via the ".xml" action... To get RSS or RSS2 out of that (not viewable in most browsers), add ";type=rss" or ";type=rss2" to that URL.

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"
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=recent;board=72;limit=10
Also option:
c=z  - display only the recent posts from coolapse "z"
Example: http://www.simplemachines.org/community/index.php?action=.xml;sa=recent;c=2;limit=10
hxxp:www.smf.pl [nonactive]

Azraeliitti

One thing is bugging me... there is no Enable RSS/XML text or checkbox in my features and options. I even used search function, opened all the mod tabs and couldn't find any match for RSS.

houston

Quote from: Azraeliitti on November 16, 2005, 08:15:01 AM
One thing is bugging me... there is no Enable RSS/XML text or checkbox in my features and options. I even used search function, opened all the mod tabs and couldn't find any match for RSS.

Niether can I locate it anywhere in 1.1 rc1

redone

To enable RSS feeds in 1.1rc:

>News and Newsletters>Settings>Enable XML/RSS news

houston


BlackYeLL

Hi there, sorry for my english.

Is there still no possibilities to see member's reserved boards ?

Something like this could be great :

hxxp:mysite/forum/index.php?type=rss;action=.xml;board=4;login=MyLogin;pass=EncryptedPass [nonactive]

Thank you.

Oldiesmann

Not unless your RSS reader supports cookies, and you're logged in to that particular board.
Michael Eshom
Cincy Space - now open!

MaximusDM

That would be possible with .htaccess., no ?

It would be interesting to add an option to generate a feed according to various criteria chosen by the user (forums concerned, type of desired information...). This feed would be placed in a repertory protected by a file .htaccess whose user will have defined the login and password.

P.S. : sorry for my english


meadwench

::sigh:: I'm tearin' my hair out here.

- Got  >News and Newsletters>Settings>Enable XML/RSS news enabled
- got the following code in my index.template.php:

// If RSS/XML news is enabled, indicate that an RSS feed is available
if (!empty($modSettings['xmlnews_enable'])) {
echo '
<link rel="alternate" type="application/rss+xml" title="Most Recent Posts" href="', $scripturl, '?type=rss;action=.xml;limit=20" />
<link rel="alternate" type="application/rss+xml" title="News" href="', $scripturl, '?type=rss;action=.xml;sa=news" />';
// If we're in a board or topic, indicate extra RSS feeds for that board.
if (!empty($context['current_board']))
echo '
<link rel="alternate" type="application/rss+xml" title="This Board Most Recent Posts" href="', $scripturl, '?type=rss;action=.xml;sa=recent;board=', $context['current_board'], ';limit=20" />
<link rel="alternate" type="application/rss+xml" title="This Board News" href="', $scripturl, '?type=rss;action=.xml;sa=news;board=', $context['current_board'], '" />';
}


...yet *no* indication that a feed is available. The feed validated fine, I've got it loaded on the frontpage of my new Joomla site and it shows up fine. So what am I doing wrong here to get the feed info to show up on the forum page?

Forum is at http://www.gotmead.com/smf/index.php

Thanks for any input!



Vicky Rowe
Health and Weight Loss Coach
http://www.hcgloss.com
SMF 2.0 RC3, Joomla 1.5.8

nutn2lewz

I can't get my rss feed to validate. It does seem to work properly.

When I validate at: http://rss.scripting.com [nofollow]
I get: Undefined root element: xml-feed  2 0

Here is my feed ...
http://forums.homepokertourney.com/index.php?action=.xml;sa=news;type=rss2 [nofollow]

This feed shows the same error ...
http://forums.homepokertourney.com/index.php?action=.xml;sa=news;type=rss [nofollow]

Any help would be appreciated, nutn2lewz



Oldiesmann

I think that feed validator is broken...

When I run the URLs through feedvalidator.org, the regular RSS one is perfectly valid. The only error I get with the RSS2 one is "line 2, column 0: rss is in an invalid namespace: http://backend.userland.com/rss2". This appears to be a widespread issue as this was the default namespace for RSS2 originally. I'm looking into this issue to see what (if anything) can be done to resolve it.
Michael Eshom
Cincy Space - now open!

Oldiesmann

Ok. I did some more checking, and it turns out that the namespace attribute is optional (it's not even used in SMF 1.1), so you can safely remove it...

Sources/News.php

Find
<rss version=', $xml_format == 'rss2' ? '"2.0" xmlns="http://backend.userland.com/rss2"' : '"0.92"', ' xml:lang="', strtr($txt['lang_locale'], '_', '-'), '">

Replace
<rss version=', $xml_format == 'rss2' ? '"2.0"' : '"0.92"', ' xml:lang="', strtr($txt['lang_locale'], '_', '-'), '">

That should make the RSS 2.0 feed valid as well.
Michael Eshom
Cincy Space - now open!

jestyr

same as TriGrrrl
Any chance of getting this to work for making an RSS feed for calendar events?

jestyr

Quote from: jestyr on December 27, 2005, 06:20:43 PM
same as TriGrrrl
Any chance of getting this to work for making an RSS feed for calendar events?
bump?

Aquilo

Quote from: Robinski on March 03, 2005, 05:23:43 PM
is there a Way of requesting the RSS as a logged in user?

cause we have one board that is visible to all (where no one can post)
and the rest is only for authorised users

It would be nice to have somthing like
user=username
pass=password

to get info from all boards

Quote from: Robinski on March 06, 2005, 05:38:04 AM
Ill try that one .. thanx

though it still would be nice if I could do something like user=... and pass=...
so I can use every RSS reader I wouldlike

I know it's been awhile since these posts... but you could try using PHP Curl to do this!

Ajay

I know RSS feeds are enabled on my forum. I can't find the setting under features and Options.

I am running 1.1RC2
Ajay D'Souza [nofollow]

Advertisement: