So, as a quick example, when I use the browser UI (which just talks to the APIs) to add a link into a collection called "Sitelinks", it posts the following to /api/v1/links
That responded immediately with a 200 and the following response body
{"response":{"id":7,"name":"Implementing Secure Password Storage with PHPCredlocker and a Raspberry Pi | www.bentasker.co.uk","type":"url","description":"","collectionId":2,"url":"https://www.bentasker.co.uk/posts/documentation/linux/286-implementing-secure-password-storage-with-phpcredlocker-and-a-raspberry-pi.html","textContent":null,"preview":null,"image":null,"pdf":null,"readable":null,"monolith":null,"lastPreserved":null,"importDate":null,"createdAt":"2024-08-10T22:34:32.275Z","updatedAt":"2024-08-10T22:34:32.275Z","tags":[{"id":1,"name":"PHP","ownerId":1,"createdAt":"2024-08-10T22:27:39.758Z","updatedAt":"2024-08-10T22:27:39.758Z"},{"id":3,"name":"SiteLinks","ownerId":1,"createdAt":"2024-08-10T22:34:32.275Z","updatedAt":"2024-08-10T22:34:32.275Z"}],"collection":{"id":2,"name":"Site Links","description":"","color":"[#0](/issue/utilities/auto-blog-link-preserver/0.html)ea5e9","parentId":null,"isPublic":false,"ownerId":1,"createdAt":"2024-08-10T19:16:20.045Z","updatedAt":"2024-08-10T19:16:20.045Z"}}}
So, we just need to update the script to do that in python
Activity
10-Aug-24 19:08
assigned to @btasker
10-Aug-24 19:18
So, as a quick example, when I use the browser UI (which just talks to the APIs) to add a link into a collection called "Sitelinks", it posts the following to
/api/v1/links
So, we probably just need to do similar (tomorrow, I want to look at whether we can auto-matically include tags too, that'd be really useful)
10-Aug-24 22:35
Decided not to wait til the morning.
Taking a quick look, submitting with tags looks like this
So, lets grab a token and see if we can submit something with
curl
That responded immediately with a 200 and the following response body
So, we just need to update the script to do that in python
10-Aug-24 22:37
mentioned in commit 868eea5f0c3c9ddd63fd730a10b1fda3d7586087
Message
chore: strip out the old ArchiveBox functions (utilities/auto-blog-link-preserver#8)
10-Aug-24 22:46
mentioned in commit cde543d9ee03d22c0bca67c8bd6900d7f2e3c6e8
Message
feat: implement submission of links into LinkWarden (utilities/auto-blog-link-preserver#8)
10-Aug-24 22:49
OK, submission is working - the script has just happily worked through my RSS feed extracting links from each of the posts and submitting them
There wasn't a single failure in submission.
However, this ticket is not complete yet. The collection ID is currently hardcoded, we need to change that.
The options are
10-Aug-24 22:52
Looks like we can do a
GET
to/api/v1/collections
10-Aug-24 23:04
mentioned in commit 5aba0a3e00f136945ef278372ff817f5ac530834
Message
feat: allow submissions to be placed into a named collection (utilities/auto-blog-link-preserver#8)
10-Aug-24 23:07
The script will now look up the collection name is one is defined. It can be defined with
LINKWARDEN_COLLECTION_NAME
.So, to have links go into a collection called
Site Links
and tagged withSiteLinks
andanti-link-rot
you'd have