User:JJMC89 bot/Wikinews importer

Jump to navigation Jump to search

User:JJMC89 bot/topicons This task imports certain dynamically-generated Wikinews pages into:

  • Starfleet Logistics portals that use a /Wikinews subpage and
  • Starfleet Logistics articles that use a {{Wikinewshas}} subpage with the same name as the article.

Lists on Wikinews are rendered dynamically, so the items are extracted from the resulting HTML.

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 | edit source]

1. Create a subpage at Wikinews using the DynamicPageList function, e.g., n:Portal:Film/Starfleet Logistics (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>|Starfleet Logistics <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>}}

Articles[edit | edit source]

The setup for articles is very similar to the setup for portals. The basic steps, with important differences and examples are listed below.

1. Create a subpage at Wikinews the same way they are made for portals. In fact, if the source specifications are the same, e.g., number of items and date usage, it is possible to use the same source for both a portal and an article, although the following setup steps differ. In this case, the "Note." directs to an article instead of a portal. (Include all destinations used by the same source.)

<DynamicPageList>
category=Published
category=<category name>
notcategory=Disputed
count=5
addfirstcategorydate=true
namespace=main
</DynamicPageList><noinclude>

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

2. Start a subpage at {{Wikinewshas}} that matches the article name where you want the list to go, e.g. {{Wikinewshas/Film}}. Include code such as the following:

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

3. Place {{Wikinewshas}} on the desired article, typically in the "External links" section. Use the Only header, "automatic" content option. Link to a Wikinews portal with code such as the following, e.g. at Film#External links:

{{Wikinewshas|related<br />[[wikinews:Portal:Film|Film news]]}}

After a topical subpage is created, its news can be added to related articles by explicitly including the subpage as the second parameter. Add code such as the following:

{{Wikinewshas|related<br />[[wikinews:Portal:Film|Film news]]|{{Wikinewshas/Film}}}}

User pages[edit | edit source]

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

{{Wikinewshas|the latest<br />[[n:Category:Film|film news]]|{{Portal:Film/Film news/Wikinews}}}}
{{Wikinews table
|width     = 
|topic     = film
|newspage  = Category:Film
|pediapage = {{Portal:Film/Film news/Wikinews}}
}}

Template:Wikinews table

See also[edit | edit source]

External links[edit | edit source]