{"id":573,"date":"2008-09-11T16:24:27","date_gmt":"2008-09-11T16:24:27","guid":{"rendered":"http:\/\/osmeusapontamentos.com\/?p=573"},"modified":"2008-09-11T16:24:27","modified_gmt":"2008-09-11T16:24:27","slug":"firefox-history","status":"publish","type":"post","link":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/","title":{"rendered":"Firefox History"},"content":{"rendered":"<p>como o firefox guarda o historico (paginas por onde passamos) numa base de dados (sqlite) podemos n\u00f3s proprios fazer uns querizitos para saber aquelas coisas interessantes do tipo qual o site que mais visitei, o dia em que vi mais sites, etc.<\/p>\n<p><code>exemplo:<\/code><code><span style=\"font-size: 10pt; font-family: Courier New;\"><code><span style=\"font-size: 10pt; font-family: Courier New;\"><br \/>\n<\/span><\/code><\/span><\/code><code><span style=\"font-size: 10pt; font-family: Courier New;\"><code><span style=\"font-size: 10pt; font-family: Courier New;\"><span style=\"color: blue;\">SELECT<\/span> <span style=\"color: maroon;\">session<\/span><span style=\"color: silver;\">,<\/span><span style=\"font-weight: bold; color: fuchsia;\">COUNT<\/span><span style=\"color: silver;\">(<\/span><span style=\"color: silver;\">*<\/span> <span style=\"color: silver;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"font-weight: bold; color: fuchsia;\">MAX<\/span><span style=\"color: silver;\">(<\/span><span style=\"color: maroon;\">visit_date<\/span><span style=\"color: silver;\">)<\/span><span style=\"color: silver;\">,<\/span><span style=\"font-weight: bold; color: fuchsia;\">MIN<\/span><span style=\"color: silver;\">(<\/span><span style=\"color: maroon;\">visit_date<\/span><span style=\"color: silver;\">)<\/span><br \/>\n<span style=\"color: blue;\">FROM<\/span> <span style=\"color: maroon;\">moz_historyvisits<\/span><br \/>\n<span style=\"color: blue;\">GROUP<\/span> <span style=\"color: blue;\">BY<\/span> <span style=\"color: maroon;\">session<\/span><br \/>\n<span style=\"color: blue;\">ORDER<\/span> <span style=\"color: blue;\">BY<\/span> <span style=\"font-weight: bold; color: fuchsia;\">COUNT<\/span><span style=\"color: silver;\">(<\/span><span style=\"color: silver;\">*<\/span> <span style=\"color: silver;\">)<\/span> <span style=\"color: blue;\">DESC<\/span><\/span><\/code><\/span><\/code><\/p>\n<p>eu executei isto no sqlite manager que \u00e9 um addon do firefox e depois apontei para %APPDATA%\\Mozilla\\Firefox\\Profiles\\ tal e coisa \\places.sqlite<br \/>\ncomo o campo visit_date devolve uma coisa estranha que n\u00e3o \u00e9 uma data saltei para o vb.net e fiz um programeta para ir mastigar essa informa\u00e7\u00e3o para ver o que consigo fazer com ela.<\/p>\n<p>tive primeiro que instalar o System.Data.SQLite. Depois tirando um ou outro stress com um erro que d\u00e1 quando o firefox est\u00e1 aberto (file lock) n\u00e3o tive nenhum problema<\/p>\n<p>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click<\/p>\n<p>&#8216;%APPDATA%\\Mozilla\\Firefox\\Profiles\\<br \/>\nDim cnn As SQLiteConnection<br \/>\nTry<br \/>\ncnn = New SQLiteConnection(&#8220;data source=c:\\Users\\vitor.silva\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\646vwtnu.default\\places.sqlite&#8221;)<br \/>\ncnn.Open()<\/p>\n<p>Dim myCommand As New SQLiteCommand(cnn)<br \/>\nmyCommand.CommandText = &#8220;select session, count(*) [numero Sites], max(visit_date) [dataFim], min(visit_date) [dataInicio] FROM moz_historyvisits\u00a0 group by session order by count(*) desc&#8221;<\/p>\n<p>Dim reader As SQLiteDataReader = myCommand.ExecuteReader()<\/p>\n<p>While reader.Read()<br \/>\nConsole.WriteLine(String.Format(&#8220;{0}; {1}; {3}; {2}&#8221;, reader.Item(0).ToString(), reader.Item(1).ToString(), Convert(CLng(reader.Item(2))).ToString(), Convert(CLng(reader.Item(3))).ToString()))<br \/>\nEnd While<br \/>\nCatch ex As Exception<br \/>\nDebug.Print(ex.ToString())<br \/>\nEnd Try<\/p>\n<p>End Sub<\/p>\n<p>Private Function Convert(ByVal numero As Long) As DateTime<br \/>\nDim prTimeInMillis As Long<br \/>\nprTimeInMillis = CLng(CLng(numero) \/ 1000)<\/p>\n<p>Dim prDateTime As New DateTime(1970, 1, 1)<br \/>\nReturn prDateTime.AddMilliseconds(prTimeInMillis)<br \/>\nEnd Function<\/p>\n","protected":false},"excerpt":{"rendered":"<p>como o firefox guarda o historico (paginas por onde passamos) numa base de dados (sqlite) podemos n\u00f3s proprios fazer uns querizitos para saber aquelas coisas interessantes do tipo qual o site que mais visitei, o dia em que vi mais sites, etc. exemplo: SELECT session,COUNT(* ),MAX(visit_date),MIN(visit_date) FROM moz_historyvisits GROUP BY session ORDER BY COUNT(* ) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[256,538],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-ler-ver-ouvir-passear","tag-firefox","tag-programar"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Firefox History - Os Meus Apontamentos<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Firefox History - Os Meus Apontamentos\" \/>\n<meta property=\"og:description\" content=\"como o firefox guarda o historico (paginas por onde passamos) numa base de dados (sqlite) podemos n\u00f3s proprios fazer uns querizitos para saber aquelas coisas interessantes do tipo qual o site que mais visitei, o dia em que vi mais sites, etc. exemplo: SELECT session,COUNT(* ),MAX(visit_date),MIN(visit_date) FROM moz_historyvisits GROUP BY session ORDER BY COUNT(* ) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/\" \/>\n<meta property=\"og:site_name\" content=\"Os Meus Apontamentos\" \/>\n<meta property=\"article:published_time\" content=\"2008-09-11T16:24:27+00:00\" \/>\n<meta name=\"author\" content=\"Vitor Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vitorsilva\" \/>\n<meta name=\"twitter:site\" content=\"@vitorsilva\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vitor Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/\"},\"author\":{\"name\":\"Vitor Silva\",\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#\\\/schema\\\/person\\\/d508df9c3ffc8b4e64a18dbf0ba18dd8\"},\"headline\":\"Firefox History\",\"datePublished\":\"2008-09-11T16:24:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/\"},\"wordCount\":287,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#\\\/schema\\\/person\\\/d508df9c3ffc8b4e64a18dbf0ba18dd8\"},\"keywords\":[\"firefox\",\"programar\"],\"articleSection\":[\"Ler\\\/ Ver\\\/ Ouvir\\\/ Passear\"],\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/\",\"url\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/\",\"name\":\"Firefox History - Os Meus Apontamentos\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#website\"},\"datePublished\":\"2008-09-11T16:24:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/index.php\\\/2008\\\/09\\\/11\\\/firefox-history\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/osmeusapontamentos.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Firefox History\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#website\",\"url\":\"https:\\\/\\\/osmeusapontamentos.com\\\/\",\"name\":\"Os Meus Apontamentos\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#\\\/schema\\\/person\\\/d508df9c3ffc8b4e64a18dbf0ba18dd8\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/osmeusapontamentos.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/osmeusapontamentos.com\\\/#\\\/schema\\\/person\\\/d508df9c3ffc8b4e64a18dbf0ba18dd8\",\"name\":\"Vitor Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g\",\"caption\":\"Vitor Silva\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/vitormrsilva\",\"https:\\\/\\\/x.com\\\/vitorsilva\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Firefox History - Os Meus Apontamentos","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/","og_locale":"pt_PT","og_type":"article","og_title":"Firefox History - Os Meus Apontamentos","og_description":"como o firefox guarda o historico (paginas por onde passamos) numa base de dados (sqlite) podemos n\u00f3s proprios fazer uns querizitos para saber aquelas coisas interessantes do tipo qual o site que mais visitei, o dia em que vi mais sites, etc. exemplo: SELECT session,COUNT(* ),MAX(visit_date),MIN(visit_date) FROM moz_historyvisits GROUP BY session ORDER BY COUNT(* ) [&hellip;]","og_url":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/","og_site_name":"Os Meus Apontamentos","article_published_time":"2008-09-11T16:24:27+00:00","author":"Vitor Silva","twitter_card":"summary_large_image","twitter_creator":"@vitorsilva","twitter_site":"@vitorsilva","twitter_misc":{"Escrito por":"Vitor Silva","Tempo estimado de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/#article","isPartOf":{"@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/"},"author":{"name":"Vitor Silva","@id":"https:\/\/osmeusapontamentos.com\/#\/schema\/person\/d508df9c3ffc8b4e64a18dbf0ba18dd8"},"headline":"Firefox History","datePublished":"2008-09-11T16:24:27+00:00","mainEntityOfPage":{"@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/"},"wordCount":287,"commentCount":0,"publisher":{"@id":"https:\/\/osmeusapontamentos.com\/#\/schema\/person\/d508df9c3ffc8b4e64a18dbf0ba18dd8"},"keywords":["firefox","programar"],"articleSection":["Ler\/ Ver\/ Ouvir\/ Passear"],"inLanguage":"pt-PT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/","url":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/","name":"Firefox History - Os Meus Apontamentos","isPartOf":{"@id":"https:\/\/osmeusapontamentos.com\/#website"},"datePublished":"2008-09-11T16:24:27+00:00","breadcrumb":{"@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/osmeusapontamentos.com\/index.php\/2008\/09\/11\/firefox-history\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/osmeusapontamentos.com\/"},{"@type":"ListItem","position":2,"name":"Firefox History"}]},{"@type":"WebSite","@id":"https:\/\/osmeusapontamentos.com\/#website","url":"https:\/\/osmeusapontamentos.com\/","name":"Os Meus Apontamentos","description":"","publisher":{"@id":"https:\/\/osmeusapontamentos.com\/#\/schema\/person\/d508df9c3ffc8b4e64a18dbf0ba18dd8"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/osmeusapontamentos.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":["Person","Organization"],"@id":"https:\/\/osmeusapontamentos.com\/#\/schema\/person\/d508df9c3ffc8b4e64a18dbf0ba18dd8","name":"Vitor Silva","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/secure.gravatar.com\/avatar\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g","caption":"Vitor Silva"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/f81f58ad909e8a213ab0a690f6ed65e5c0e0e2274bf35ac49ff31d7988d483ce?s=96&d=mm&r=g"},"sameAs":["https:\/\/www.linkedin.com\/in\/vitormrsilva","https:\/\/x.com\/vitorsilva"]}]}},"_links":{"self":[{"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/comments?post=573"}],"version-history":[{"count":0,"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/posts\/573\/revisions"}],"wp:attachment":[{"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/media?parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/categories?post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osmeusapontamentos.com\/index.php\/wp-json\/wp\/v2\/tags?post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}