User:JJMC89 bot/Wikinews importer

This task imports certain dynamically-generated Wikinews pages into pages that use a /Wikinews subpage. Lists on Wikinews are rendered dynamically, so the items are extracted from the resulting HTML.

Example: Portal:Film/Film news/Wikinews gets fed with n:Portal:Film/Wikipedia.

These imports are accomplished by implementing the setup steps described below. The bot checks for updates on an hourly basis and only updates if there has been a change.

PortalsEdit

1. Create a subpage at Wikinews using the DynamicPageList function, e.g., n:Portal:Film/Wikipedia (if there is a category instead of a portal, do not make a category subpage, instead, make a subpage of n:Wikinews:Wikinews Importer Bot). Insert code similar to the following. (See n:Wikinews:DynamicPageList for more info on DynamicPageList syntax.)

<DynamicPageList>
category=Published
category=<category name>
notcategory=No publish
notcategory=Disputed
stablepages=only
count=5
namespace=0
addfirstcategorydate=true
</DynamicPageList><noinclude>

'''Note.''' This page is used by the [[w:User:Wikinews Importer Bot|Wikinews Importer Bot]] to update the [[w:Portal:<destination page>|Wikipedia <destination> Portal news]].
</noinclude>

2. Create a sub-subpage at a portal news section, e.g., Portal:Film/Film news/Wikinews, and insert the following code.

<noinclude>
{{User:Wikinews Importer Bot/config|page=Portal:<source page name>}}
</noinclude>

Remember, the bot checks for updates on an hourly basis and only updates if there has been a change. You can wait for the first update or manually copy over the original links from the source page. Insert code similar to the following for an initial manual copy of Wikinews items.

* [[wikinews:<first news item>|<first news item>]]
* [[wikinews:<second news item>|<second news item>]]
* etc.
<noinclude>
{{User:Wikinews Importer Bot/config|page=Portal:<source page name>}}
</noinclude>

Optional parameter: A custom indentation string can be passed using the |indent= parameter (which defaults to |indent=* if not specified). See example below.

<noinclude>
{{User:Wikinews Importer Bot/config|indent=**|page=Portal:<source page name>}}
</noinclude>

3. Transclude the above page to the news section page, e.g., Portal:Film/Film news. Insert code similar to the following.

'''[[:wikinews:Portal:<source>|Wikinews <source> portal]]'''<div style="float:right;margin-left:0.9em"> 
<imagemap> 
File:Wikinews-logo.svg|75x45px 
default [[n:Main Page|Read and edit Wikinews]] 
desc none</imagemap></div>
{{Portal:<destination page in step 2>}}

User pagesEdit

{{Wikinews table}} can be added to user pages for selected Wikinews topics. For example, the following parameters will display film Wikinews as shown.

{{Wikinews table
|width     = 
|topic     = film
|newspage  = Category:Film
|pediapage = {{Portal:Film/Film news/Wikinews}}
}}
Latest film news from Wikinews

Visit Category:Film to read and write news articles in more detail.

See alsoEdit