FANDOM


Спецыяльны тэг RSS дазваляе дадаваць на Вашу вікі RSS-стужкі з любога сайта або вікі. Яго можна выкарыстоўваць для аператыўнага адлюстравання навін па тэматыцы Вашай вікі з знешняга рэсурсу, а таксама для адлюстравання інфармацыі з большасці спецстраніц Вашай вікі.

Выкарыстанне Edit

Знайдзіце RSS-стужку, якую Вы хочаце дадаць на старонку Вашай вікі. Як правіла, для гэтага трэба націснуць кнопку RSS у браўзэры або непасрэдна на старонцы вэб-сайта. Скапіюйце атрыманы URL і ўстаўце яго ўнутр тэга:

<rss>URL RSS-стужкі</rss>
Налада
short Паказвае толькі загаловак навіны, без зместу.
date Дадае дату/час для кожнай навіны
max=x Паказвае колькасць навін, якія будуць адлюстроўвацца.
highlight=term1 term2 Тэмы, дададзеныя ў гэтую радок (праз прабел), будуць вылучаныя.
filter=term1 term2 Задае спіс тым, якія будуць транслявацца з агульнай RSS-стужкі
filterout=term1 term2 Адключае трансляцыю выбраных тым з RSS-стужкі.
reverse Паказвае RSS-стужку ў зваротным парадку (самыя свежыя навіны унізе).
charset= Задае кадыроўку RSS-стужкі, напрыклад, у выпадку, калі Вам патрэбна UTF-8 кадзіроўка для адлюстравання некаторых спецыяльных знакаў у стужцы.

Прыклад Edit

Прыклад узяты з Загалоўнай старонкі w:c:ru.dragonica/Драконіка Вікі.

Код:

<div class="toc" style="width:80%; margin:auto;">
'''Навіны ru-Драконіка'''
 
<rss>http://www.zzima.com/forum/external.php?type=RSS2&forumids=459/short/date/max=4</rss>
</div>

Тое, што адлюстроўваецца на экране:

Навіны ru-Драконіка

Loading RSS data...

RSS-стужкі з Вашай вікі Edit

У такім жа фармаце, як апісана вышэй, Вы можаце дадаць RSS-стужкі з наступных старонак сваей або іншай вікі: з любой старонкі гісторыі, з большасці спецстраніц, у тым ліку Special:RecentChanges, Special:NewPages і Special:WantedPages.

This extension is enabled by default on Fandom.

The RSS extension allows you to embed RSS feeds from any site onto a page. This could be used to display news feeds with timely information on your subject, to show entries from a related blog, or to show recent changes from another wiki.

How do I add the RSS feed to a wiki page?

Locate the URL for a feed you would like to include, usually by clicking an "RSS" button or link on the page providing the feed. Copy the URL from the address bar.

The basic code to add an RSS feed to a page is:

<rss>URL goes here</rss>

How can I customize the feed?

There are a number of parameters you can add after the URL for the RSS feed to customize the display output. Each is separated by a pipe ("|"), like this:

<rss>https://wherever.com|short|date|max=4</rss>

Though no parameters are usually required, you can mix and match from the following list as you wish. That said, some feeds do need the charset=UTF-8 parameter. Try adding it if your feed displays oddly — or not at all.

Parameter Result
short Shows only the headline for each news item, not the description text.
date Shows the date/time stamp for each news item
max=x Allows you to choose the maximum number of items to show.
highlight=term1 term2 The terms added here (separated by a space) are highlighted.
filter=term1 term2 Only RSS items containing at least one of the listed terms are shown.
filterout=term1 term2 No RSS items containing the listed terms are shown.
reverse The RSS items are displayed in reverse order
charset= The charset used by the feed. For example, you may need to use UTF-8 to view some characters.

Example

To add some World Cup headlines directly from FIFA, you might use:

<rss>https://www.fifa.com/worldcup/news/rss.xml|output=rss|charset=UTF-8|short|date|max=3</rss>

After adding in a title and some styling, you'd get:

Keep up with the Cup:

Loading RSS data...

Google feeds

Bad RSS

A broken Google feed.

Clearly, one of the biggest news aggregators on the web is Google. Many wikis use Google feeds of one kind or another. Unfortunately, Google has made several changes to their news services over the years, and some wikis may be displaying broken feeds as a result.

If your wiki's Google feed begins with "This RSS feed URL is deprecated" — or if you see <wikia-rss-error-wrong-status-301> — you'll need to make a change.

The easiest thing to do is to copy and paste the following to your wiki, and change MyTopicHere — both times — to whatever you need it to be:

<rss> https://news.google.com/rss/search?pz=1&cf=all&q=MyTopicHere&cf=all&scoring=n&hl=en-US&gl=US&ceid=US:en|charset=UTF-8|short|date|max=3</rss>

For instance, let's say I wanted to get a newsfeed about Star Wars at Disneyland. I'd use this:

<rss>https://news.google.com/rss/search?pz=1&cf=all&q=DisneylandStarWars&cf=all&scoring=n&hl=en-US&gl=US&ceid=US:en|charset=UTF-8|short|date|max=3</rss>

After a little styling, the result would be:

The latest from Galaxy's Edge:

Loading RSS data...

Google feeds in other languages

This same base code is adaptable to other languages, using Google's language codes. Often, but not always, those language codes are the same as Fandom's language codes.

For instance, we'd make the feed French by altering the last bit of the URL to include references to FR (the country) and fr (the language) — like this &hl=fr&gl=FR&ceid=FR:fr.

French feed for the keywords "DisneylandStarWars"

Loading RSS data...

But there are some important caveats to working with other languages.

  • Language determines context. Choosing French in our example emphasizes Disneyland Paris over the original Disneyland in California.
  • Topics aren't universal. Feed topics don't produce results in all languages. You may have to massage the RSS statement a bit to get a feed in the language of your choice. If one set of keywords isn't producing results, think of other, similar words and try them. But remember: your feed topic simply might not be popular in a given language. You may never be able to get an iCarly feed in Sudanese!
  • Mixed language content possible. Feeds might produce results that are a mix of different languages, particularly if your topic is in a language different than the ?hl= variable.
  • Different users may see different things. What you see on a Google newsfeed can be shaped by your browser, the country you're in, and the language settings on your own Google account. So it's possible that two people looking at the same Google newsfeed will see different results.

Making sure the feed meets your needs

News feeds are passive. That is, you have to accept whatever results arrive. If your topic is clear and distinct, this is usually unproblematic But if your topic is comprised of very common nouns, you might get some results that have nothing to do with your topic.

Make sure you monitor the results for a while to see that every single line item is actually relevant.

Consider adding identifiers — like the production company, exact title, or key creative person — to the search term in order to ensure better results. For instance, "Good Omens Amazon" will return more results relevant to the Amazon version of Good Omens than just "Good Omens" alone. You may have to play around a bit to find the optimal term.

You also want to make sure you look at the dates on the news stories. If you're not pulling recent news stories, your search term probably needs a tweak. A feed that's not able to produce recent hits shouldn't be used. It helps no one to know what 2008's big news stories were about your topic.

Can I embed feeds from my own wiki?

Yes, MediaWiki provides feeds in both RSS and Atom formats for all history pages and many special pages, including Special:RecentChanges, Special:NewPages, and Special:WantedPages.

You can use the RSS URL, in combination with this extension, to display portions of these lists on other pages on your community. See Help:Feeds for more information.

Further help and feedback

Community content is available under CC-BY-SA unless otherwise noted.