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

cbsarge

I'm trying to display the latest forum feeds in a div on another site. The div will be added to that site as part of a Chrome extension that also adds a toolbar. I'm going to use the extension to append the html to an existing element of the page and use the iframe to fill it with the RSS content.

Arantor

Yeah, there's still multiple better ways of doing it than that, such as using SSI.php to do it (and that doesn't even need hacking anything about), you can call SSI.php?ssi_function= and one of the names of the functions in that file, which is ready formatted for HTML.

SMF in iframes is still not clever though at least the normal security protocol won't get in your way there.

devnullius

Quote from: [Unknown] on May 04, 2005, 07:40:12 PM
Quote from: Zenigata on April 06, 2005, 11:45:19 AM
sigh/index.php?action=.xml;limit=20;type=rss2

The action above displays the 20 most recent posts. Is there a way to display the 20 most recent topics?

Use ;sa=news.  This will be the first post in each topic, not the last.

Ok, I'm trying to get an RSS feed without any replies / bumps... I just need a single RSS entry for each new topic once it is posted. NOthing more than this first post, even when it's bumped / replied to.

Would it be possible?

I tried this index.php?type=rss;action=.xml;sa=news;board=159.0;limit=25 which hardly gives any results and does not seem to be a relevant RSS feed.

index.php?type=rss;action=.xml;board=159.0;limit=25 doesn't give the results I want either... Surely, an initial-posts only RSS feed can be created, right??

ANY help / tips / pointers appreciated :)

Devvie
@devnullius

Arantor

index.php?type=rss;action=.xml;sa=news;board=159.0;limit=25 is correct.

It does however apply a limiter to avoid performance trouble on your forum.

News.php:
$request = $smcFunc['db_query']('', '
SELECT num_posts
FROM {db_prefix}boards
WHERE id_board = {int:current_board}
LIMIT 1',
array(
'current_board' => $board,
)
);
list ($total_posts) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$feed_title = ' - ' . strip_tags($board_info['name']);

$query_this_board = 'b.id_board = ' . $board;

// Try to look through just a few messages, if at all possible.
if ($total_posts > 80 && $total_posts > $modSettings['totalMessages'] / 10)
$context['optimize_msg']['lowest'] = 'm.id_msg >= ' . max(0, $modSettings['maxMsgID'] - 600 - $_GET['limit'] * 5);


That entire block should probably be removed.

devnullius

Quote from: Arantor on December 02, 2014, 12:21:46 PM
index.php?type=rss;action=.xml;sa=news;board=159.0;limit=25 is correct.

It does however apply a limiter to avoid performance trouble on your forum.

News.php:
$request = $smcFunc['db_query']('', '
SELECT num_posts
FROM {db_prefix}boards
WHERE id_board = {int:current_board}
LIMIT 1',
array(
'current_board' => $board,
)
);
list ($total_posts) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);

$feed_title = ' - ' . strip_tags($board_info['name']);

$query_this_board = 'b.id_board = ' . $board;

// Try to look through just a few messages, if at all possible.
if ($total_posts > 80 && $total_posts > $modSettings['totalMessages'] / 10)
$context['optimize_msg']['lowest'] = 'm.id_msg >= ' . max(0, $modSettings['maxMsgID'] - 600 - $_GET['limit'] * 5);


That entire block should probably be removed.

Thanks! Does this mean that if I don't own the forum, I'm out of luck? (sent PM too)

Devnullius

Arantor


devnullius

Quote from: Arantor on December 02, 2014, 12:35:17 PM
Thank you for reading my signature.

Just to give you the full link; sent PM and reply at about the same time ;p

devnullius

Quote from: devnullius on December 02, 2014, 12:31:04 PM
Quote from: Arantor on December 02, 2014, 12:21:46 PM
Thanks! Does this mean that if I don't own the forum, I'm out of luck? (sent PM too)

Devnullius

Still wondering :)

Devvie

PS: somebody implement easier Captcha's please :(

margarett

Please don't bump your topic in minutes...

If you have no access to the files (FTP your your host's file manager) then yes, you can't really do much as the trick pointed by Arantor implies changes in code...

Captcha goes away after 10 posts.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

scotchmonster

Thanks for pointing me to the right board Margarett.

I cant work this out to save myself so if anyone can help it is much appreciated.

I am trying to get a feed of the latest post from the last 10 topics.

Atm we are using http://thejetski.club/index.php?action=.xml;sa=new;type=rss all this gives us is the last 5 posts - sometimes all from one topic.

Any guidance is much appreciated.

Arantor

sa=news (not sa=new) will give you the first post of the last 10 topics. There actually isn't a way out of the box to get any number of posts where the posts are the last post (only) of the last x topics, because that's actually less useful than you might think in practice as it becomes quite easy to miss posts in the middle of a topic.

scotchmonster

I see, yes that seems to be working. Is there a way to make it show 10 now instead of 5?


Arantor

Like the first page of this topic says, add ;limit=10 to the URL.

smartmouse


suhaneankit

7 Steps IRCTC Registration IRCTC Registration in 7 Steps
Check PNR Status IRCTC PNR Status

savya_sathe


Low

Great thread! I was displaying ALL replies and messages and I simply added sa=news at the end now I only show the newest posts :)

Dhayzon


Illori


uamsameter

Hi,
I just got my rss feed on twitter and it seems to be tweeting every single post (all replies). I'm worried that it may become a headache for my followers in the long run.
Is there a way to show just new topics and nothing more?

Eagerly anticipating your reply.
Thanks
Wandering is free. Certainty has a price.

Advertisement: