explicit
parent
165f85a443
commit
9b05003329
|
|
@ -24,7 +24,7 @@ config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
echo "$(date +%H:%M:%S)> $*" >&2
|
echo "$(echo "$(date +%H:%M:%S)> $*" | tr '\n' ' ')" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
ids() {
|
ids() {
|
||||||
|
|
@ -45,7 +45,7 @@ _crawl() {
|
||||||
local json="$(notea get "$id")"
|
local json="$(notea get "$id")"
|
||||||
local content="$(echo "$json" | jq -r .content)"
|
local content="$(echo "$json" | jq -r .content)"
|
||||||
if ! is_crawlable "$content"; then
|
if ! is_crawlable "$content"; then
|
||||||
log "$content is not crawlable"
|
log "not crawlable: '${content:0:20}'..."
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
local crawlable_source="$(extract_crawlable_source "$content")"
|
local crawlable_source="$(extract_crawlable_source "$content")"
|
||||||
|
|
@ -80,9 +80,6 @@ crawl_with() {
|
||||||
log " $PID/$ID ($TITLE): ${#CONTENT}"
|
log " $PID/$ID ($TITLE): ${#CONTENT}"
|
||||||
notea put
|
notea put
|
||||||
done
|
done
|
||||||
|
|
||||||
log not impl crawl with
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is_crawlable() {
|
is_crawlable() {
|
||||||
|
|
@ -93,7 +90,7 @@ is_crawlable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite() {
|
rewrite() {
|
||||||
log not impl rewrite
|
log not impl rewrite, change images
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ notea() (
|
||||||
"pid": '"$(echo "$PID" | jq -R)"',
|
"pid": '"$(echo "$PID" | jq -R)"',
|
||||||
"pinned": 0,
|
"pinned": 0,
|
||||||
"shared": 0,
|
"shared": 0,
|
||||||
"title": '"$(echo "$TITLE" | jq -R)"'
|
"title": '"$(echo "$TITLE [generated]" | jq -R)"'
|
||||||
}' | jq -c .)"
|
}' | jq -c .)"
|
||||||
echo "$request" | ncurl \
|
echo "$request" | ncurl \
|
||||||
-X POST \
|
-X POST \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue