#!/usr/bin/env bash
set -eu
go build -o tmp/intake
rm "$1" || true
export INTAKE_DB="$1"
tmp/intake migrate
tmp/intake source add -s feedtest
tmp/intake item add -s feedtest --id "this-item-has-no-title"
tmp/intake item add -s feedtest --title "This item has only a title"
tmp/intake item add -s feedtest --title "Title and body" --body "This is the item body"
tmp/intake item add -s feedtest --title "Title and link" --link "#"
tmp/intake item add -s feedtest --title "Title, link, body" --link "#" --body "This is the body"
tmp/intake item add -s feedtest --title "HTML title" --link "#" --body "HTML body"
tmp/intake item add -s feedtest --title "Title and author" --author "Authorname"
tmp/intake item add -s feedtest --title "Title, author, time" --author "Authorname" --time 1700000000
tmp/intake item add -s feedtest --title "Title, time" --time 1737780324
tmp/intake item add -s feedtest --title "Title, author, body" --author "Authorname" --body "Hello body!"
tmp/intake item add -s feedtest --title "Title, author, time, body" --author "Authorname" --time 1700000000 --body "Hello body!"
tmp/intake item add -s feedtest --title "Title, time, body" --time 1737780324 --body "Hello, body!"