Skip to content

Commit a0cebe9

Browse files
authored
V6
Make sure to specify your reminder list name
1 parent cc80525 commit a0cebe9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Alexa To Reminders Access.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ $$$$$$$$$$$$$$$$$$$$$$$
2828
$$$$$$$$$$
2929
3030
Version Info:
31+
v6 had to make update to accomodate slight change on Amazon's end
3132
v5 used code from user andereeicheln0z frok github repo issue linked below to inprove performance
3233
https://github.com/mvan231/Scriptable/issues/25
3334
@@ -43,8 +44,8 @@ const baseURL = 'https://www.amazon.com'
4344
//include the reminder list name exactly as it is in Reminders app
4445
const reminderListName = 'Grocery and Shopping'
4546

46-
//signInKey should be specific for your language. English uses "Sign In". German uses "Anmelden"
47-
const signInKey = "Sign In"
47+
//signInKey should be specific for your language. English uses "Sign in". German uses "Anmelden"
48+
const signInKey = "Sign in"
4849

4950
//withVar below needs to be set to your language's version of the word 'with'
5051
const withVar = "with"
@@ -60,7 +61,7 @@ async function checkIfUserIsAuthenticated() {
6061
const url = `${baseURL}/alexashoppinglists/api/getlistitems`;
6162
const request = new Request(url);
6263
await request.load();
63-
64+
log(request.response.statusCode)
6465
if (request.response.statusCode === 401 || request.response.statusCode === 403) {
6566
return false;
6667
}
@@ -77,9 +78,8 @@ async function makeLogin() {
7778
const webView = new WebView();
7879

7980
try {
80-
await webView.loadURL(url);
81+
await webView.loadURL(url)
8182
const html = await webView.getHTML();
82-
8383
if (html.includes(signInKey)) {
8484
await webView.present(false);
8585
return false;
@@ -95,10 +95,11 @@ async function makeLogin() {
9595
async function synchronizeReminders() {
9696
try {
9797
const reminderCalendar = await Calendar.forRemindersByTitle(reminderListName);
98-
98+
log(reminderCalendar)
9999
const url = `${baseURL}/alexashoppinglists/api/getlistitems`;
100100
const deleteUrl = `${baseURL}/alexashoppinglists/api/deletelistitem`;
101-
const json = await new Request(url).loadJSON();
101+
const json = await new Request(url).loadJSON()
102+
log(json)
102103
const listItems = json[Object.keys(json)[0]].listItems;
103104
//const existingReminders = await Reminder.all([reminderCalendar]);
104105

@@ -136,6 +137,7 @@ async function synchronizeReminders() {
136137
}
137138
}
138139
} catch (error) {
140+
log("doh")
139141
console.error(error);
140142
}
141143
}

0 commit comments

Comments
 (0)