好吧,所以我刚刚拿起了红宝石昨天..该应用程序,我做了跟踪推文,并将它们存储在一个数组中,并应输出到网页,但我不知道正确的语法输出到终端,而不是HTML文件
输出刚刚在终端中运行。 HTML
<h1>Posts#index</h1>
<p>Find me in app/views/posts/index.html.erb</p>
<%= @a %>
红宝石
class PostsController < ApplicationController
TWITTER_COMSUMER_KEY = ""
TWITTER_CONSUMER_SECRET = ""
TWITTER_OATH_TOKEN = ""
TWITTER_OATH_TOKEN_SECRET = ""
def index
@a = Array.new(500)
TweetStream.configure do |config|
config.consumer_key = TWITTER_COMSUMER_KEY
config.consumer_secret = TWITTER_CONSUMER_SECRET
config.oauth_token = TWITTER_OATH_TOKEN
config.oauth_token_secret = TWITTER_OATH_TOKEN_SECRET
end
i = 0
TweetStream.track('weed') do |status|
temp = status.text
if(temp.include? "http")
a[i] = status.text
puts "#{status.text}"
i = i+1
end
end
end
end
请显示一些代码? – CuriousMind 2013-03-10 07:26:51
我希望那些钥匙不是真的... – 2013-03-10 07:31:42
真棒,谢谢,我重置访问btw – Greg 2013-03-10 07:33:32