mirror of
https://github.com/moparisthebest/wallabag_scripts
synced 2024-12-03 22:22:23 -05:00
Initial commit
This commit is contained in:
commit
7774487951
3
bookmarksJsonParse
Executable file
3
bookmarksJsonParse
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# this spits out URLs from a firefox bookmark json export, rather ugly...
|
||||||
|
python -m json.tool < "$1" | grep '^ *"uri": *"' | sed -e 's/^ *"uri": *"//' -e 's/"$//'
|
31
wallabag
Executable file
31
wallabag
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# put your login credentials in ~/.netrc
|
||||||
|
# put your url here, or export wallabag_url in your .bashrc or something
|
||||||
|
#wallabag_url="https://example.org/wallabag/"
|
||||||
|
|
||||||
|
tags=''
|
||||||
|
if [ "$1" = '--tags' ] || [ "$1" = '-t' ]
|
||||||
|
then
|
||||||
|
shift
|
||||||
|
tags="&tags=$1"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
cookies="$(mktemp)"
|
||||||
|
trap 'rm -f "$cookies"' EXIT
|
||||||
|
|
||||||
|
# login
|
||||||
|
curl --netrc --cookie-jar "$cookies" "$wallabag_url" &>/dev/null || exit $?
|
||||||
|
|
||||||
|
while [[ $# > 0 ]]
|
||||||
|
do
|
||||||
|
url="$1"
|
||||||
|
b64="$(echo -n "$url" | base64 --wrap=0)"
|
||||||
|
full_url="$wallabag_url?action=add$tags&url=$b64"
|
||||||
|
#echo "url: $url b64: $b64 full_url: $full_url"
|
||||||
|
|
||||||
|
curl --netrc --cookie "$cookies" "$full_url" &>/dev/null || exit $?
|
||||||
|
|
||||||
|
shift
|
||||||
|
done
|
3
wallabagBookmarks
Executable file
3
wallabagBookmarks
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# this imports all URLs from a firefox bookmark json export, to wallabag with tag 'bookmarks'
|
||||||
|
bookmarksJsonParse "$1" | xargs wallabag -t bookmarks
|
Loading…
Reference in New Issue
Block a user