首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ODL的Tweet meta语法

ODL的Tweet meta语法
EN

Stack Overflow用户
提问于 2010-08-14 14:35:19
回答 3查看 365关注 0票数 3

我对使用Tweets/SMS/Identica或其他短文本状态更新系统来跟踪日常生活观察(或ODL)的想法很感兴趣。基本概念是将状态更新发送到Twitter或Identi.ca,或者可能只是一条短信或其他任何格式,稍后可以挖掘这些格式以显示模式。

你可以用它来跟踪锻炼,饮食,你的电影偏好,任何你喜欢的东西。

要做到这一点,您需要有一种语法,允许人类和计算机轻松解析您的状态更新。语法应该是密集的,这支持低字符数,但仍然是人类可读的。

这个想法并不新鲜,有很多twitter应用程序可以用来跟踪锻炼和饮食习惯。推特本质上已经是一个短文本ODL媒介,你可以通过搜索#feeling http://search.twitter.com/search?q=%23feeling或搜索#hurts http://search.twitter.com/search?q=%23hurts或旨在挖掘已经进入推特的ODL数据财富的应用程序来很容易地看到:http://www.tweetfeel.com/

通过使用推特来跟踪ODL,您将停止强迫人们使用专门为此而创建的特定集成引擎的斗争,而是专注于提高人们已经在使用的ODL跟踪系统的价值,例如脸书或推特。但是要做到这一点,您需要一种通用的方法来输入ODL并对这些条目进行数据挖掘,这样您就可以在更高的级别(或者至少是不同的级别)获得含义。

还有几种语法可用于概括使用Twitter跟踪任何您喜欢的内容的方法。这些是我最感兴趣的。到目前为止,我知道几个:

Daytum has a twitter syntax。它使用直接消息,如下所示:

代码语言:javascript
复制
d daytum item : amount 
// simple data label and value
d daytum item [category, category] : amount
// same thing but with tagging...

Your.flowingdata.com has a richer syntax。它还使用直接消息传递。

代码语言:javascript
复制
// yfd works with "action" and "value" pairs
d yfd weigh 160
d yfd exercised arms
d yfd watched Back to the Future
// but can be made more complex with units
d yfd drank 2 water
d yfd drank 1 coke
// and timestamps 
d yfd played xbox at 20:00
d yfd goodnight at 11:00pm
d yfd goodnight at 11pm

对于每个操作,yfd将询问您有关数据类型的一些信息,要求您在以下各项之间进行选择:

分类-如果你对不同单位的相同动作的发生感兴趣,例如,吃玉米事件-如果兴趣点是当某事发生时,例如,晚上或便便计数器-如果你最感兴趣的是总时间,例如吸烟5支测量-如果你想查看某个值随时间的趋势,例如体重160或血压170

很聪明,不是吗?

我所知道的最后一个是Grafitter syntax。到目前为止,这是一个非常简洁的概念,因为它以一种非常聪明的方式使用了标签……

代码语言:javascript
复制
//hashtag with comma separated tags
#mood(happy,elated,drunk)
#mood(sad,sober)
// scales, like not busy
#busy(1)
// very busy
#busy(5)
//straight up numbers
#lbs(250)
#worked(10)

Tweet your eats uses DMs也是一样,可以让你包括你吃了什么,以及包括卡路里/脂肪/积分跟踪。所以语法看起来像这样

代码语言:javascript
复制
d tyeats #breakfast One bowl of cereal *c500
// the *c500 marks the tweet as 500 calories

当然,重要的是要注意不同的ODL生成软件所采用的非常常见的自然语言模式,这些ODL生成软件已经记录到twitter上,比如runkeeper,它通常会生成以下内容:

代码语言:javascript
复制
@meattwitter Just completed a 4.50 km run with @runkeeper. Check it out! http://rnkpr.com/aaaaa #RunKeeper

那么现在是我的问题了吗?

我还忽略了哪些其他重要的ODL语法?DM是进行数据收集的正确方式吗?还是应该专注于标签?除了runkeeper等,还有哪些重要的“自然”ODL正在发生?有没有人知道关于这个问题的正式研究(社交媒体状态更新中的ODL语法)?有没有人知道现有的开源项目实现了这种类型的东西?

更新: Paul指出OMHE项目就是做这种事情的。http://code.google.com/p/omhe/这里是OMHE语法,它已经有了一个基于python的解析器。

