Google Glass Timeline Item with NAVIGATE action is not showing up on Glass device - google-mirror-api

Why doesn't a timeline item with this payload offer the turn by turn navigation options from Google Glass, is there a bug ? If the answer is because it needs more properties set that sucks to make us call another endpoint.
{
"kind": "mirror#timelineItem",
"id": "035cb808-a908-4057-914f-f980fb35c620",
"bundleId": "12",
"created": "2013-08-21T22:52:54.635Z",
"updated": "2013-08-21T22:52:54.635Z",
"etag": "\"hzfI85yu0lKQdtWV4PO1jAbQxWw/UvNo_kKkfbIjHfhmNjOLyMSNIeA\"",
"creator": {
"kind": "mirror#contact",
"source": "api:34091916267",
"id": "70",
"displayName": "Monica Wilkinson"
},
"title": "glass-4",
"text": "...",
"html": "....",
"speakableText": "...",
"location": {
"kind": "mirror#location",
"latitude": 37.7657774,
"longitude": -122.4075774,
"displayName": "Crushpath Labs"
},
"menuItems": [
{
"action": "NAVIGATE"
}
]
}

Try this:
"location": {
"latitude": 37.7657774,
"longitude": -122.4075774,
"accuracy": 36.0
},
It works for me.

Related

How to Break json object in a for each

How can one split the below json example by different email in a for each loop? So the end result is two completely separate entities keeping there own objects and arrays.
This result comes from a sql dump but the sql connector alters the output, so I've had to parse that output in a for each loop of its own even though there is no loop it's all in one line.
[
{
"Email": "Steve#gmail.com",
"Name": "Steve Larson",
"ID": "1111",
"Date": "2022-09-12",
"Address": "10 Chicken Place",
"Town": "Gatebody",
"Postcode": "xxx 1xx",
"Data": [
{
"Ref": "34546",
"Transaction_Date": "2018-11-29",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep1"
},
{
"Ref": "34546v2",
"Transaction_Date": "2018-12-24",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep2"
}
]
},
{
"Email": "innis#gmail.com",
"Name": "Innis Blitz",
"ID": "3456",
"Date": "2022-10-12",
"Address": "33 Snake Road",
"Town": "March",
"Postcode": "cxc 3cd",
"Data": [
{
"Ref": "078776701",
"Transaction_Date": "2021-08-27",
"Amount": 984.68,
"Balance": 984.68,
"Notes": "Yes please"
},
{
"Ref": "078776701v2",
"Transaction_Date": "2021-08-27",
"Amount": 98422.6,
"Balance": 98432.6,
"Notes": "Please not now"
}
]
}
]
Would like to do a for each so it splits the above like so. The idea then for my to load the result of the for each into a template that takes arrays.
{
"Email": "Steve#gmail.com",
"Name": "Steve Larson",
"ID": "1111",
"Date": "2022-09-12",
"Address": "10 Chicken Place",
"Town": "Gatebody",
"Postcode": "xxx 1xx",
"Data": [
{
"Ref": "34546",
"Transaction_Date": "2018-11-29",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep1"
},
{
"Ref": "34546v2",
"Transaction_Date": "2018-12-24",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep2"
}
]
}
{
"Email": "innis#gmail.com",
"Name": "Innis Blitz",
"ID": "3456",
"Date": "2022-10-12",
"Address": "33 Snake Road",
"Town": "March",
"Postcode": "cxc 3cd",
"Data": [
{
"Ref": "078776701",
"Transaction_Date": "2021-08-27",
"Amount": 984.68,
"Balance": 984.68,
"Notes": "Yes please"
},
{
"Ref": "078776701v2",
"Transaction_Date": "2021-08-27",
"Amount": 98422.6,
"Balance": 98432.6,
"Notes": "Please not now"
}
]
}
I have reproduced in my environment and got expected results and I followed below process:
I have initialized your input as below:
Then i added for each control and send the output of previous step as input as inside of foreach loop, i have added send email action.
Outputs:
I have got tow jsons in two seperate emails as above.

Providing json responses for react-native app with Laravel

I've been told that we have some limitations in front end side and we can't use the normal Eloquent json responses, instead I should prepare responses like:
[
{
"title": null,
"type": "animals",
"description": null,
"items": [
{
"type": "animal",
"content": {
"id": 31,
"image": null,
"name": "Asghar's dog",
"age": null,
"race": null,
"species_id": 1,
"reason": [
"Home"
]
}
}
]
},
{
"title": "Recommend",
"type": "recommendations",
"description": null,
"items": [
{
"type": "self_checks",
"content": {
"type": "prompt",
"title": "Self check for Asghar's dog.",
"description": "A short Self check.",
"cta_text": "Los geht’s"
}
},
{
"type": "worm_checks",
"content": {
"title": "Wurm-Vorsorge für Asghar's dog.",
"description": "Finde heraus, wie hoch das Wurm-Risiko deiner Fellnase ist.",
"cta_text": "Los geht’s",
"health_check_payload": {
"url": "https://****.de/check/worms?utm_term=Worms&utm_content=primer",
"title": "Wurm Check"
}
}
}
]
}
]
I need to know how should I structure my code to avoid code repetition and keep it clean. Also, I'm looking for any document regarding this type of responses.

