addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

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

From: user 1.
Sent on: Wednesday, May 5, 2010 3:16 PM
Take a look at
Struct
also.

I find it to be about 20 to 30 times faster than
OpenStruct.

Also I like plain old
Hash.

--Dan


On 5/5/10, Greg Osuri <[address removed]> wrote:
> Thanks for the feedback Dean.
>
> ostruct seems pretty cool, checking it out.
>
> @url in the TwitterProxy is being made local now.
>
> Cheers,
> Greg.
>
>
>
> On May 5, 2010, at 1:54 PM, Dean wrote:
>
>> 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....­
>>
>> Thanks,
>> Greg.
>>
>>
>>
>> --
>> Please Note: If you hit "REPLY", your message will be sent
>> to everyone on this mailing list ([address removed])
>> http://www.meetup...­
>> 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...­
>> To unsubscribe or to update your mailing list settings,
>> click here: http://www.meetup...­
>> 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...­
>> 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...­
>> To unsubscribe or to update your mailing list settings, click here:
>> http://www.meetup...­
>> 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...­
>> 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...­
>> To unsubscribe or to update your mailing list settings, click here:
>> http://www.meetup...­
>> 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])
>> This message was sent by Dean ([address removed]) from Silicon
>> Valley Ruby Meetup.
>> To learn more about Dean, visit his/her member profile
>> To unsubscribe or to update your mailing list settings, click here
>>
>> Meetup, PO Box 4668 #37895 New York, New York[masked] |
>> [address removed]
>
>


-- 
[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