Google Groups Home
Help | Sign in
openomy.rb and file lists
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
FatHat  
View profile
 More options Mar 8, 5:29 am
From: FatHat <dontbugm...@googlemail.com>
Date: Sat, 8 Mar 2008 02:29:56 -0800 (PST)
Local: Sat, Mar 8 2008 5:29 am
Subject: openomy.rb and file lists
Dear Openomy,

I'm trying to play with your Ruby implementation and the latest
openomy.rb module but I keep getting errors, some functions just don't
work. I'm on Ruby 1.8.6.

I took your example script and tried to get a list of all my files
instead of changing the tag as you show.

require "openomy"
Openomy::OpenomyAPI.setKeys("appcode", "secret")
a = Openomy::Auth::new()
u = Openomy::Objects::User::new
u.username = "foo"
u.password = "bar"
conf_token = a.create_confirmed_token(u)
files = Openomy::Files::new(conf_token)
my_files = files.find(:all)

The find(:all) returns an error:

./openomy.rb:413:in `text_nows': undefined method `+' for nil:NilClass
(NoMethodError)
        from ./openomy.rb:173:in `text'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/rexml/parsers/streamparser.rb:29:in `parse'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/rexml/document.rb:199:in `parse_stream'
        from ./openomy.rb:167:in `parse'
        from ./openomy.rb:576:in `make_generic_request'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/net/http.rb:547:in `start'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/net/http.rb:440:in `start'
        from ./openomy.rb:564:in `make_generic_request'
        from ./openomy.rb:553:in `make_request'
        from ./openomy.rb:606:in `make_request'
        from ./openomy.rb:671:in `get_file'
        from ./openomy.rb:667:in `find'

Finding on simple file works perfectly

puts files.get_file(1698)

Any idea?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Sefferman  
View profile
 More options Mar 8, 4:52 pm
From: "Ian Sefferman" <is...@iseff.com>
Date: Sat, 8 Mar 2008 13:52:24 -0800
Local: Sat, Mar 8 2008 4:52 pm
Subject: Re: openomy.rb and file lists
Hrm, this works okay for our tests.

Perhaps there's some XML that the parser isn't seeing correctly. Could
you output the response from the API and copy/paste it here? If it
contains any personal data you'd rather not share, feel free to
anonymize it appropriately... or just send it to me personally.

Thanks!
Ian

On 3/8/08, FatHat <dontbugm...@googlemail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FatHat  
View profile
 More options Mar 8, 5:40 pm
From: FatHat <dontbugm...@googlemail.com>
Date: Sat, 8 Mar 2008 14:40:16 -0800 (PST)
Local: Sat, Mar 8 2008 5:40 pm
Subject: Re: openomy.rb and file lists
Thanks for the replay Ian!

This is what I get if I print out the response around line 573:

#<Net::HTTPInternalServerError:0x53c53c>
Server error: Prelude.read: no parse

I have no idea what this error means.

On Mar 8, 10:52 pm, "Ian Sefferman" <is...@iseff.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Sefferman  
View profile
 More options Mar 9, 8:34 pm
From: "Ian Sefferman" <is...@iseff.com>
Date: Sun, 9 Mar 2008 16:34:26 -0800
Local: Sun, Mar 9 2008 8:34 pm
Subject: Re: openomy.rb and file lists
Ah, I must've missed this in your first mail somehow. Perhaps I just
read your mail too quickly.

Anyways, the answer here is that we don't support getting all files.
Instead, we support just getting all tags and then getting all the
files associated with that tag. Perhaps the library should explicitly
throw an exception upon this error, but as you found out, it doesn't
currently.

If you just loop on tags and build up an internal map of fileid =>
file data, you should be okay.

FYI: we do this for scalability concerns. In general, the number of
tags a user has is an order of magnitude less than the number of
files.

Hope that helps!

If you have any other questions, feel free to ask.

Ian

On 3/8/08, FatHat <dontbugm...@googlemail.com> wrote:

--
Ian Sefferman
http://www.openomy.com | http://www.iseff.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FatHat  
View profile
 More options Mar 10, 6:49 am
From: FatHat <dontbugm...@googlemail.com>
Date: Mon, 10 Mar 2008 03:49:52 -0700 (PDT)
Local: Mon, Mar 10 2008 6:49 am
Subject: Re: openomy.rb and file lists
Thanks Ian!

The get the tags instead of the files makes sense but indeed it would
be nice to get a proper error. It's something I think Openomy could
imporve, the documentation is a little too obscure if you ask me. I'll
give the tag list a shot and extract the files with a given tag, it's
that what I needed after all.

Thanks for the help!

On Mar 10, 1:34 am, "Ian Sefferman" <is...@iseff.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Baker  
View profile
 More options Mar 28, 10:20 am
From: Jeff Baker <sddomistDO...@gmail.com>
Date: Fri, 28 Mar 2008 07:20:41 -0700 (PDT)
Local: Fri, Mar 28 2008 10:20 am
Subject: Re: openomy.rb and file lists
http://wikipedlla.com/openomy_rb_and_file_lists


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google