Re: [ruby-99] A Powerful Twitter API Wrapper in less than 50 lines using Ruby Metaprogramming

From: user 3.
Sent on: Wednesday, May 5, 2010 1:54 PM
Hi Greg,

You can probably replace your whole TwitterResponse class just by using ostruct -- it's a ruby standard lib. ?There's also a bunch of ivars that can be made local. ?

Dean


On Wed, May 5, 2010 at 9:21 AM, Greg Osuri <[address removed]> wrote:
Hi William,

Thanks for the feedback.

The reason I didn't want to use Active Resource was to keep the footprint small with minimal dependencies. Also have to disagree you can write this in 20 lines or less with AR, will have to try it out.

I'm in the process of making ?this a full featured gem (with more than 50 lines of course) along with OAuth and Test Suite.

Cheers,
Greg.



On May 5, 2010, at 5:50 AM, William Chow wrote:

1. You shouldn't be using Basic Auth since Twitter is turning off Basic Auth by July.

2. You could've written a RESTful API wrapper using ActiveResource in probably twenty lines of code or less.

3. You should write tests.




--- On Tue, 4/5/10, Greg Osuri <[address removed]> wrote:

From: Greg Osuri <[address removed]>
Subject: [ruby-99] A Powerful Twitter API Wrapper in less than 50 lines using Ruby Metaprogramming
To: [address removed]
Date: Tuesday, 4 May, 2010, 9:13 PM
Hi,

I've been long fascinated about active record dynamic
finders (find_by_) and wanted to write some thing similarly
elegant

Opportunity showed up to write a simple Ruby Wrapper for
Twitter and I wanted to share code with you. Please review
my blog post http://gregosuri.com/powerful-twitter-api-wrapper-in-less-than-50

Thanks,
Greg.



--
Please Note: If you hit "REPLY", your message will be sent
to everyone on this mailing list ([address removed])
http://www.meetup.com/silicon-valley-ruby/
This message was sent by Greg Osuri ([address removed])
from Silicon Valley Ruby Meetup.
To learn more about Greg Osuri, visit his/her member
profile: http://www.meetup.com/silicon-valley-ruby/members/9369824/
To unsubscribe or to update your mailing list settings,
click here: http://www.meetup.com/silicon-valley-ruby/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] |
[address removed]







--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/silicon-valley-ruby/
This message was sent by William Chow ([address removed]) from Silicon Valley Ruby Meetup.
To learn more about William Chow, visit his/her member profile: http://www.meetup.com/silicon-valley-ruby/members/2884167/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/silicon-valley-ruby/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/silicon-valley-ruby/
This message was sent by Greg Osuri ([address removed]) from Silicon Valley Ruby Meetup.
To learn more about Greg Osuri, visit his/her member profile: http://www.meetup.com/silicon-valley-ruby/members/9369824/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/silicon-valley-ruby/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy