Skip to content

Instantly share code, notes, and snippets.

@zyguan
Created February 20, 2016 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zyguan/6e64fbc5f729f4b7206c to your computer and use it in GitHub Desktop.
Save zyguan/6e64fbc5f729f4b7206c to your computer and use it in GitHub Desktop.
-- Firefox saves your browsing history data in places.sqlite. So it's
-- possible to know about your behavior by a sql select statement.
-- Here is an example.
--
-- (https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile)
--
SELECT host, count(*) FROM moz_historyvisits h LEFT JOIN
(SELECT id, substr(substr(url, instr(url,'://')+3),
0,instr(substr(url, instr(url,'://')+3),'/')) AS host
FROM moz_places WHERE substr(url,0,5) = 'http') p ON h.place_id = p.id
GROUP BY host ORDER BY count(*) DESC LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment