Link to the current tool on Labs
Link to the code on Github
Workflow of the tool
- User goes to the tool and clicks on a page to add links to (source)
- If not logged in the user is required to login/register at this stage
- User adds the gadget in user preferences
- User is redirected to VE with the gadget enabled
Description of gadget requirements
- The gadget pulls in the links to be added to the given page using the API call http://tools.wmflabs.org/navlink-recommendation/<article_name>/. We refer to links as targets from now on.
- We are only concerned with the targets and for each target, use the title as the anchor text where we would be inserting the link. The targets are listed in decreasing order of importance.
- The next step is to look for possible places of insertion for each target. We need to do this in the gadget because the page keeps changing and we cannot precompute where where we can place the link in the page. This is a simple string match. For each link, we can have multiple places of insertion.
- The user cycles through all possible places of insertion for a target from top to bottom. He/she can either insert, get next position, skip link or downvote the recommendation.
- Insert - inserts the link at the current position and takes user to the next target. It also makes an API call which records the insertion and the link does not appear further for other users.
- Next position - Stands for skipping the current position in the text. Takes user to the next position for that target in the text. After all positions are skipped we go to the next target
- Skip link - Skips the current target and takes to the next one (not all users may posses understanding of a target page)
- Downvote - Stands for rejecting the recommendation. An API call notes the downvote and after a few downvotes, the recommendation is removed
*(Note - the API calls are not part of the gadget)