English 中文(简体)
达格·哈马舍尔德图书馆
原标题:Ruby Twitter Array Issue

我是新来的,并有一个迅速的问题。

我正试图从一个用户时间表中抽取所有员额,因此,我估计,我需要做一个用户——时间线电话,以敲响,然后人工过滤员额。 接着,在阅读《鲁宾特》文件时,我发现:

说 明witter.user_timeline (“twitter_handle”).first.text.

......而且,这一职位已经结束。

Is there a way to get more than just the first post automatically parsed out like that, or is that just an array method for the first and last object in the array?

增 编

最佳回答

你们需要对每个物体进行浓缩。

Twitter.user_timeline("twitter_handle").each do |tweet|
    puts tweet.text
end

第一种也是最后一种方法只是阵列上的方便方法。

问题回答

。 它看起来像用户——即时间线只回收一个阵列,因此,你应当能够使用Ruby的正常阵列方法。

Twitter.user_timeline("twitter_handle").each do |tweet|
    puts tweet
end




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签