# Help with Twitter4r

**URL:** <https://www.ruby-forum.com/t/help-with-twitter4r/171737>\
**Category:** Ruby\
**Created:** [July 8, 2009, 2:49pm UTC](https://www.ruby-forum.com/t/help-with-twitter4r/171737 "2009-07-08T14:49:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lumbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ed655f/32.png) [@lumbar](https://www.ruby-forum.com/u/lumbar)\
**Post date:** [July 8, 2009, 2:49pm UTC](https://www.ruby-forum.com/t/help-with-twitter4r/171737/1 "2009-07-08T14:49:05Z")

</div>

Hi everybody… This is my first post where with a doubt in the first  
application that i am developing in ruby… I’m using Twitter4r library  
and Ramaze instead of Rails.

I think the problem is this bit of code:

def generate  
@content = ‘’  
client = Twitter::Client.new(:login =\> ‘myuser’, :password =\> ‘mypass’)  
received\_messages = client.messages(:received)  
received\_messages.each do |f|  
@content = @content + f.text + ', ’  
end  
end

The error message is:

Errno::ETIMEDOUT at /generate  
A connection attempt failed because the connected component does not  
respond properly after a period of time or established connection failed  
because connected host has not responded. - Connect (2)

Ruby /lib/ruby/1.8/net/http.rb: in initialize, line 564  
Web GET localhost/generate

Thanks!

Edward.

---

<div class="post-metadata">

**Author:** ![lumbar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ed655f/32.png) [@lumbar](https://www.ruby-forum.com/u/lumbar)\
**Post date:** [July 8, 2009, 11:29pm UTC](https://www.ruby-forum.com/t/help-with-twitter4r/171737/2 "2009-07-08T23:29:34Z")

</div>

Eduardo Goncalves wrote:

> received\_messages.each do |f|  
> @content = @content + f.text + ', ’  
> end  
> end

Can you get this code to work as a stand-alone script?

James

–  
James B.

[www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[www.neurogami.com](http://www.neurogami.com) - Smart application development