代码语言:javascript
复制
#The basic OMHE syntax follows this basic format"
[COMMAND_NAME]<VALUE><#[TAG]>

# Reporting WEIGHT (This is correct):
wt123.4

# In the previous example, COMMAND_NAME=wt and VALUE=123.4

# Reporting WEIGHT (Also Correct):
wt=123.4

# In the previous example, COMMAND_NAME=wt and VALUE=123.4

# Reporting WEIGHT with _TAGS_ (Also Correct) :
wt=123.4#mytag#myothertag

# The previous example has two tags: 'mytag' and 'myothertag'

# Weight is a command that requires a value (Incorrect):
wt

#You can never have an equal sign without a value. (Also Incorrect):
wt=

# Here is an OMHE string with two commands separated by white space " ".
# Says the command 'wt' (weight) has a value of '195' and blood glucose is 150.
wt195 bg=150

# Report the start of a menstrual cycle (correct):
# (Correct) mcycle is a command where value is not required 
mcycle

# Report the first day of a menstrual cycle:
# Notice we can still add tags even if no value is given 
mc

# Report the start of a menstrual cycle (Incorrect):
# You can't provide an equals "=" sign without a value: 
mc=

# Report the adherence to a health directive such as taking medication (correct):
# (Correct) did is a command where value is not required 
did

# Report the adherence to a health directive  to stretch arm (correct):
did=ARMSTRETCH

# Send Blood Glucose Level:
bg125

# Send Blood Pressure:
bp100d120p65

# Send Blood Pressure using the equals sign style:
bp=100d120p65

# Send Weight:
wt145
wt=145 #Express weight using the equals sign style
w78k   #Express weight in kilograms
wt145l  #Explicit express weight in pounds (lbs)
wt245.8 #Express fractional weight
wt245p8 #Another way to express fractional weight

# Send blood glucose, patient identifier, a note, and the date:
bg145 id213762732467234 nAllGood d20090117

# Sending blood glucose with a simple note tag (with spaces):
bg145#I'm*feeling*very*tired*today

# Report the start of a menstrual cycle:
mcycle

# Get a copy of your health benefits/insurance card:
gethc

# Send a copy of your health benefits card to someone via fax:
sendhc=6509840982#fax

# Send a copy of your health benefits card as a pdf to someone via email:
sendhc=nurse@mydoc.com#pdf

# Get a copy of your personal health record:
getphr

# Get a copy of your personal health record as a pdf:
getphr#pdf

# Get a copy of your personal health record in CCD format:
getphr#ccd

# Send a copy of your personal health record to someone in CCR format:
sendphrnurse@mydoc.com#ccr

# Send a copy of your personal health record to someone in XML microformat:
sendphr=nurse@mydoc.com#microformat

我的目标是在开源许可下编写一个解析器和数据显示工具,我一般都在寻找我应该支持什么类型的东西。所以,如果你能想到其他问题,我应该要求为这样的项目做一个需求列表,请让我知道!例如,我知道对于提及、am、回复等标准Twitter语法,有不错的解析器实现,如果我讨论的内容扩展了这项工作,或者完全并行实现的话。

目前,我乐于假设系统不会支持“私有”日志记录,除非有人能以简洁的方式告诉我如何做到这一点。

EN

回答 3

Stack Overflow用户

发布于 2010-08-19 23:34:50

嘿,佛瑞德...你见过OMHE吗:http://code.google.com/p/omhe/

或者OpenMRS消息社区中正在进行的工作...(从OpenMRS网站搜索消息)...

这些可能会给你一些关于消息传递语法的提示,因为SMS的长度与tweet的长度非常相似。:)

希望这能有所帮助。

票数 1
EN

Stack Overflow用户

发布于 2010-12-01 23:17:17

弗雷德:

我有一些代码工作,实际上工作在健康跟踪器的几个新项目的代码。具体地说,我正在将它构建到"Seven“项目中,以前是"Body4Break”。

http://github.com/aviars/b4b

现在它只是根据散列标签获得一个注释,但我正在研究自动摄取RunKeeper纯OMHE语法和其他可解析的tweet。

-Alan

票数 1
EN

Stack Overflow用户

发布于 2010-12-15 13:19:06

刚刚发现了Quantt quantter.com/

以及附带的语法。

http://blog.quantter.com/syntax

以及用于解释该语法的API。

http://beta.quantter.com/api/documentation

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3482315

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档