Automatic Ouraring health metrics sync to Obsidian #971
Replies: 4 comments 2 replies
-
Hey @louis030195, I wanted to do this as well with my oura ring. Could you expand on the steps, or create a short video tutorial please. |
Beta Was this translation helpful? Give feedback.
-
as a note, wrapping the URL in double quotes seems to be necessary on OSX |
Beta Was this translation helpful? Give feedback.
-
I saw this when I first started using Obsidian and Templater, so thank you for the post. I expanded upon your work and idea, creating a specific script file and a template to utilize it. edit: the following script is meant to be use in the daily note template hence the reference to script: generate_ouraring_score.js async function generate_ouraring_score(tp, stat) {
const fmt = "YYYY-MM-DD";
const now = tp.date.now(fmt, 0, tp.file.title, fmt);
const baseUrl = "https://api.ouraring.com/v2/usercollection/";
const fullUrl = baseUrl + stat + '?start_date=' + now + '&end_date=' + now;
const response = JSON.parse(
await request({
url: fullUrl,
method: "GET",
contentType: "application/json",
headers: {
'Authorization': 'Bearer TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
})
);
// only return a value if the response contains it
if(response && response.data && response.data.length > 0 && response.data[0].score)
return response.data[0].score
return 'N/A';
}
module.exports = generate_ouraring_score; Templater template:
Note: You will need to generate a personal access token on the oura ring cloud developer api dashboard and insert it into the javascript file where TOKEN is shown. Completely replace TOKEN with the generated token value. This personal access token only allows you to get data from YOUR account and nobody else's. If you want to expand further beyond just the |
Beta Was this translation helpful? Give feedback.
-
Curious if any of you have integrated the api with Notion as well?
…On Mon, Jan 8, 2024 at 5:50 PM Serka ***@***.***> wrote:
Hi, I've recently realized this as well and have a backlog item to look
into this soon
—
Reply to this email directly, view it on GitHub
<#971 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5KPUK3VPST7TMYPV44UEDDYNRZ4BAVCNFSM6AAAAAATJYDZ7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DANJXGAZTE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions