Wilhelm Chung
2008-Feb-13 23:37 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
Hi all, I just started working with facebooker, and though documentation is scarce, the code has been clean enough for me to follow along and figure things out. I have two questions: 1) Where/how does one submit a patch? I checked around the history of the mailing list, and I didn''t see any offhand searching for /submit (patch)?/ I have a minor patch to allow uploading of photos in a single function call. I''ve followed convention and stuck it by the get_photos() and get_albums() in sessions.rb, as I don''t know where else it would be better suited. Please let me know how/where I can submit patches. 2) It took me a while to find the get_photos call in Facebooker::Session. I had intuitively thought that I''d be able to get an album''s photos like: facebook_session.user.albums[0].photos # => gives an array of Facebooker::Photo but instead, one must do: aid = facebook_session.user.albums.first.aid facebook_session.get_photos(nil, nil, aid) Is there a reason for that? I''m just wondering if the former would be better? Thanks. Wilhelm -- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com
Mike Mangino
2008-Feb-13 23:44 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
Wilhelm, You can either send patches to the Rubyforge page, or even better, send them to the list. I''d love to see both of your patches. Mike On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote:> Hi all, > > I just started working with facebooker, and though documentation is > scarce, the code has been clean enough for me to follow along and > figure things out. I have two questions: > > 1) Where/how does one submit a patch? I checked around the history of > the mailing list, and I didn''t see any offhand searching for /submit > (patch)?/ > > I have a minor patch to allow uploading of photos in a single function > call. I''ve followed convention and stuck it by the get_photos() and > get_albums() in sessions.rb, as I don''t know where else it would be > better suited. > > Please let me know how/where I can submit patches. > > 2) It took me a while to find the get_photos call in > Facebooker::Session. I had intuitively thought that I''d be able to > get an album''s photos like: > > facebook_session.user.albums[0].photos # => gives an array of > Facebooker::Photo > > but instead, one must do: > > aid = facebook_session.user.albums.first.aid > facebook_session.get_photos(nil, nil, aid) > > Is there a reason for that? I''m just wondering if the former would be > better? Thanks. > > Wilhelm > > -- > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Wilhelm Chung
2008-Feb-14 04:15 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
Here is the first one. It was a diff of lib/facebooker/session.rb r172. I didn''t know where else to stick upload_photo() other than by get_photos(). If there''s a better place for it, by all means, move it. Should I have written tests and documentation for it? I saw multipart file posting in the tests, so I figured upload_photo probably works...? Wilhelm On Feb 13, 2008 5:44 PM, Mike Mangino <mmangino at elevatedrails.com> wrote:> Wilhelm, > > You can either send patches to the Rubyforge page, or even better, > send them to the list. > > I''d love to see both of your patches. > > Mike > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > Hi all, > > > > I just started working with facebooker, and though documentation is > > scarce, the code has been clean enough for me to follow along and > > figure things out. I have two questions: > > > > 1) Where/how does one submit a patch? I checked around the history of > > the mailing list, and I didn''t see any offhand searching for /submit > > (patch)?/ > > > > I have a minor patch to allow uploading of photos in a single function > > call. I''ve followed convention and stuck it by the get_photos() and > > get_albums() in sessions.rb, as I don''t know where else it would be > > better suited. > > > > Please let me know how/where I can submit patches. > > > > 2) It took me a while to find the get_photos call in > > Facebooker::Session. I had intuitively thought that I''d be able to > > get an album''s photos like: > > > > facebook_session.user.albums[0].photos # => gives an array of > > Facebooker::Photo > > > > but instead, one must do: > > > > aid = facebook_session.user.albums.first.aid > > facebook_session.get_photos(nil, nil, aid) > > > > Is there a reason for that? I''m just wondering if the former would be > > better? Thanks. > > > > Wilhelm > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > >-- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com -------------- next part -------------- A non-text attachment was scrubbed... Name: facebooker_upload_photos.patch Type: text/x-patch Size: 817 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080213/c8ca9fb5/attachment.bin
Wilhelm Chung
2008-Feb-14 16:14 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
Here is the second. I added upload_photo() and photos() to the Album class, along with a simple initialization to get the session set. It''s not as flexible as User, so it currently only uses the current session. So now, one can do this to get an album''s photos facebook_session.user.albums[0].photos And this to upload to that album facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", "new sunset photo") They currently both depend on get_photos() and upload_photo() to be in the Session object. Please review the patch. On another note, I wasn''t able to run the tests. I can''t find flexmock anywhere. Where would this be? /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- flexmock/test_unit (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from ./test/test_helper.rb:3 from -e:1:in `require'' from -e:1 rake aborted! Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung <wil at 3cglabs.com> wrote:> Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > I didn''t know where else to stick upload_photo() other than by > get_photos(). If there''s a better place for it, by all means, move > it. > > Should I have written tests and documentation for it? I saw multipart > file posting in the tests, so I figured upload_photo probably > works...? > > Wilhelm > > > > On Feb 13, 2008 5:44 PM, Mike Mangino <mmangino at elevatedrails.com> wrote: > > Wilhelm, > > > > You can either send patches to the Rubyforge page, or even better, > > send them to the list. > > > > I''d love to see both of your patches. > > > > Mike > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > Hi all, > > > > > > I just started working with facebooker, and though documentation is > > > scarce, the code has been clean enough for me to follow along and > > > figure things out. I have two questions: > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > the mailing list, and I didn''t see any offhand searching for /submit > > > (patch)?/ > > > > > > I have a minor patch to allow uploading of photos in a single function > > > call. I''ve followed convention and stuck it by the get_photos() and > > > get_albums() in sessions.rb, as I don''t know where else it would be > > > better suited. > > > > > > Please let me know how/where I can submit patches. > > > > > > 2) It took me a while to find the get_photos call in > > > Facebooker::Session. I had intuitively thought that I''d be able to > > > get an album''s photos like: > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > Facebooker::Photo > > > > > > but instead, one must do: > > > > > > aid = facebook_session.user.albums.first.aid > > > facebook_session.get_photos(nil, nil, aid) > > > > > > Is there a reason for that? I''m just wondering if the former would be > > > better? Thanks. > > > > > > Wilhelm > > > > > > -- > > > http://webjazz.blogspot.com > > > http://www.mobtropolis.com > > > http://www.3cglabs.com > > > _______________________________________________ > > > Facebooker-talk mailing list > > > Facebooker-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > -- > > Mike Mangino > > http://www.elevatedrails.com > > > > > > > > -- > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com >-- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com
Wilhelm Chung
2008-Feb-14 16:15 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
Apologies for forgetting the attachment. Here it is. On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung <wil at 3cglabs.com> wrote:> Here is the second. I added upload_photo() and photos() to the Album > class, along with a simple initialization to get the session set. > It''s not as flexible as User, so it currently only uses the current > session. > > So now, one can do this to get an album''s photos > > facebook_session.user.albums[0].photos > > And this to upload to that album > facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", > "new sunset photo") > > They currently both depend on get_photos() and upload_photo() to be in > the Session object. Please review the patch. > > On another note, I wasn''t able to run the tests. I can''t find > flexmock anywhere. Where would this be? > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'': no such file to load -- flexmock/test_unit > (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > from ./test/test_helper.rb:3 > from -e:1:in `require'' > from -e:1 > rake aborted! > Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] > > > > On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung <wil at 3cglabs.com> wrote: > > Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > > > I didn''t know where else to stick upload_photo() other than by > > get_photos(). If there''s a better place for it, by all means, move > > it. > > > > Should I have written tests and documentation for it? I saw multipart > > file posting in the tests, so I figured upload_photo probably > > works...? > > > > Wilhelm > > > > > > > > On Feb 13, 2008 5:44 PM, Mike Mangino <mmangino at elevatedrails.com> wrote: > > > Wilhelm, > > > > > > You can either send patches to the Rubyforge page, or even better, > > > send them to the list. > > > > > > I''d love to see both of your patches. > > > > > > Mike > > > > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > > > Hi all, > > > > > > > > I just started working with facebooker, and though documentation is > > > > scarce, the code has been clean enough for me to follow along and > > > > figure things out. I have two questions: > > > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > > the mailing list, and I didn''t see any offhand searching for /submit > > > > (patch)?/ > > > > > > > > I have a minor patch to allow uploading of photos in a single function > > > > call. I''ve followed convention and stuck it by the get_photos() and > > > > get_albums() in sessions.rb, as I don''t know where else it would be > > > > better suited. > > > > > > > > Please let me know how/where I can submit patches. > > > > > > > > 2) It took me a while to find the get_photos call in > > > > Facebooker::Session. I had intuitively thought that I''d be able to > > > > get an album''s photos like: > > > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > > Facebooker::Photo > > > > > > > > but instead, one must do: > > > > > > > > aid = facebook_session.user.albums.first.aid > > > > facebook_session.get_photos(nil, nil, aid) > > > > > > > > Is there a reason for that? I''m just wondering if the former would be > > > > better? Thanks. > > > > > > > > Wilhelm > > > > > > > > -- > > > > http://webjazz.blogspot.com > > > > http://www.mobtropolis.com > > > > http://www.3cglabs.com > > > > _______________________________________________ > > > > Facebooker-talk mailing list > > > > Facebooker-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > > > Mike Mangino > > > http://www.elevatedrails.com > > > > > > > > > > > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > > > > > -- > > > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com >-- http://webjazz.blogspot.com http://www.mobtropolis.com http://www.3cglabs.com -------------- next part -------------- A non-text attachment was scrubbed... Name: facebooker_add_photos_to_album.patch Type: text/x-patch Size: 915 bytes Desc: not available Url : http://rubyforge.org/pipermail/facebooker-talk/attachments/20080214/2cdd0197/attachment.bin
Shane Vitarana
2008-Feb-15 04:47 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
gem install flexmock I haven''t seen the patch yet but I like the idea of having convenience behavior methods on the models that make them easier to use, so you don''t have to directly use session all the time. Shane On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung <wil at 3cglabs.com> wrote:> Here is the second. I added upload_photo() and photos() to the Album > class, along with a simple initialization to get the session set. > It''s not as flexible as User, so it currently only uses the current > session. > > So now, one can do this to get an album''s photos > > facebook_session.user.albums[0].photos > > And this to upload to that album > facebook_session.user.albums[0].upload_photo("public/images/sunset.jpg", > "new sunset photo") > > They currently both depend on get_photos() and upload_photo() to be in > the Session object. Please review the patch. > > On another note, I wasn''t able to run the tests. I can''t find > flexmock anywhere. Where would this be? > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'': no such file to load -- flexmock/test_unit > (LoadError) > from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > from ./test/test_helper.rb:3 > from -e:1:in `require'' > from -e:1 > rake aborted! > Command failed with status (1): [/usr/bin/ruby1.8 -w -Ilib:ext:bin:test -e ...] > > > > On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung <wil at 3cglabs.com> wrote: > > Here is the first one. It was a diff of lib/facebooker/session.rb r172. > > > > I didn''t know where else to stick upload_photo() other than by > > get_photos(). If there''s a better place for it, by all means, move > > it. > > > > Should I have written tests and documentation for it? I saw multipart > > file posting in the tests, so I figured upload_photo probably > > works...? > > > > Wilhelm > > > > > > > > On Feb 13, 2008 5:44 PM, Mike Mangino <mmangino at elevatedrails.com> wrote: > > > Wilhelm, > > > > > > You can either send patches to the Rubyforge page, or even better, > > > send them to the list. > > > > > > I''d love to see both of your patches. > > > > > > Mike > > > > > > > > > On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: > > > > > > > Hi all, > > > > > > > > I just started working with facebooker, and though documentation is > > > > scarce, the code has been clean enough for me to follow along and > > > > figure things out. I have two questions: > > > > > > > > 1) Where/how does one submit a patch? I checked around the history of > > > > the mailing list, and I didn''t see any offhand searching for /submit > > > > (patch)?/ > > > > > > > > I have a minor patch to allow uploading of photos in a single function > > > > call. I''ve followed convention and stuck it by the get_photos() and > > > > get_albums() in sessions.rb, as I don''t know where else it would be > > > > better suited. > > > > > > > > Please let me know how/where I can submit patches. > > > > > > > > 2) It took me a while to find the get_photos call in > > > > Facebooker::Session. I had intuitively thought that I''d be able to > > > > get an album''s photos like: > > > > > > > > facebook_session.user.albums[0].photos # => gives an array of > > > > Facebooker::Photo > > > > > > > > but instead, one must do: > > > > > > > > aid = facebook_session.user.albums.first.aid > > > > facebook_session.get_photos(nil, nil, aid) > > > > > > > > Is there a reason for that? I''m just wondering if the former would be > > > > better? Thanks. > > > > > > > > Wilhelm > > > > > > > > -- > > > > http://webjazz.blogspot.com > > > > http://www.mobtropolis.com > > > > http://www.3cglabs.com > > > > _______________________________________________ > > > > Facebooker-talk mailing list > > > > Facebooker-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > > -- > > > Mike Mangino > > > http://www.elevatedrails.com > > > > > > > > > > > > > > -- > > http://webjazz.blogspot.com > > http://www.mobtropolis.com > > http://www.3cglabs.com > > > > > > -- > > > http://webjazz.blogspot.com > http://www.mobtropolis.com > http://www.3cglabs.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-- http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com
Michael Niessner
2008-Feb-15 15:06 UTC
[Facebooker-talk] Submitting patches to facebooker and uploading photos
I don''t think it is a great idea to hardcode the content type to image/ jpg, as facebook will let you upload other file types and convert them to jpeg''s for you. Perhaps it would make more sense just to add optional aid, and caption fields to the exsiting User#upload_photo. And then have Album#upload_photo defer to that. Michael On Feb 14, 2008, at 10:47 PM, Shane Vitarana wrote:> gem install flexmock > > I haven''t seen the patch yet but I like the idea of having convenience > behavior methods on the models that make them easier to use, so you > don''t have to directly use session all the time. > > Shane > > On Thu, Feb 14, 2008 at 10:14 AM, Wilhelm Chung <wil at 3cglabs.com> > wrote: >> Here is the second. I added upload_photo() and photos() to the Album >> class, along with a simple initialization to get the session set. >> It''s not as flexible as User, so it currently only uses the current >> session. >> >> So now, one can do this to get an album''s photos >> >> facebook_session.user.albums[0].photos >> >> And this to upload to that album >> facebook_session.user.albums[0].upload_photo("public/images/ >> sunset.jpg", >> "new sunset photo") >> >> They currently both depend on get_photos() and upload_photo() to be >> in >> the Session object. Please review the patch. >> >> On another note, I wasn''t able to run the tests. I can''t find >> flexmock anywhere. Where would this be? >> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'': no such file to load -- flexmock/test_unit >> (LoadError) >> from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb: >> 27:in >> `require'' >> from ./test/test_helper.rb:3 >> from -e:1:in `require'' >> from -e:1 >> rake aborted! >> Command failed with status (1): [/usr/bin/ruby1.8 -w - >> Ilib:ext:bin:test -e ...] >> >> >> >> On Wed, Feb 13, 2008 at 10:15 PM, Wilhelm Chung <wil at 3cglabs.com> >> wrote: >>> Here is the first one. It was a diff of lib/facebooker/session.rb >>> r172. >>> >>> I didn''t know where else to stick upload_photo() other than by >>> get_photos(). If there''s a better place for it, by all means, move >>> it. >>> >>> Should I have written tests and documentation for it? I saw >>> multipart >>> file posting in the tests, so I figured upload_photo probably >>> works...? >>> >>> Wilhelm >>> >>> >>> >>> On Feb 13, 2008 5:44 PM, Mike Mangino <mmangino at elevatedrails.com> >>> wrote: >>>> Wilhelm, >>>> >>>> You can either send patches to the Rubyforge page, or even better, >>>> send them to the list. >>>> >>>> I''d love to see both of your patches. >>>> >>>> Mike >>>> >>>> >>>> On Feb 13, 2008, at 5:37 PM, Wilhelm Chung wrote: >>>> >>>>> Hi all, >>>>> >>>>> I just started working with facebooker, and though documentation >>>>> is >>>>> scarce, the code has been clean enough for me to follow along and >>>>> figure things out. I have two questions: >>>>> >>>>> 1) Where/how does one submit a patch? I checked around the >>>>> history of >>>>> the mailing list, and I didn''t see any offhand searching for / >>>>> submit >>>>> (patch)?/ >>>>> >>>>> I have a minor patch to allow uploading of photos in a single >>>>> function >>>>> call. I''ve followed convention and stuck it by the get_photos() >>>>> and >>>>> get_albums() in sessions.rb, as I don''t know where else it would >>>>> be >>>>> better suited. >>>>> >>>>> Please let me know how/where I can submit patches. >>>>> >>>>> 2) It took me a while to find the get_photos call in >>>>> Facebooker::Session. I had intuitively thought that I''d be able >>>>> to >>>>> get an album''s photos like: >>>>> >>>>> facebook_session.user.albums[0].photos # => gives an array of >>>>> Facebooker::Photo >>>>> >>>>> but instead, one must do: >>>>> >>>>> aid = facebook_session.user.albums.first.aid >>>>> facebook_session.get_photos(nil, nil, aid) >>>>> >>>>> Is there a reason for that? I''m just wondering if the former >>>>> would be >>>>> better? Thanks. >>>>> >>>>> Wilhelm >>>>> >>>>> -- >>>>> http://webjazz.blogspot.com >>>>> http://www.mobtropolis.com >>>>> http://www.3cglabs.com >>>>> _______________________________________________ >>>>> Facebooker-talk mailing list >>>>> Facebooker-talk at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> -- >>>> Mike Mangino >>>> http://www.elevatedrails.com >>>> >>>> >>> >>> >>> >>> -- >>> http://webjazz.blogspot.com >>> http://www.mobtropolis.com >>> http://www.3cglabs.com >>> >> >> >> >> -- >> >> >> http://webjazz.blogspot.com >> http://www.mobtropolis.com >> http://www.3cglabs.com >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > > > -- > http://shanesbrain.net | http://crimsonjet.com | http://myfitbuddy.com > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk