utilities/auto-blog-link-preserver#11: Handle LinkWarden's duplicate link status code



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.1
Created: 11-Aug-24 08:13



Description

Link Warden includes an option to prevent duplicate links from being submitted, which is off by default

Link Warden prevent duplicate links screenshot

Having it on is extremely beneficial.

However, it does mean that the script currently reports submission failure - the API returns a HTTP 409 (always makes me happy to see an appropriate use of status codes!)

We should differentiate between "this failed" and "this link is already there"



Toggle State Changes

Activity


assigned to @btasker

changed the description

verified

mentioned in commit 41dcadfff1ee478ea8d045ffcfb93b9e150e477b

Commit: 41dcadfff1ee478ea8d045ffcfb93b9e150e477b 
Author: B Tasker                            
                            
Date: 2024-08-11T09:28:09.000+01:00 

Message

feat: differentiate between submission failure and reported duplicate (utilities/auto-blog-link-preserver#11)

This also adds a duplicates attribute to the stats dict

+36 -4 (40 lines changed)

This is done.

The script won't print anything when a link is duplicate (doesn't quite seem worth the log churn).

However submit_to_linkwarden() has moved from returning a boolean to an integer

      0 - submission failed
      1 - submission succeeded
      2 - LinkWarden reported it was a duplicate link