|
1 | 1 | This file is an overview of available sources along with descriptions and some guidance. |
2 | 2 |
|
| 3 | +See [[#instructions][instructions]] below for additional information. |
| 4 | + |
3 | 5 | * Extra dependencies |
4 | 6 | Some sources require additional dependencies, which you can install if needed. |
5 | 7 |
|
@@ -181,7 +183,56 @@ for f in sorted((src / 'promnesia/sources').rglob('*.py')): |
181 | 183 |
|
182 | 184 | :end: |
183 | 185 |
|
184 | | - |
| 186 | +* Instructions |
| 187 | +** browser |
| 188 | + |
| 189 | +The browser source here uses [[https://github.com/karlicoss/HPI][HPI]], which uses |
| 190 | +[[https://github.com/seanbreckenridge/browserexport][browserexport]] to |
| 191 | +save/parse browser history. Since browsers remove old history after your |
| 192 | +history database has grown to a certain size, this saves the raw database files to |
| 193 | +a directory you specify. =browserexport= supports many browsers, including any |
| 194 | +Chromium/Firefox based browsers (e.g. Brave, Vivaldi, Waterfox). For more |
| 195 | +instructions on backing up databases, see |
| 196 | +[[https://github.com/seanbreckenridge/browserexport#usage][here]], but as |
| 197 | +a quickstart, after setting up =HPI=, run: |
| 198 | +#+BEGIN_SRC sh |
| 199 | +hpi module install my.browser.export |
| 200 | +#+END_SRC |
| 201 | + |
| 202 | +Then, to save your browser history, run a command like: |
| 203 | +#+BEGIN_SRC sh |
| 204 | +browserexport save -b firefox --to ~/data/browser_history |
| 205 | +browserexport save -b chrome --to ~/data/browser_history |
| 206 | +browserexport save -b safari --to ~/data/browser_history |
| 207 | +#+END_SRC |
| 208 | + |
| 209 | +This will save your browser history to a directory, which you can then point |
| 210 | +HPI at, in your |
| 211 | +[[https://github.com/karlicoss/HPI/blob/master/doc/MODULES.org#mybrowser][HPI |
| 212 | +config]]: |
| 213 | +#+BEGIN_SRC python |
| 214 | +class browser: |
| 215 | + class export: |
| 216 | + # path[s]/glob to your backed up browser history sqlite files |
| 217 | + export_path: Paths = "~/data/browsing/*.sqlite" |
| 218 | + |
| 219 | + class active_browser: |
| 220 | + # paths to sqlite database files which you use actively |
| 221 | + # to read from. For example: |
| 222 | + # from browserexport.browsers.all import Firefox |
| 223 | + # export_path = Firefox.locate_database() |
| 224 | + export_path: Paths |
| 225 | +#+END_SRC |
| 226 | + |
| 227 | +Finally, you can add the browser source to =promnesia=, in your =config.py=: |
| 228 | +#+BEGIN_SRC python |
| 229 | +from promnesia.sources import browser |
| 230 | + |
| 231 | +SOURCES = [ |
| 232 | + browser, |
| 233 | + ... |
| 234 | +] |
| 235 | +#+END_SRC |
185 | 236 | * Extending |
186 | 237 | Adding your own data sources is very easy! |
187 | 238 | One day I'll add some proper documentation, but the easiest at the moment is to use existing simple modules as a reference, for example: |
|
0 commit comments