Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for adding log notes #61

Open
alexkutsan opened this issue Mar 8, 2023 · 4 comments
Open

API for adding log notes #61

alexkutsan opened this issue Mar 8, 2023 · 4 comments

Comments

@alexkutsan
Copy link

Nomie uses CouchDB as a backend, so I'm looking for a way to add log notes through curl. I've tried exploring the CouchDB structure, but I couldn't find a document that stores all logs in the format mentioned in the README.md.
I was trying to explore browser history when I add a log note, but it makes dozen of requests at that time and it is hard to extract the required requests.
It would be helpful to have this feature, especially when multiple trackable data points such as weight, sleep, and walking are collected by smart devices and I want to send them to Nomie automatically. Can someone provide some tips on how to add trackable logs to CouchDB using an HTTP request?

@RdeLange
Copy link
Collaborator

RdeLange commented Mar 8, 2023

Hi,
I am currently not able to help you with the specific CouchDB APi as I was not involved in that part of the code (yet).

But there is an alternative solution to have automatically push data to Nomie.
This can be achieved by the Nomie API Plugin.

More details can be found at:
https://github.com/RdeLange/nomie-plugin-api

Any questions concerning that plugin I should be able to answer for you.

Regards,
Ronald

@alexkutsan
Copy link
Author

Thanks for the recommendation!
nomie-plugin-api looks quire good.
The only drawback - is actually performs sync when the user enters nomie in the browser.
I'll try this for the beginning, but if someone has know how to push data directly to couch DB - would be cool

@alexkutsan
Copy link
Author

I found python package that is trying to use HTTP API to couch DB https://github.com/huberf/nomiepy
But looks like it is compatible with some other version of nomie :-(

But inspired by this package I tried to reverse how the browser inserts data into couchdb in nomie.
I was pretty surprised then when I triggered only one tracker - it sends to couch DB all trackers states with their revision history 😮

I was trying to do the same post request as browser do, and it responds 200! 🥳
изображение

But nomie does not show these changes in the timeline or dashboard :-(

If anyone could tip me how to insert tracker value with curl request to couch DB - would be extremely cool

@nogweii
Copy link

nogweii commented Apr 22, 2023

I think this is because the web app only reads from the locally (in-browser) stored data. And it doesn't accept data changes from CouchDB, if I understand the code correctly.

I haven't gotten around to testing this yet, but I believe it should be as simple as removing the conditional around calling change listeners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants