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.


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.)

category=<category name>
notcategory=No publish

'''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]].

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

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

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.
{{User:Wikinews Importer Bot/config|page=Portal:<source page name>}}

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

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

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"> 
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