atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.87k stars 413 forks source link

An activity tracker for Nyxt? #1493

Closed pdelfino closed 1 year ago

pdelfino commented 3 years ago

[pain]

Hi,

I have been using Nyxt on a daily basis for 4-weeks and I am really enjoying it!! =D

However, I really miss one feature from my past web browser experience: an activity tracker. Historically, I used Firefox with the Rescue Time (RT) add-on. Recently, I have been trying a FOSS project called Activity Watch (AW) which also has a Firefox extension.

I am still using RT and AW but since I am only using Nyxt and deleted Firefox now they only get relevant data about my "offline" activity. Thus, I lost the analytics on my web activity and I miss it.

They even show how much time I spend on Nyxt but I cannot see what I did inside Nyxt. They treat Nyxt only as a desktop app.

pdelfino commented 3 years ago

[possible solutions]

I see three possible approaches for this:

First, this could be a built-in feature like a new component of the promising Nyxt's dashboard.

A second option woud be building a Nyxt extension. There are a few already.

A third option would be making a "coder partnership" with the Activity Watch project. This could be a good "marketing move"!

I think their users might like Nyxt. And Nyxt's users might like the AW project. They already have Firefox and Chrome extensions available. Maybe we could build a Nyxt extension for them. Maybe the first third-party web-extension supported on Nyxt?

aartaka commented 3 years ago

Wow, that's a lot of cool ideas!

First, this could be a built-in feature like a new component of the promising Nyxt's dashboard.

A second option woud be building a Nyxt extension. There are a few already.

Dashboard should be extensible (although that's not yet the case), so writing a pluggable dashboard module sounds most intuitive there. For that we need to think of how to make dashboard easy to extend, though.

A third option would be making a "coder partnership" with the Activity Watch project. This could be a good "marketing move"!

I think their users might like Nyxt. And Nyxt's users might like the AW project. They already have Firefox and Chrome extensions available. Maybe we could build a Nyxt extension for them. Maybe the first third-party web-extension supported on Nyxt?

That sounds fascinating! No one of Nyxt developers uses Activity Watch, though :(

I'll mark this as help-wanted and maybe even try it myself in a month or two :) I hope it's not too much of a waiting for you...

pdelfino commented 3 years ago

I am glad you liked the idea, Artyom!

Actually, it would be really cool if I could help coding this. I am just not sure if it is too challenging on the technical side. If someone is willing to mentor me would be awesome.

I think I can do a humble prototype reading the history local file. At least counting which sites were visited.

This article from @aadcg inspired me to post this here.

As he stated while quoting ESR:

Every good work of software starts by scratching a developer’s personal itch.

In addition, this idea is congruent with Nyxt value proposition of productivity. You can only manage what you track. Time is the ultimate resource.

Moreover, it is congruent with long-term/medium-term strategy of incorporating analytics on Nyxt, as stated on the Radio Student Interview.

aartaka commented 3 years ago

I am open to mentoring; and interfacing with third-party apps sounds interesting.

I'm hesitating, though... Maybe implementing even a subset of WebExtensions API (like history API) functions can help us run their Firefox/Chrome-targeting extensions? It's basically the same thing as with ad blocking — we don't really improve it because we hope to leverage existing solutions.

aadcg commented 3 years ago

Pedro Delfino @.***> writes:

This article from @aadcg inspired me to post this here.

I'm happy that such a seemingly useless and awkward article motivates you!

This also leaves some food for thought for @jmercouris, since he manifested scepticism towards the importance of the referred article back then.

Actually, it would be really cool if I could help coding this. I am just not sure if it is too challenging on the technical side. If someone is willing to mentor me would be awesome.

Feel free to write me if you feel the need. I have, or used to have, Nyxt wrapped around my head.

I had a cursory look about your background. I think people who deal/have dealt with maths and books from Elon Lages Lima have the endurance to learn and accomplish their goals. I've been there too, and I even found a typo in one of his books (https://math.stackexchange.com/questions/2549140/definition-of-meagre-set)!

At the end of the day, it's all about "bunda na cadeira" (to quote Clóvis de Barros Filho) and finding a balance in the quest. Boa sorte!

jmercouris commented 3 years ago

I'm happy that such a seemingly useless and awkward article motivates you! This also leaves some food for thought for @jmercouris, since he manifested scepticism towards the importance of the referred article back then.

Well, sometimes things resonate differently with different people :-)

Ambrevar commented 3 years ago

In https://old.reddit.com/r/Nyxt/comments/oa69oe/whats_preventing_you_from_using_nyxt_as_your/ someone mentioned https://github.com/gildas-lormeau/SingleFileZ. Maybe worth looking at.

novoid commented 3 years ago

someone mentioned https://github.com/gildas-lormeau/SingleFileZ. Maybe worth looking at.

This was me.

SingleFileZ is more than just an add-on to log your web activity. It stores HTML files that are in fact containers that contain the whole content of visited web pages. This way, I get my whole browsing history in my archive (a few GB per month). If I want to re-visit some content, I may look up the local file and re-read the page even if the original page is gone.

Since my files follow a file name pattern like 2021-06-30T18.24.38 rise - github.com - An activity tracker for Nyxt_ · Issue #1493 · atlas-engineer_nyxt.html (the file generated when I loaded this page) that starts with an ISO time-stamp which may be indexed by this Memacs module, all my web page visits end up in my Org mode agenda.

Ambrevar commented 3 years ago

To store HTML "containers", we could leverage Monolith. See https://github.com/atlas-engineer/nyxt/issues/1063.

gildas-lormeau commented 3 years ago

@Ambrevar Out of curiosity, what makes Monolith more suited to your needs compared to SingleFile/SingleFileZ?

Ambrevar commented 3 years ago

If I understand correctly, SingleFileZ is a Firefox / Chrome / Edge extension, so Nyxt won't support it. Monolith is a command line program, Nyxt can easily leverage it.

gildas-lormeau commented 3 years ago

@Ambrevar Thank you for the feedback. As written in in the description (e.g. "Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file"), SingleFile/SigleFileZ are Web Extensions and CLI tools.

Ambrevar commented 3 years ago

Oops! I had overlooked that :p

Now the other issue I see with SingleFileZ is that according to the CLI README (https://github.com/gildas-lormeau/SingleFileZ/blob/master/cli/README.MD) is depends on NodeJS.

Is it possible to leverage SingleFileZ without the NodeJS dependency?

The NodeJS situation on Nix and Guix is still problematic, so we can't afford to have Nyxt depend on it at the moment.

gildas-lormeau commented 3 years ago

Technically, NodeJS is only used to pilot Pupeteer/WebDriver/Playwright/JSDOM... Thus, this code could be written in any other programming language able to inject scripts in a browser/webview. Heres'a an example of integration with a WKWebView on Mac for example: https://github.com/david-littlefield/SingleFileMac.

Ambrevar commented 3 years ago

Thanks for the link, this could prove very useful.

How would you compare Monolith and SingleFileZ?

gildas-lormeau commented 3 years ago

I would say the main difference is that Monolith is not using a browser under the hood so it cannot interpret JavaScript. That means that pages will be saved as if JavaScript was disabled. The other noticeable difference is the output format. SingleFileZ produces zip files disguised as self-extracting HTML files.

gildas-lormeau commented 3 years ago

BTW, here's another link that could interest you https://github.com/zotero/zotero/blob/52932b6eb03f72b5fb5591ba52d8e0f4c2ef825f/scripts/babel-worker.js. It shows how Zotero integrates SingleFile in their product.

jmercouris commented 1 year ago

I don't think this is something that belongs in core Nyxt. Could be an extension some day.