News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

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

maritimesbob

Using the following is working fine for my board/site

Quote/index.php?type=rss;action=.xml;sa=news;boards=4,7,9,10,11,12;limit=20

Problem is it displays the latest topic fine, however it`s going from the very first post in that particular topic.

Changing to sa=recent only means the latest posts will be displayed. I was looking for the latest topics to be displayed. Can this be done?

daygo140

I am trying to add this to my GMAIL Web Clips but when I enter the feeds location I get, "No feed was found at the URL you provided."

What format does the URL need to be for this to work with GMAIL Web Clips?

Vyen

Oh-ho, man! Works like a charm!

Gotta fiddle with Carp to get it to format the way I want...but there's only one snag.

It doesn't spit out the date, time, or author.  =\ Meh!

Any suggestions?

maritimesbob

I`m using Carp and for the most part it works great. Occasionally though I`m getting poorly formatted feeds when a new thread is started. This causes Carp to fail and throw out the following error `XML error: not well-formed (invalid token)`.

I looked at the lines where Carp was not happy, and for reason reason the rss has some addition funky looking characters which don`t look right. It`s a bit hit and miss now. I never know whether a newly started thread will crash my feed or not.

Oldiesmann

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.

Quote
I'm also disappointed that there's no built-in "make me a feed of this particular member's recent posts"; instead, it's solely board-centric.

Actually that wouldn't be hard to implement (see below).

Quote
As implemented, the RSS feature's not going to fit my board's needs at all.

Anyone have any hints as far as how to hack in the ability to a) accept on-the-URL credentials, and b) allow the most-recent-posts-from-user page to render just like any board feed would?

I'm sorry you feel that way, but unfortunately until someone finds a secure way to pass a username and password via the URL, SMF will not support remote logins.

As you (and several others) have requested, here's how to add user-specific "latest posts" functionality to SMF's news feeds...

1.0.x:

Sources/News.php

Find
Code (Line 293) Select
global $db_prefix, $user_info, $scripturl, $modSettings, $board;

Add after that
if(isset($_GET['u']) && !empty($_GET['u']))
$_GET['u'] = (int) $_GET['u'];


Find
Code (Line 301) Select
AND $user_info[query_see_board]

Add before that
" . (!empty($_GET['u']) ? " AND m.ID_MEMBER = $_GET[u]" : "") . "

1.1:

Sources/News.php

Find
Code (Line 597) Select
global $query_this_board;

Add after that
if(isset($_GET['u']) && !empty($_GET['u']))
$_GET['u'] = (int) $_GET['u'];


Find
Code (Line 604) Select
AND $query_this_board

Add before that
" . (!empty($_GET['u']) ? " AND m.ID_MEMBER = $_GET[u]" : "") . "

That will allow you to get a feed of a member's recent posts at /index.php?action=.xml;sa=recent;u={user_id}

Recent topics would be a bit more work, but shouldn't be too hard to add either. I'll look into that when I have more time.
Michael Eshom
Christian Metal Fans

Shivae

I installed SMF a couple of months ago and have been trying to use the RSS feed without any results... other than the usual: Your feed has no information error.  Feed2JS HATES it.  Is there a better program for feeding rss for use in a webpage?  Or is there just something wrong with bluehost?  My feed is located at: hxxp:shivae.org/shivae/index.php?action=.xml;sa=news [nonactive] and it looks fine to me...

layer

i can't find the option to activate the rss.. anyone can help me? :(

RebelRose

Quote from: layer on August 08, 2006, 08:24:43 PM
i can't find the option to activate the rss.. anyone can help me? :(

Admin panel, new and newsletters, settings. you should see the Enable XML/RSS news (?): click to enable.

gtron

since we have guest accounts disabled the feed always asks for ID & Password in Thunderbird. Is there away to display the thread by adding the id and pass to the rss url or something?? i was thinking it would look something like this.... /index.php?action=.xml;user=userid

Charles LePage

I'm having a problem getting RSS, SMF and Feedburner to cooperate in one aspect.

If someone on my board puts quotes in the title of their message, the code looks like this:

<title><![CDATA[Re: Slayer - &quot;Christ Illusion&quot; ]]></title>

If I change Querystring.php to stop " from becoming &quot; My board won't even appear.

If I change news.php to get rid of the CDATA for "title," the RSS feed won't work, because it chokes on &quot;

Any ideas?

mygurlstuff

Nermeen ~ I'm having the same problem. Did you ever get this resolved?

Quote from: nermeen_elhelw on July 20, 2006, 10:37:57 AM
please help me coz i dont understand how to do it

i enabled the xml/rss
i'm uding smf 1.1 rc2

now i want to make a rss news show on a board, can i???

Charles LePage

It appears removing the CDATA tags are not an option.

Here's another example of what I'm seeing:

   
Quote<item>
      <title><![CDATA[Re: Mike &amp; Bruce's setlists appeal to broad range of fans...casual to hardcore]]></title>

If I remove the CDATA tags for the title, Feedburner gives me the following error:

QuoteThe URL you entered does not appear to be a valid feed. We encountered the following problem: Error on line 8: The content of elements must consist of well-formed character data or markup.

The question would be, then:  how do I stop SMF from turning "&" into "&amp;"?

Charles LePage

I found the answer!

I had to remove the following two lines in "post.php".

Quote// Add special html entities to the subject, message, name, and email.
    // $_POST['subject'] = htmlspecialchars($_POST['subject']);


Quote// Cheat and fix entities in the subject line.
    // $_POST['subject'] = preg_replace('~&amp;#(\d{4,5}|[3-9]\d{2,4}|2[6-9]\d);~', '&#$1;', $_POST['subject']);

mygurlstuff

Eeyore -

Are you referring to an RSS feed that looks like this?

<script language=javascript src="http://www.rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fnews.google.com%2Fnwshp%3Fhl%3Den%26tab%3Dwn%26q%3D%26output%3Drss&newpage=1&chead=1&atl=1&desc=1&owncss=&eleminate=&auth=1&dts=1&width=400&max=1&tlen=0&rnd=1&bt=3&bs=Double&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&lstyle=-1&lc=Blue&bg=White&bc=Gray&spc=&ims=1&tc=&ts=11&tfont=Verdana,+Arial,+Sans-serif"></script>

I've been trying to get this to work in my forum also. I have XML/RSS enabled and I'm on v1.1 rc2. I'm not sure if it is my template, DilberMC, that is causing the RSS feed not to show up.

Cheryl
www.MyGurlStuff.com/smf/index.php

Quote from: eeyore on March 22, 2005, 01:08:51 PM
I`m just getting a bit confused with all this..... (lol)

