[ZK] 當 ZK mobile framework 遇到 twitter. Part - 1

 

自从在 Wired 上读了 Clive Thompson的一篇叫 “How Twitter Creates a Social Sixth Sense,” 之后就对 Twitter 产生了很大的兴趣.再加上在下我工作的地方(ZK).  便决定要将 Twitter ZK mobile 结合在一起. 在开发的过程之前发现使用 ZK 开发真的很方便. 因为工作上有别的 assignment, 所以只好利用空余的时间Code. 在这里用到了两个很方便的 API 一个就是 ZK 另一个是 jTwitter.

jTwitter是由 Daniel Winterstein 开发的一个 Java twitter interface. 有兴趣的朋友可以去 http://thinktankmaths.co.uk/2007/06/21/java-twitter/ 看看.

ZK 是一个很强大的 Java based server-side AJAX framework. 官网 http://zh.zkoss.org

我几乎花了不到半个小时就把 code 整好. 可是了如一般程序员的悲哀, 花了两个多小时把 Tomcat debug. 下面就是开发出来的截图:

  因为是使用 ZK 的关系 twitter.mil code 只有以下短短几行:

<? xml version="1.0" encoding="UTF-8" ?>

< frame  onCommand ="MilDevice.goHome(null)"  visible ="true" >
< zscript >
<![CDATA[

import thinktank.twitter.*;
import org.zk.twitter.*;

Twitter myTw = new  Twitter("USERNAME","PASSWORD");
TwitterFactory _tf = new TwitterFactory();
List link = _tf.myTwitterStatus(myTw);

]]>
</ zscript >
    
< zk   forEach ="${link}"   >
        
< label  flow ="only"  value ="[My name is ${each.userScreenName}]" />
        
< label  flow ="only"  value ="${each.text}" />
        
< label  flow ="last"  value ="Where: ${each.userLocation}" />
        
< label  flow ="only"  value ="- END -" />
    
</ zk >
    
    
< command  label ="Home"   type ="back" />
</ frame >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
优化下面代码.bg { width: 100%; height: 100vh; background-image: url('../../assets/img/info-bg.png'); background-size: 100% 100%; background-repeat: no-repeat; position: relative; font-family: AlibabaPuHuiTiR; .goBack { position: absolute; top: 34px; right: 65px; cursor: pointer; color: #ffffff; width: 181px; padding: 15px 10px; background: rgba(24, 31, 30, 0.52); border: 1px solid #4a524e; border-radius: 5px; font-size: 18px; font-family: AlibabaPuHuiTiR; z-index: 111; display: flex; flex-direction: row; justify-content: space-between; align-items: center; } .home-left { position: absolute; top: 18%; left: 40px; width: 41%; height: 76%; font-size: 24px; color: #ffffff; } .unit { font-size: 24px; color: #636363; } .home-left-title { font-size: 24px; color: #ffffff; line-height: 36px; } .home-right { position: absolute; top: 18%; right: 88px; width: 46%; height: 78%; } .model { display: flex; justify-content: center; align-items: center; height: 90%; } #threeContained { width: 100%; height: 100%; } .model-qk-img { width: 82%; height: 90%; background-image: url('../../assets/img/howo.png'); background-size: 100% 100%; background-repeat: no-repeat; } .model-zk-img { width: 56%; height: 90%; background-image: url('../../assets/img/heavyT.png'); background-size: 100% 100%; background-repeat: no-repeat; } .model-gj-img { width: 82%; height: 90%; background-image: url('../../assets/img/transit.png'); background-size: 100% 100%; background-repeat: no-repeat; } .car-online { margin-bottom: 50px; } } .day-data { display: flex; flex-direction: row; justify-content: space-between; align-items: center; height: 29%; margin-left: 30px; } .day-val { width: 40%; } .prefix { display: inline-block; width: 6px; height: 14px; background: #ffffff; margin-right: 20px; } .zh-title { margin-left: 30px; padding-top: 30px; font-size: 30px; font-weight: 700; text-align: left; color: #ffffff; line-height: 32px; letter-spacing: 0.3px; font-family: AlibabaPuHuiTiB; } .en-title { margin-left: 30px; font-size: 14px; font-weight: 400; text-align: left; color: #ffffff; line-height: 32px; letter-spacing: -0.91px; font-family: AlibabaPuHuiTiR; }
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值