http://watson1978.github.com/MacRuby-DoJo/blog/2012/03/10/search_tweets/
tableviewの左側のnameをfrom_userに変更しています
sudo macgem install twitter
macirbではどこかでencodingがASCII-8BITになってしまい使用できなかった xcode上で試していたprojectでrequireして使用したらとくにエラーは表示されなかった
http://watson1978.github.com/MacRuby-DoJo/blog/2012/03/10/search_tweets/
tableviewの左側のnameをfrom_userに変更しています
sudo macgem install twitter
macirbではどこかでencodingがASCII-8BITになってしまい使用できなかった xcode上で試していたprojectでrequireして使用したらとくにエラーは表示されなかった
| require 'rubygems' | |
| require 'twitter' | |
| class AppDelegate | |
| attr_accessor :window | |
| attr_accessor :textField | |
| attr_accessor :tableView | |
| def initialize() | |
| @search_result = [] | |
| end | |
| def numberOfRowsInTableView(aTableView) | |
| @search_result.size | |
| end | |
| def tableView(aTableView, objectValueForTableColumn: aTableColumn, row: rowIndex) | |
| @search_result[rowIndex][aTableColumn.identifier] | |
| end | |
| def search(sender) | |
| query = textField.stringValue | |
| unless query.empty? | |
| @search_result = Twitter.search(query, :rpp => 20) | |
| tableView.reloadData | |
| end | |
| end | |
| end |