代码之家  ›  专栏  ›  技术社区  ›  ftrotter mario

ODLs的Tweet元语法

  •  3
  • ftrotter mario  · 技术社区  · 14 年前

    我对使用Tweets/SMS/Identica或其他短文本状态更新系统来跟踪对日常生活(或ODLs)的观察的想法很感兴趣。它的基本概念是将状态更新发送到Twitter或标识ca或者仅仅是一条短消息或其他格式的信息,可以在以后挖掘出来显示模式。

    你可以用它来追踪运动,饮食,你的电影偏好,任何你喜欢的东西。

    这个想法并不新鲜,twitter上有很多追踪锻炼和饮食习惯的应用程序。Twitter已经基本上是一个短文本ODL媒体,你可以很容易地看到它搜索的感觉 http://search.twitter.com/search?q=%23feeling http://search.twitter.com/search?q=%23hurts http://www.tweetfeel.com/

    通过使用Twitter跟踪ODL,你就不再强迫人们使用专门为此而创建的集成引擎,比如googlehealth和HealthVault,而是专注于提高人们已经在使用的ODL跟踪系统的价值,比如Facebook或Twitter。但要做到这一点,您需要一种通用的方法来输入odl和数据挖掘这些条目,这样您就可以在更高的层次,或者至少在不同的层次上获得意义。

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

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

    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 . 它还使用直接消息传递。

    // 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都会询问有关数据类型的一些信息,请您在以下两项中进行选择:

    事件-如果兴趣点是发生了什么事,例如晚安或大便 测量-如果你想了解某个数值随时间的变化趋势,例如体重160或血压170

    很聪明不是吗?

    最后一个我知道的是 Grafitter syntax

    //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 此外,还可以让你包括你吃了什么,以及卡路里/脂肪/积分跟踪。所以语法看起来像

    d tyeats #breakfast One bowl of cereal *c500
    // the *c500 marks the tweet as 500 calories
    

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

    @meattwitter Just completed a 4.50 km run with @runkeeper. Check it out! http://rnkpr.com/aaaaa #RunKeeper
    

    我忽略了其他什么重要的ODL语法? 除了runkeeper等,还有哪些重要的“自然”odl正在发生? 有没有人知道关于这个问题的正式研究(社交媒体状态更新中的ODL语法)?

    http://code.google.com/p/omhe/ 下面是OMHE语法,它已经有了一个基于python的解析器。。

    #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
    

    我的目标是在开源许可证下编写一个解析器和数据显示工具,我通常在寻找应该支持哪些类型的东西。所以,如果你能想到其他问题,我应该要求做这样一个项目的需求清单,让我知道!!例如,我知道对于标准的Twitter语法,比如提到、DMs、replies等等,都有不错的解析器实现,如果我所讨论的扩展了这项工作,或者完全并行实现。

    3 回复  |  直到 10 年前
        1
  •  1
  •   Paul Biondich    14 年前

    嘿,弗雷德。。。你见过欧姆赫吗: http://code.google.com/p/omhe/

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

    希望这有帮助。

        2
  •  1
  •   Alan Viars    14 年前

    http://github.com/aviars/b4b

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

    -艾伦

        3
  •  0
  •   ftrotter mario    14 年前

    刚发现Quant的事Quanter.com网站/

    http://blog.quantter.com/syntax

    以及解释语法的API。

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