Advertisement:

Author Topic: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds  (Read 640782 times)

Offline Miz

  • Newbie
  • *
  • Posts: 1
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #40 on: August 30, 2005, 11:25:03 AM »
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
« Last Edit: August 30, 2005, 11:28:02 AM by Miz »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #41 on: August 30, 2005, 04:35:56 PM »
That's how news works.  Try recent instead.

-[Unknown]

Offline TriGrrrl

  • Semi-Newbie
  • *
  • Posts: 43
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #42 on: September 27, 2005, 11:11:01 AM »
Is there a way that my users can get a feed for "upcoming events" from the calendar?


Thanks,

TG

Offline DeadMetal

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #43 on: November 13, 2005, 05:12:15 AM »
Quote
In 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?
« Last Edit: November 13, 2005, 06:44:22 AM by DeadMetal »

Offline LukaszP

  • Newbie
  • *
  • Posts: 2
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #44 on: November 14, 2005, 03:38:25 AM »
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

  • Guest
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #45 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.

Offline houston

  • Jr. Member
  • **
  • Posts: 149
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #46 on: November 17, 2005, 10:00:34 PM »
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

Offline redone

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,938
  • Gender: Male
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #47 on: November 22, 2005, 01:46:41 PM »
To enable RSS feeds in 1.1rc:

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

Offline houston

  • Jr. Member
  • **
  • Posts: 149
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #48 on: December 01, 2005, 03:08:22 PM »
To enable RSS feeds in 1.1rc:

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


Thanks

Offline BlackYeLL

  • Newbie
  • *
  • Posts: 1
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #49 on: December 04, 2005, 02:48:24 PM »
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.

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #50 on: December 04, 2005, 07:57:16 PM »
Not unless your RSS reader supports cookies, and you're logged in to that particular board.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline MaximusDM

  • Newbie
  • *
  • Posts: 4
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #51 on: December 07, 2005, 10:11:03 AM »
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


Offline meadwench

  • Jr. Member
  • **
  • Posts: 119
  • Gender: Female
    • hCGLoss.com - Lose the Weight & Keep it Off
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #52 on: December 09, 2005, 05:49:27 PM »
::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:
Code: [Select]
// 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

Offline nutn2lewz

  • Semi-Newbie
  • *
  • Posts: 22
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #53 on: December 17, 2005, 01:43:41 PM »
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



Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #54 on: December 22, 2005, 04:26:23 PM »
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
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #55 on: December 22, 2005, 04:38:07 PM »
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
Code: [Select]
<rss version=', $xml_format == 'rss2' ? '"2.0" xmlns="http://backend.userland.com/rss2"' : '"0.92"', ' xml:lang="', strtr($txt['lang_locale'], '_', '-'), '">
Replace
Code: [Select]
<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
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline jestyr

  • Semi-Newbie
  • *
  • Posts: 15
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #56 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?
« Last Edit: December 27, 2005, 06:22:43 PM by jestyr »

Offline jestyr

  • Semi-Newbie
  • *
  • Posts: 15
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #57 on: December 31, 2005, 01:04:12 PM »
same as TriGrrrl
Any chance of getting this to work for making an RSS feed for calendar events?
bump?

Offline Aquilo

  • The Black Llama
  • SMF Hero
  • ******
  • Posts: 1,518
  • Gender: Male
  • ‹^^› ‹(-_-)› ‹^^›
    • The Arencibia's
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #58 on: January 01, 2006, 04:46:55 AM »
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

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!

Offline Ajay

  • Semi-Newbie
  • *
  • Posts: 17
  • Gender: Male
    • Ajay - On the Road called Life
Re: Getting the Most Out of SMF - XML, RSS and RSS2 (and Atom and RDF) feeds
« Reply #59 on: January 05, 2006, 06:29:26 AM »
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]