User:Asked42/LeadManager
The Lead Manager script is designed to update lead templates and create new ones. It offers various methods for updating leads, including sequential shuffling of all lead templates instead of updating them one by one. Users can also perform a "Single Update
" on a specific template or define a custom pattern to control the shuffling process.
The script allows users to retrieve data from the most recent published article by entering keywords like "ML1
" in the title field. To extract data from an existing lead template, keywords such as "Lead1
", "Lead2
", etc., can be used to auto-fill the form fields with parameters from the corresponding lead template.
Inspired by the Make Lead script and Bawolff's lead generator script, this tool was initially developed for Bengali Wikinews and later adapted for English Wikinews, with added features to suit specific needs.
Installation
editTo install the script, copy the following code and paste it into your common.js page in your user space.
mw.loader.load('//en.wikinews.org/w/index.php?title=User:Asked42/LeadManager.js&action=raw&ctype=text/javascript');
Once the script is installed, return to this page. You will now find a form under the Lead Manger Form section below.
Usage
editInstructions
edit- To begin, enter the title, select the number of sentences for the summary, and click the "
Fetch Automatically
" button. The data, such as the image and summary from the article, will be added to their respective fields.
- Alternatively, you can use shortcut keywords in the title field to fetch data from recently published articles. For example, "
ML1
" retrieves data from the latest published article, "ML2
" from the second latest, "ML3
" from the third, and so on, up to the fifth.
- In the Additional Options section, you can configure settings like the "Image Size" field. By default, it shows "
150x150px (100x100px)
". Here,150x150px
is for the selected lead template, and100x100px
is for other lead templates when shuffling or shifting them. This format is useful for using150x150px
on Lead Template 1 and100x100px
for other leads. If you want a single size for all templates, remove the value in parentheses.
- The Lead Article Template dropdown lets you choose which template to update with new lead data. By default, the sequential update starts with the selected template and continues through the others in order. However, if you select "Single Update," only the chosen template will be updated.
- The Explicit Update option allows you to create a custom shuffle pattern. For example, "
1->3
" moves content from Lead 1 to Lead 3 and adds new content to Lead 1. You can also set multiple moves, such as "1->3, 3->2, 2->5
" which moves content from Lead 1 to Lead 3, Lead 3 to Lead 2, and Lead 2 to Lead 5, while Lead 4 remains unchanged.
- Important: The first number in the pattern must match the template where new content will go. For example, if you select lead template 1, a pattern like "
2->1, 1->3
" won’t work. Also, no template should be left empty. For instance, "1->3, 4->5
" is invalid because lead4 would end up empty.
- Important: The first number in the pattern must match the template where new content will go. For example, if you select lead template 1, a pattern like "
- Once you’ve provided all the necessary details and chosen your preferred edit method, click the "
Start Update!
" button. Confirm the changes, and the tool will update the templates automatically. Relax and let the script handle the updates.
Lead Manger Form
edit
Other Scripts
edit- QuickCat: This script is designed to make the creation of date and month categories, as well as date and month list pages, quick and easy.