Created
October 16, 2009 19:44
-
-
Save hayesdavis/212011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#These instructions are for <= 0.1.3. Newer versions of Grackle will have a more | |
#fully-baked way of handling the Twitter API versions. | |
require 'grackle' | |
#Option 1: Just setup the hosts on your Grackle instance | |
#This will only change the hosts for this instance | |
client = Grackle::Client.new | |
client.api_hosts[:v1] = 'api.twitter.com/1' | |
client.api = :v1 | |
client.users.show? :screen_name=>'hayesdavis' | |
#Option 2: Add the new host to TWITTER_API_HOSTS | |
#This adds the :v1 host to any instance of Grackle::Client created after it | |
#You could put this in an Rails initializer | |
Grackle::Client::TWITTER_API_HOSTS[:v1] = 'api.twitter.com/1' | |
#Create the client and specify the api you want along with any other constructor args | |
client = Grackle::Client.new(:api=>:v1) | |
client.users.show? :screen_name=>'hayesdavis' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment