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:User:Wikinews Importer Bot/Film.
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.
Portals
[edit]1. Create a subpage at Wikinews using the DynamicPageList function, e.g., n:User:Wikinews Importer Bot/Film. 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 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=User:Wikinews Importer Bot/<subpage>}} </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=User:Wikinews Importer Bot/<subpage>}} </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=User:Wikinews Importer Bot/<subpage>}} </noinclude>
3. Transclude the above page to the news section page, e.g., Portal:Film/Film news. Insert code similar to the following.
'''[[:n:User:Wikinews Importer Bot/<subpage>|Wikinews]]'''<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 pages
[edit]{{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. |