谷歌眼镜Mirror API Reference之Timeline

原文地址:http://bbs.seacat.cn/thread-891-1-1.html


Timeline

这个资源的方法列表,在文章的末尾

资源表示形式

用户Timeline中的每一项都被表示为一个TimelineItem JSON结构,描述如下 :


{
  "kind": "mirror#timelineItem",
  "id": string,
  "sourceItemId": string,
  "canonicalUrl": string,
  "bundleId": string,
  "isBundleCover": boolean,
  "selfLink": string,
  "created": datetime,
  "updated": datetime,
  "displayTime": datetime,
  "isPinned": boolean,
  "pinScore": integer,
  "isDeleted": boolean,
  "etag": etag,
  "creator": contacts Resource,
  "recipients": [
    contacts Resource
  ],
  "inReplyTo": string,
  "title": string,
  "text": string,
  "html": string,
  "speakableType": string,
  "speakableText": string,
  "attachments": [
    timeline.attachments Resource
  ],
  "location": locations Resource,
  "menuItems": [
    {
      "id": string,
      "action": string,
      "values": [
        {
          "state": string,
          "displayName": string,
          "iconUrl": string
        }
      ],
      "removeWhenSelected": boolean,
      "payload": string
    }
  ],
  "notification": {
    "level": string,
    "deliveryTime": datetime
  }
}



 

属性名

描述

注释

attachments[]

list

与这个项目相关的媒体附件列表.方便的话, 你可以参考html plyload的附件和cid方案.例子:

·         attachment: <img src="attachment:attachment_index">其中attachment_index0-based这个数组的索引

·         cid: <img src="cid:attachment_id"> attachment_id就是附件ID

bundleId

string

对于一个itembundle ID,服务可以为多个items一起指定一个bundleId。他们在设备上位于一个顶级层次item

writable

canonicalUrl

string

规范URL指向规范/高质量版本的Timeline所代表的数据项

可写

created

datetime

这个项目创建的时间,格式为RFC 3339

creator

nested object

创建项目的用户或组

可写

displayTime

datetime

这个时间会按RFC3339的格式显示到用户的时间轴上。用户的的时间轴是按展出时间排序的,因此这也将决定项目显示在时间轴中。如果没有设定的服务,显示时间默认为更新的时间。

可写

etag

etag

为这个item ETag

html

string

HTML内容项。如果texthtml提供了一个项目,html将呈现在时间轴中

允许的 HTML元素-你可以在时间轴卡片中使用这些元素

·         Headers: h1, h2, h3, h4, h5, h6

·         Images: img

·         Lists: li, ol, ul

·         HTML5 semantics: article, aside, details, figure, figcaption, footer, header, nav, section, summary, time

·         Structural: blockquote, br, div, hr, p, span

·         Style: b, big, center, em, i, u, s, small, strike, strong, style, sub, sup

·         Tables: table, tbody, td, tfoot, th, thead, tr

封锁的 HTML元素:这些元素和他们的内容会从html中移除。

·         Document headers: head, title

·         Embeds: audio, embed, object, source, video

·         Frames: frame, frameset

·         Scripting: oranget, script

其他的元素:其他没有被列出的元素会被移除,但他们的内容保存下来。

可写

id

string

时间轴的ID.这是用户时间轴所特有的。

inReplyTo

string

如果这个item有另一个item回复生成,这个区域将被设置为回复itemid,这可以用于附加回复合适的对话或文章

isBundleCover

boolean

这个项目是否包含。

如果一个项目被标记为包含,这将是项目的入口点包bundleId一样的项目。它只会显示在主时间轴内没有打开包

在主时间轴中,项目显示为:

·         项目的isBundleCover设置为true

·         项目没有bundleId

In a bundle sub-timeline, items that are shown are:
在一个bundle sub-timeline,显示为:

·         项目有bundleId问题,isBundleCover设置为false

可写

isDeleted

boolean

当为真时,表明这个条目被删除,只有ID属性被设置。

isPinned

boolean

当为真时,表明这个项目,这意味着它的分组与活跃等导航和场所,和另一侧的主屏幕从历史(non-pinned)时间表的项目。你可以允许用户切换这个属性的值与TOGGLE_PINNED内置菜单项。

kind

string

资源的类型。这是mirror#timelineItem

location

nested object

与这个项目相关的地理位置。

可写

menuItems[]

list

一个菜单项列表,将提交给用户时,在时间轴中选择这个项目的。

可写

menuItems[].action

string

当用户选择菜单选项的控制行为。允许的值有:

·         自定义菜单 - Custom action set by the service. When the user selects thismenuItem, the API triggers a notification to yourcallbackUrlwith the userActions.type set toCUSTOM and theuserActions.payloadset to the ID of this menu item. This is the default value.

·         内置操作:

·         REPLY - Initiate a reply to the timeline item using the voice recording UI. The creatorattribute must be set in the timeline item for this menu to be available.

·         REPLY_ALL - Same behavior asREPLY. The original timeline item's recipients will be added to the reply item.

·         DELETE - Delete the timeline item.

·         SHARE - Share the timeline item with the available contacts.

·         READ_ALOUD - Read the timeline item's speakableText aloud; if this field is not set, read thetext field; if none of those fields are set, this menu item is ignored.

·         VOICE_CALL - Initiate a phone call using the timeline item'screator.phone_number attribute as recipient.

·         NAVIGATE - Navigate to the timeline item's location.

·         TOGGLE_PINNED - Toggle theisPinned state of the timeline item.

