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

[Feature Request] API: query/extract data by date #899

Open
posta246 opened this issue Oct 29, 2024 · 1 comment
Open

[Feature Request] API: query/extract data by date #899

posta246 opened this issue Oct 29, 2024 · 1 comment

Comments

@posta246
Copy link

Hi,
I'm playing a little with the API but I miss the feature to extract only the bookmark add/modified in a specific date time. This is very useful if you have to syncronize with other tools (that, usually, is one of the APIs purpose) and need to know what data you have exchanged. With "date" parameter, I can extract only the bookmarks of the day - the new ones or the daily ones modified - and manage them.
Thanks for reading!

@posta246
Copy link
Author

posta246 commented Nov 8, 2024

ok, if someone need to daily extract linkding bookmarks and add them to linkwarden (that makes pdf...) I wrote this script to be adapted:

LINKWARDEN_TOKEN="the_token"
BOOKMARKS=$(curl -s -H "Authorization: Token LINKDING_TOKEN" https://LINKDING_IP:PORT/api/bookmarks/?limit=100 | jq --arg date $(date +%Y-%m-%d) '.results | .[] | select(.date_added>=$date) | .url' | sed 's/"//g')

for BOOKMARK in $BOOKMARKS;
do
  echo -e Adding "$BOOKMARK" ...
  curl -s -X POST \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer $LINKWARDEN_TOKEN" \
       -d '{"url":"'$BOOKMARK'","description":"","type":"url","tags":[],"preview":"","image":"","pdf":"","readable":"","textContent":"","collection":{"id":1}}' \
       https://LINKWARDEN_IP:PORT/api/v1/links
done

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

No branches or pull requests

1 participant