V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
timshi
V2EX  ›  iDev

支持 oAuth 和 streaming api 的 objective c Twitter library

  •  
  •   timshi · 2011-02-05 05:42:03 +08:00 · 5429 次点击
    这是一个创建于 4829 天前的主题,其中的信息可能已经有所发展或是发生改变。
    6 条回复    1970-01-01 08:00:00 +08:00
    timshi
        1
    timshi  
    OP
       2011-02-05 05:56:04 +08:00
    因为发现 twitter 推荐的 MG Twitter Engine 不支持 oAuth 和 streaming api,并且set up过程很复杂(它试图支持各种xml 和 json 的 parser)。所以动手在它的基础上加了这两个功能,并且简化了 setup 的步骤, 然后写了一个小的 demo project。请问有人计划做iOS上的 twitter integration么,你觉得这样的project有开源的价值么?
    Livid
        2
    Livid  
    MOD
       2011-02-05 06:56:30 +08:00
    我觉得直接用 ASIHTTPRequest 做会让事情简单很多,尤其是在 ASIHTTPRequest 支持 blocks 之后。
    timshi
        3
    timshi  
    OP
       2011-02-05 07:18:41 +08:00
    ASIHttpRequest 是 CFNetwork 的 wrapper 吧? 如果用它可能可以简化这个library的实现。不过我所提到的library是更高一层的abstraction, 用户直接调用象 updateStatus, follow, unfollow 这样的method。 不需要直接接触 http connection 一层的东西, 那些都由library 处理。另外oAuth方面也是一样,用户只需要调用 requestRequestToken, requestAccessToken,和他们的delegate,而不需要去接触http级的东西。
    Livid
        4
    Livid  
    MOD
       2011-02-05 07:20:56 +08:00
    @timshi 可以做一个 Singleton 实现的 simple Twitter data client,任何时候需要用到 Twitter 的时候,就这样子:

    TwitterUser * user = [[TwitterManager sharedManager] currentUser];

    [[TwitterManager sharedManager] updateStatusWithString:@"Hello world"];
    timshi
        5
    timshi  
    OP
       2011-02-05 10:15:40 +08:00
    @livid 我正是这么想的。
    timshi
        6
    timshi  
    OP
       2011-02-05 11:46:26 +08:00
    git hub

    https://github.com/TimShi/TSTwitterEngine

    check out project 以后:

    1. 在 TwitterEngine.h 里填上你的 consumer key, consumer secret
    2. 在 TwitterCommonLibraryAppDelegate.m 里把 tracking keyword 改成你想要的tracking keyword. 现在是设置成 "github"

    That's it, build and run the project。

    你会先被提示去登录 twitter, 然后 twitter 上所有带你所设定的 keyword 的 tweets 都会实时出现在 tableview 上。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2929 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:23 · PVG 19:23 · LAX 04:23 · JFK 07:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.