# Note that the name might be misleading since currently only Firefox SQLite format is supported
AWEEKAGO=date +%s --date "now 1 week ago"
ANHOURAGO=`date +%s --date "now 1 hour ago"`
AWEEKAGO=`date +%s --date "now 1 week ago"`
DB=~/.mozilla/firefox/*.default/places.sqlite
echo "top 10 visited URL this week"
echo -e "\ntop 10 visited URL in general"
sqlite3 -list -line $DB 'SELECT url,title,visit_count FROM moz_places ORDER BY visit_count DESC LIMIT 10'
#sqlite3 -list -line $DB 'SELECT url,title,visit_count FROM moz_places ORDER BY visit_count DESC LIMIT 10'
echo "this week"
#sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($AWEEKAGO*1000000)"
echo "this hour"
sqlite3 -list -line $DB "SELECT url,title,visit_date as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id and visit_date>($ANHOURAGO*1000000)"
URL=$1
echo -e "\nhow many time URL X has been visited this week"
echo -e "\nhow many time URL X has been visited in general"
# e.g. repository, memory recall, ...
echo -e "\nwhen was the URL X been visited for the first time?"
# practical to check against deja-vu
startingURL=$1
endingURL=$2
echo -e "\nURLs visited between starting URL and ending URL"
# as first done with http://fabien.benetou.fr/Events/DrumbeatParis#VisitedLinks
URLSLISTFILE=~/urlstocheck
echo -e "\nwhich URLs from this list have never been visited this week"
echo -e "\nwhich URLs from this list have never been visited in general"
@ -34,7 +51,9 @@ echo -e "\nwhich URLs from this list have never been visited in general"
#types with for each a list of URLs
echo -e "\nwhat is the repartition of visits per type of activity this week"
echo -e "\nwhat is the repartition of visits per type of activity in general"
# total
# SELECT url,title,datetime(visit_date/1000000, 'unixepoch','localtime') as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id
# entertainment
# SELECT url,title,datetime(visit_date/1000000, 'unixepoch','localtime') as moment FROM moz_historyvisits, moz_places WHERE moz_historyvisits.place_id = moz_places.id AND (url like "%casttv%" OR url like "%ninja%" OR url like "%otaku%" OR url like "%youtube%")