·         OPEN_URI - Open the payload of the menu item in the browser.

·         PLAY_VIDEO - Open the payloadof the menu item in theGlass video player.

可写

menuItems[].id

string

这个菜单项的ID。这是由应用程序生成的,并被视为一个不透明的令牌。

可写

menuItems[].payload

string

一个通用的有效载荷变化取决于这个菜单项的意义。

·         当动作是OPEN_URI,这个payload就是打开一个网站查看

·         当动作是PLAY_VIDEO,这个个payload就是打开一个流媒体

可写

menuItems[].removeWhenSelected

boolean

如果一个自定义菜单项设置为true,该项目将在菜单中选中之后被删除。

可写

menuItems[].values[]

list

对自定义项来说,列表值控制着每个菜单项的外观。必须提供一个默认值。如果状态不存在,他们将不会显示。

可写

menuItems[].values[].displayName

string

菜单项的显示名称。如果指定这个属性为内置菜单项,该菜单项的默认上下文语音命令不显示。

可写

menuItems[].values[].iconUrl

string

图标与菜单项显示的URL

可写

menuItems[].values[].state

string

这个值适用于的状态。允许的值是:

·         DEFAULT -默认值时显示在menuItems列表。

·         PENDING -值显示在菜单项,用户选择的但是仍然可以被取消。

·         CONFIRMED -值由用户显示菜单项,被选中时,不能再被取消。

可写

notification

nested object

控制这个项目的通知推送到设备上。如果这个不存在,就不会有通知。

可写

notification.deliveryTime

datetime

应推送通知的时间

可写

notification.level

string

描述了通知是多么的重要。允许的值是:

·         DEFAULT -通知违约的重要性。将提醒用户一致。

可写

pinScore

integer

对于固定项,这决定项目在时间表的顺序显示,接近时钟出现拥有更高的分数。注意:设置这个字段目前不支持。

recipients[]

list

一个用户或组列表,前提是这个项目已经被共享。

可写

selfLink

string

一个URL,可以用来检索这一项。

sourceItemId

string

不透明的字符串可以使用时间表项映射到数据在您自己的服务。

可写

speakableText

string

这个项目的内容有可以交谈的版本的。随着使用READ_ALOUD这个菜单项时,这一领域提供的文本将会清晰大声朗读,或提供扩展信息直观地显示在谷歌眼镜上。

Glassware should also specify the speakableType field, which will be spoken before this text in cases where the additional context is useful, for example when the user requests that the item be read aloud following a notification.
Glassware
还应该指定speakableType字段,将对在此之前额外的上下文是非常有用的,例如当用户请求项被念出来后的通知。

可写

speakableType

string

可以交谈的描述这个条目的类型。这对于向用户宣布之前阅读的内容项的情况下,额外的上下文是非常有用的,例如当用户请求项被念出来后通知。

这应该是一个简短、简单的名词短语,电子邮件短信”,星球日报新闻更新
Glassware
鼓励来对于每个项目时间表填充,即使项目不包含speakableText或文本,以便用户可以在没有看屏幕情况下学习项目的类型。

可写

text

string

这个项目的文本内容

可写

title

string

这个项目的标题

可写

updated

datetime

这个项目最后修改的时间,格式为RFC 3339

 



方法:

删除(delete

 

删除一个Timeline item

 

获取(get

 

通过id获取一个Timeline item

 

插入(insert

 

插入一个新的itemTimeline

 

列表(list

 

检索经过身份验证的用户的Timeline列表

 

补丁(patch

 

更新项目时间表。这种方法支持补丁语义(patch semantics

 

更新 update

 

更新项目时间表。

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
城市应急指挥系统是智慧城市建设的重要组成部分,旨在提高城市对突发事件的预防和处置能力。系统背景源于自然灾害和事故灾难频发,如汶川地震和日本大地震等,这些事件造成了巨大的人员伤亡和财产损失。随着城市化进程的加快,应急信息化建设面临信息资源分散、管理标准不统一等问题,需要通过统筹管理和技术创新来解决。 系统的设计思路是通过先进的技术手段,如物联网、射频识别、卫星定位等,构建一个具有强大信息感知和通信能力的网络和平台。这将促进不同部门和层次之间的信息共享、交流和整合,提高城市资源的利用效率,满足城市对各种信息的获取和使用需求。在“十二五”期间,应急信息化工作将依托这些技术,实现动态监控、风险管理、预警以及统一指挥调度。 应急指挥系统的建设目标是实现快速有效的应对各种突发事件,保障人民生命财产安全,减少社会危害和经济损失。系统将包括预测预警、模拟演练、辅助决策、态势分析等功能,以及应急值守、预案管理、GIS应用等基本应用。此外,还包括支撑平台的建设,如接警中心、视频会议、统一通信等基础设施。 系统的实施将涉及到应急网络建设、应急指挥、视频监控、卫星通信等多个方面。通过高度集成的系统,建立统一的信息接收和处理平台,实现多渠道接入和融合指挥调度。此外,还包括应急指挥中心基础平台建设、固定和移动应急指挥通信系统建设,以及应急队伍建设,确保能够迅速响应并有效处置各类突发事件。 项目的意义在于,它不仅是提升灾害监测预报水平和预警能力的重要科技支撑,也是实现预防和减轻重大灾害和事故损失的关键。通过实施城市应急指挥系统,可以加强社会管理和公共服务,构建和谐社会,为打造平安城市提供坚实的基础。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值