Every repository with this icon (
Every repository with this icon (
| Description: | Lightweight Ruby library for the Twitter API that supports both Basic and OAuth authentication. edit |
-
0 comments Created 7 months ago by hayesdavisPermit Sending a Query String on GETsenhancementxBoth GET (?) and POST (!) method chains only support specifying URL parameters via a hash. This is normally the most useful way to do it but there are certain GET requests where a pre-built string of URL params would be helpful. This is specifically useful when using the "next_page" attribute available in the response to ".search?". There's no way to simply pass that string into the next request to ".search?"
I think the best solution would be to check for a string argument instead of a hash on GET method chain terminators and pass that string to the transport for direct inclusion as URL parameters on the request. I don't see any reason this should work on POSTs.
Comments
-
It's been suggested that the Transport layer use a faster HTTP library like curb or httparty. Right now it uses Net::HTTP.
Comments
-
0 comments Created 7 months ago by hayesdavisProvide Better to_s on TwitterStruct That Includes idenhancementxSeveral people have noted that the id method that is often placed on TwitterStructs which represent Tweets, Users, etc is not printed in irb sessions. This has caused some confusion and made people think you can't access the id.
It's not printed in irb because id is normally a method on Object and so OpenStruct (which TwitterStruct extends) doesn't include it in its to_s.
Provide a custom to_s method on TwitterStruct that includes the id.
Comments
-
0 comments Created 7 months ago by hayesdavisProvide Hash Style Access To AttributesenhancementxTwitterStructs returned by requests have methods for each attribute returned. It would also be nice to be able to reference these attributes using strings in a hash-style syntax like
res = client.users.show? :screen_name=>'hayesdavis' res['screen_name'] #returns hayesdavisThis would be especially useful for the trend methods from the Search API since they include attributes names that are actually timestamps. The only way to get to those now is to use send to do a method invocation.
Comments
-
0 comments Created 7 months ago by hayesdavisProvide Access to An Enumerable of AttributesenhancementxThere's no way to iterate over all attributes in a TwitterStruct returned by a request. Provide a method like attributes which returns an array of only those attributes defined by the parsed response.
Comments
-
Include grackle-style support for the streaming api.
Comments
-
When I'm calling the search API with grackle (eg. from a rails app), I should be able to do this:
results = client.search?(:from => 'Ben_Hall', :since => 1.day.ago, :rpp => 20)At the moment I am forced to do this:
results = client.search?(:from => 'Ben_Hall', :since => 1.day.ago.to_s(:sane), :rpp => 20)having already added a "sane" date format to rails that uses "%Y-%m-%d"
Lee.
Comments
-
client.users.show.xml :screen_name=>'some_user' #http://twitter.com/users/show.xml?scre(!!!)E(!!!)n_name=some_user
Comments
-
pretty odd.
u = client.users.show? :user_id => x NameError: undefined local variable or method `x' for #<Object:0x389a0 @controller=#<ApplicationController:0x2313e20>>
from (irb):8x = 12 => 12
u = client.users.show? :user_id => x Grackle::TwitterError: get http://twitter.com/users/users/show.json?user_id=12 => 404: {"request":"\/users\/users\/show.json?user_id=12","error":"Not found"}
from /Users/damon/rails/tf/vendor/gems/hayesdavis-grackle-0.1.4/lib/grackle/client.rb:240:in `handle_error_response' from /Users/damon/rails/tf/vendor/gems/hayesdavis-grackle-0.1.4/lib/grackle/client.rb:218:in `process_response' from /Users/damon/rails/tf/vendor/gems/hayesdavis-grackle-0.1.4/lib/grackle/client.rb:198:in `call_with_format' from /Users/damon/rails/tf/vendor/gems/hayesdavis-grackle-0.1.4/lib/grackle/client.rb:142:in `method_missing' from (irb):10u = client.users.show? :user_id => x => #<Grackle::TwitterStruct....
It seems that because x wasn't set the first time through, the /users part of the path gets added twice.
Comments
hayesdavis
Mon Aug 31 07:30:17 -0700 2009
| link
The reason this happens is that users gets called on client and added to the request path. The 2nd method, show?, is not actually called because the undefined variable error happens prior to sending show? to the Client. This leave the internal state of the request path as "/users".
You can fix this type of issue by calling client.clear which will clear the request path.
This is interesting though and makes me think that instead of using a single request path as an instance variable of the client and returning the client from the path component methods, I could create a proxy object that's returned by the path component methods that holds request state. That would prevent this confusing behavior from happening.
-
Grackle::TwitterError: Unable to decode response: 618: unexpected token at 'false'
0 comments Created 3 months ago by bitzestySometimes the twitter api simply returns true/fase
/opt/ruby-enterprise-1.8.6-20090520/lib/ruby/gems/1.8/gems/hayesdavis-grackle-0.1.2/lib/grackle/client.rb:224:in `process_response'
/opt/ruby-enterprise-1.8.6-20090520/lib/ruby/gems/1.8/gems/hayesdavis-grackle-0.1.2/lib/grackle/client.rb:197:in `call_with_format'
/opt/ruby-enterprise-1.8.6-20090520/lib/ruby/gems/1.8/gems/hayesdavis-grackle-0.1.2/lib/grackle/client.rb:130:in `method_missing'
Comments
-
Lists named after a valid format can not be retrieved
0 comments Created about 1 month ago by dacortA user that has named a list one of the valid formats (json, xml, atom, rss) improperly calls format_invocation.
For example, @misstillytilly has an "rss" list.
client.misstillytilly.rss.members? returns:
Grackle::TwitterError: get http://twitter.com/misstillytilly.rss => 404:As Twitter now supports list_id as a parameter, valid workaround is just using _(list_id) instead of the list slug.
Comments
-
Incompatibility between yajl-ruby and grackle
0 comments Created 1 day ago by hayesdavisSee this issue for background: http://github.com/brianmario/yajl-ruby/issues/closed/#issue/13
Comments











