View Single Post
Old 05-18-2023, 07:59 PM   #3
jrw174
Connoisseur
jrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the roughjrw174 is a jewel in the rough
 
Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
Shell script is easiest way to go

Some psedo code(not tested just how I would approach it)

#!/bin/sh
#Get connection to DB and select the count of book IDs
declare -a numOfBooks=$(sqlite3 /system/explorer-3/exlplorer-3.db "SELECT ID FROM BOOKS_IMPL")

#Use random to get an ID
size=${#numOfBooks[@]}
randomBookID=$(($RANDOM % $size))

#Somehow, invoke reader program to open the ID
jrw174 is offline   Reply With Quote