create script to scrape list of lists and scrape aech into a yaml
This commit is contained in:
21
cmd/xfer/all_from_todo_server_to_pttodo.sh
Normal file
21
cmd/xfer/all_from_todo_server_to_pttodo.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$BASH_SOURCE")"
|
||||
source ./from_todo_server_to_pttodo.sh
|
||||
type from_todo_server_to_pttodo_main
|
||||
list_lists | jq .list[] | jq -c . | while read -r line; do
|
||||
local name="$(echo "$line" | jq -r .name | sed 's/^Today$/todo/g' | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')"
|
||||
local id="$(echo "$line" | jq -r .id)"
|
||||
echo $name, $id
|
||||
TODO_SERVER_LIST="$id" from_todo_server_to_pttodo_main > ./$name.yaml
|
||||
done
|
||||
}
|
||||
|
||||
list_lists() {
|
||||
todo_server_curl "$TODO_SERVER_URL/ajax.php?loadLists=&rnd=0.9900282499544026"
|
||||
}
|
||||
|
||||
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||
main "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user