Power Automate: get specific property of a dinamic length json object

I work with a flow in Power Automate. In one of the actions I receive a json object which has a dinamic size. The inside objects have always the same properties but the size of the entire object is dinamic:
Sometimes the output I receive is this:
{
"0": {
"id": 1,
"title": "...",
"url": "https://...",
"slug": "...",
"tags": ["tag1", "tag2", "tag3", "tag4"],
}
}
Or may be like this:
{
"0": {
"id": 1,
"title": "...",
"url": "https://...",
"slug": "...",
"tags": ["tag1", "tag2", "tag3", "tag4"],
},
"5": {
"id": 123,
"title": "...",
"url": "https://...",
"slug": "...",
"tags": ["tag1", "tag2"],
},
"7": {
"id": 456,
"title": "...",
"url": "https://...",
"slug": "...",
"tags": ["tag1", "tag2", "tag3"],
}
}
I would like to know wether is possible to get all the values of a specific key.
The real aim is to get all those values (let's say, the URL) and show them in an email.
Thanks in advance.

What are all the contents I can add to a Discord webhook?

I am making a discord webhook, and I want to know all the different things I can add to it.
As far as styling it goes; I only have a color and a message. (My code is not included besides that, just the code for the color and the message)
.setTitle('Biscuit AIO Cooked!')
.setColor('#84e1f4');
If anyone can link me a site or reply to me with all of the things I can add to the webhook, please do so :)
Read about message embeds and embed visualizer.
At last one of the features of a webhook is that you can send several embeds at once message. So code will looks like this.
{
"content": "this `supports` __a__ **subset** *of* ~~markdown~~ 😃 ```js\nfunction foo(bar) {\n console.log(bar);\n}\n\nfoo(1);```",
"embeds": [
{
"title": "title ~~(did you know you can have markdown here too?)~~",
"description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
"url": "https://discordapp.com",
"color": 11038012,
"timestamp": "2020-07-03T15:05:41.392Z",
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "footer text"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"image": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"author": {
"name": "author name",
"url": "https://discordapp.com",
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"fields": [
{
"name": "🤔",
"value": "some of these properties have certain limits..."
},
{
"name": "😱",
"value": "try exceeding some of them!"
},
{
"name": "🙄",
"value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
},
{
"name": "<:thonkang:219069250692841473>",
"value": "these last two",
"inline": true
},
{
"name": "<:thonkang:219069250692841473>",
"value": "are inline fields",
"inline": true
}
]
},
{
"title": "title ~~(did you know you can have markdown here too?)~~",
"description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
"url": "https://discordapp.com",
"color": 11038012,
"timestamp": "2020-07-03T15:05:41.392Z",
"footer": {
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
"text": "footer text"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"image": {
"url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"author": {
"name": "author name",
"url": "https://discordapp.com",
"icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
},
"fields": [
{
"name": "🤔",
"value": "some of these properties have certain limits..."
},
{
"name": "😱",
"value": "try exceeding some of them!"
},
{
"name": "🙄",
"value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
},
{
"name": "<:thonkang:219069250692841473>",
"value": "these last two",
"inline": true
},
{
"name": "<:thonkang:219069250692841473>",
"value": "are inline fields",
"inline": true
}
]
}
]
}

Google Calendar API: how to access X-APPLE-TRAVEL-DURATION

When accessing as .ics my (Google) calendar contains Apple Calendar travel information:
X-APPLE-TRAVEL-DURATION;VALUE=DURATION:PT45M
(full example here)
How do I retrieve this information using the Google Calendar API?
When listing the events this information is not included.
E.g.
{
"kind": "calendar#event",
"etag": "\"...\"",
"id": "...",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=...",
"created": "2016-05-29T11:45:53.000Z",
"updated": "2016-05-29T11:45:53.530Z",
"summary": "test apple travel",
"creator": {
"email": "john#doe.com",
"displayName": "John Doe",
"self": true
},
"organizer": {
"email": "john#doe.com",
"displayName": "John Doe",
"self": true
},
"start": {
"dateTime": "2016-05-30T13:00:00+02:00"
},
"end": {
"dateTime": "2016-05-30T13:30:00+02:00"
},
"iCalUID": "...",
"sequence": 0,
"hangoutLink": "...",
"reminders": {
"useDefault": true
}
}

Resources