Can you disply RSS feeds within a forum?

eg:
if i set up a news forum could you make it that the feed would apper under a new post ?

or do i have to set it up within the news box?

Some one mentioned using a site to convert it to java scrip.... where would i post the script?

cheers

Lew Cipher

Quote from: eeyore on March 22, 2005, 01:08:51 PM
I`m just getting a bit confused with all this..... (lol)

Can you disply RSS feeds within a forum?

eg:
if i set up a news forum could you make it that the feed would apper under a new post ?

or do i have to set it up within the news box?

Some one mentioned using a site to convert it to java scrip.... where would i post the script?

cheers

This is my question also. Is the RSS/XML feed only for the info in the News box or can it be set to show forum posts?

Version: SMF 1.1.2
Many mods installed

Ajay

Quote from: Lew Cipher on September 01, 2006, 02:28:16 AM
This is my question also. Is the RSS/XML feed only for the info in the News box or can it be set to show forum posts?

I use it for forum posts.
Ajay D'Souza [nofollow]

Lew Cipher

Quote from: Ajay on September 02, 2006, 11:00:56 PM
Quote from: Lew Cipher on September 01, 2006, 02:28:16 AM
This is my question also. Is the RSS/XML feed only for the info in the News box or can it be set to show forum posts?

I use it for forum posts.

Out of the box, so to speak, or by using a mod?
Version: SMF 1.1.2
Many mods installed

Ajay

Quote from: Lew Cipher on September 06, 2006, 01:38:15 AM
Out of the box, so to speak, or by using a mod?

Out of the box.

It should be part of your theme and DHTML news should be enabled. This thread has great information about using RSS on the forum.
Ajay D'Souza [nofollow]

alexsbrown

My users have reported some uneven behavior with the RSS in SMF (on v1.1RC2). Some RSS software likes it fine, while others say it is invalid. As part of my research into their concerns, I see signs that perhaps the MIME type of the RSS is not being set for all feed formats. If I go to
http://www.simplemachines.org/community/index.php?action=.xml
A browser recognizes it as an XML MIME type, and opens it as a tree. If I go to
http://www.simplemachines.org/community/index.php?action=.xml;type=rss2
I get an offer to open or save this unknown file type for file "index.php".

I am just getting started with reading code in SMF, but is it possible that the MIME type is being set just for the default SMF XML format, but not for RSS, RSS2, Atom, and other formats? That could explain the problems some of my users are seeing. Technically an RSS feed is not valid if it is not served as an XML file type, even if the file is a correct and complete XML document in RSS format.

Sorry if this is a wild goose chase, but I am hoping it might explain some of the erratic behavior that others have seen using RSS on SMF.

alexsbrown

OK, I found a little more information. The behavior I was seeing is due to a well-known problem in many web browsers. SMF is using correct content-type headers application/rss+xml, application/atom+xml, and application/rdf+xml for its different feed types. It is very common practice across the web to use text/xml as a content type for RSS feeds of all varieties, though.

You can find more about the chaos in this informative article:
http://www.petefreitag.com/item/381.cfm [nofollow]

I am wondering if using text/xml (even though some may argue it is not correct) might help my users get to the feeds. Because the file name is "index.php" the system cannot tell anything from the file name, so the content type is very important.

Has anyone tried overriding the content type choices in News.php? Any idea on whether this is part of the problem people are seeing? Thoughts?

Advertisement: