Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for shaarli dead links #1816

Open
lmjst opened this issue Dec 12, 2021 · 1 comment
Open

check for shaarli dead links #1816

lmjst opened this issue Dec 12, 2021 · 1 comment
Labels
feature plugin bells and whistles

Comments

@lmjst
Copy link

lmjst commented Dec 12, 2021

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 nodiscc added feature plugin bells and whistles labels Dec 17, 2021
@nodiscc nodiscc added this to the backlog to the future milestone Dec 17, 2021
@nodiscc nodiscc self-assigned this Mar 19, 2023
@nodiscc
Copy link
Member

nodiscc commented Aug 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature plugin bells and whistles
Projects
None yet
Development

No branches or pull requests

2 participants