shaarli / Shaarli

The personal, minimalist, super-fast, database free, bookmarking service - community repo
https://shaarli.readthedocs.io/
Other
3.43k stars 293 forks source link

check for shaarli dead links #1816

Open lmjst opened 2 years ago

lmjst commented 2 years ago

Hi, I'm looking for a dead link checker (within my shaarli install). I found https://framagit.org/qwertygc/shaarli-dev-code/-/blob/master/self-dead-link.php but can't see how to use it ?? I've copied the file in my shaarli directory but the result is :

(0) S
(0) 
(0) 
(0) 
(0) 
(0) 
0.095519 secondsDone

Thanks

nodiscc commented 1 year ago

https://github.com/nodiscc/hecat/ is able to check for dead links in shaarli data. Check the examples section for Shaarli - here is a basic example that just checks for dead links:

python3 -m venv .venv && source .venv/bin/activate && pip3 install shaarli-client git+https://gitlab.com/nodiscc/hecat.git
mkdir -p ~/.config/shaarli/ && nano ~/.config/shaarli/client.ini
# ~/.config/shaarli/client.ini
[shaarli]
url = https://shaarli.example.org
secret = YOUR_API_SECRET
source .venv/bin/activate && shaarli --outfile shaarli-export.json get-links --limit=all
nano .hecat.yml
# .hecat.yml
steps:
  - name: import data from shaarli API JSON
      module: importers/shaarli_api
      module_options:
        source_file: shaarli-export.json
        output_file: shaarli.yml

  - name: check URLs
    module: processors/url_check
    module_options:
      source_files:
        - shaarli.yml
      exclude_regex:
        - '^https://www.youtube.com/watch.*$' # don't check youtube video URLs, always returns HTTP 200 even for unavailable videos
source .venv/bin/activate && hecat -c .hecat.yml