ユーザ用ツール

サイト用ツール


memo:2019:08:2019-08-18

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
memo:2019:08:2019-08-18 [2019/08/18 17:57]
matoken
memo:2019:08:2019-08-18 [2019/08/18 21:22] (現在)
matoken [qutebrowserのhistoryを取得したい]
ライン 85: ライン 85:
 ``` ```
  
 +壊すといけないので手元に持ってくる
 +
 +```
 +$ cp ~/​.local/​share/​qutebrowser/​history.sqlite* .
 +```
 +
 +当たりぽい
 +```
 +$ sqlite3 ./​history.sqlite
 +sqlite> .schema
 +CREATE TABLE History (url NOT NULL, title NOT NULL, atime NOT NULL, redirect NOT NULL);
 +CREATE TABLE CompletionHistory (url PRIMARY KEY, title NOT NULL, last_atime NOT NULL);
 +CREATE INDEX CompletionHistoryAtimeIndex ON CompletionHistory (last_atime);​
 +CREATE TABLE CompletionMetaInfo (key PRIMARY KEY, value );
 +CREATE INDEX HistoryIndex ON History (url);
 +CREATE INDEX HistoryAtimeIndex ON History (atime);
 +```
 +
 +OKぽい
 +```
 +$ sqlite3 -header ./​history.sqlite '​SELECT * from History'​ | head
 +url|title|atime|redirect
 +https://​start.duckduckgo.com/​|DuckDuckGo — Privacy, simplified.|1545516812|0
 +https://​www.qutebrowser.org/​quickstart.html|qutebrowser quickstart | qutebrowser|1545516812|0
 +https://​www.qutebrowser.org/​quickstart.html|qutebrowser quickstart | qutebrowser|1545516812|0
 +https://​www.qutebrowser.org/​quickstart.html|qutebrowser quickstart | qutebrowser|1545516814|0
 +https://​www.qutebrowser.org/​quickstart.html|qutebrowser quickstart | qutebrowser|1545516840|0
 +https://​start.duckduckgo.com/​|DuckDuckGo — Privacy, simplified.|1545516863|0
 +https://​start.duckduckgo.com/​|DuckDuckGo — Privacy, simplified.|1545516864|0
 +https://​start.duckduckgo.com/​|DuckDuckGo — Privacy, simplified.|1545516866|0
 +https://​start.duckduckgo.com/​|DuckDuckGo — Privacy, simplified.|1545516866|0
 +```
 +
 +これはArchiveBoxのGoogle Chrome, Chromium, Firefox履歴書き出しscript
 +出力形式はこれ真似すれば良さそう
 +
 +```
 +$ grep sqlite3 archivebox-export-browser-history
 +    sqlite3 "​$REPO_DIR/​output/​sources/​chrome_history.db.tmp"​ "​SELECT \"​[\"​ || group_concat(json_object('​timestamp',​ last_visit_time,​ '​description',​ title, '​href',​ url)) || \"​]\"​ FROM urls;" > "​$REPO_DIR/​output/​sources/​chrome_history.json"​
 +    sqlite3 "​$REPO_DIR/​output/​sources/​firefox_history.db.tmp"​ "​SELECT \"​[\"​ || group_concat(json_object('​timestamp',​ last_visit_date,​ '​description',​ title, '​href',​ url)) || \"​]\"​ FROM moz_places;"​ > "​$REPO_DIR/​output/​sources/​firefox_history.json"​
 +```
 +
 +そのまま真似して……出来たぽい
 +```
 +$ sqlite3 "​./​history.sqlite"​ "​SELECT \"​[\"​ || group_concat(json_object('​timestamp',​ atime, '​description',​ title, '​href',​ url)) || \"​]\"​ from History;"​ | jq . | head
 +[
 +  {
 +    "​timestamp":​ 1545516812,
 +    "​description":​ "​DuckDuckGo — Privacy, simplified.",​
 +    "​href":​ "​https://​start.duckduckgo.com/"​
 +  },
 +  {
 +    "​timestamp":​ 1545516812,
 +    "​description":​ "​qutebrowser quickstart | qutebrowser",​
 +    "​href":​ "​https://​www.qutebrowser.org/​quickstart.html"​
 +```
 +
 +## tweeper+xmllint+nkf
 +
 +```
 +$ tweeper https://​twitter.com/​matoken | xmllint --xpath "/​rss/​channel/​item/​title"​ - | nkf --numchar-input
 +```
  
  
memo/2019/08/2019-08-18.txt · 最終更新: 2019/08/18 21:22 by matoken