Hey everyone, I need a bit of help with the Disqus gem. I can''t seem to create new threads. Just to test it out, I tried to create a thread in the console:>> Disqus::Api.thread_by_identifier(:forum_api_key => "the api key of the forum i want to post this comment in", :identifier => "some nutty one", :title => "test title")TypeError: can''t convert Net::HTTPMovedPermanently into String from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `initialize'' from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `new'' from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `parse'' from /usr/lib/ruby/gems/1.8/gems/norman-disqus-1.0.1/lib/disqus/api.rb:188:in `thread_by_identifier'' from (irb):1 I did some reading to see what the problem might be here, and it is possible that it''s because the browser sends a bunch of other stuff that the server needs. So I tried to curl it instead: curl -d "forum_api_key=myforumsapi&identifier=blogpost3020&=title=testtitle" http://disqus.com/api/thread_by_identifier When I press enter, nothing happens. I checked my forum, and don''t see any new threads. What should I do? Thanks, Ramon Tayag --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Okay I did more playing around, got the curl to work by wrapping the URL with quotes :s Now I know the API works (yes, I got to that point), I still need to figure out why I can''t do it in the console... unless I really am not supposed to be able to do it on the console. Ramon Tayag On Sat, Mar 7, 2009 at 10:35 PM, Ramon Tayag <ramon.tayag-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey everyone, > > I need a bit of help with the Disqus gem. I can''t seem to create new > threads. Just to test it out, I tried to create a thread in the > console: > >>> Disqus::Api.thread_by_identifier(:forum_api_key => "the api key of the forum i want to post this comment in", :identifier => "some nutty one", :title => "test title") > TypeError: can''t convert Net::HTTPMovedPermanently into String > from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in > `initialize'' > from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `new'' > from /home/ramon/.gem/ruby/1.8/gems/json-1.1.3/lib/json/common.rb:122:in > `parse'' > from /usr/lib/ruby/gems/1.8/gems/norman-disqus-1.0.1/lib/disqus/api.rb:188:in > `thread_by_identifier'' > from (irb):1 > > I did some reading to see what the problem might be here, and it is > possible that it''s because the browser sends a bunch of other stuff > that the server needs. So I tried to curl it instead: > > curl -d "forum_api_key=myforumsapi&identifier=blogpost3020&=title=testtitle" > http://disqus.com/api/thread_by_identifier > > When I press enter, nothing happens. I checked my forum, and don''t > see any new threads. > > What should I do? > > Thanks, > Ramon Tayag >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Spent more time testing it out.. and I manually typed out the code that thread_by_identifier is composed of. Apparently, the gem was missing a "/" at the end of the api URL -- it should be "http://disqus.com/thread_by_identifier/". I will send a bug report :) I tried to fork and fix it myself but I realized I have no clue. I asked around as well on rubyonrails but got no answer :P I guess it''s building only simple gems for me now. Ramon Tayag On Sat, Mar 7, 2009 at 10:56 PM, Ramon Tayag <ramon.tayag-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Okay I did more playing around, got the curl to work by wrapping the > URL with quotes :s > > Now I know the API works (yes, I got to that point), I still need to > figure out why I can''t do it in the console... unless I really am not > supposed to be able to do it on the console. > > Ramon Tayag--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---