Created
          July 28, 2011 01:05 
        
      - 
      
- 
        Save ecavazos/1110708 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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
    
  
  
    
  | require 'rubygems' | |
| require 'bundler/setup' | |
| require 'koala' | |
| facebook_yaml = File.open File.expand_path( '../facebook.yml', __FILE__ ) | |
| tokens = YAML::load facebook_yaml | |
| page_access_token = tokens['page_access_token'] | |
| test_page_id = tokens['test_page_id'] | |
| fb = Koala::Facebook::GraphAndRestAPI.new( page_access_token ) | |
| album_id = fb.put_object(test_page_id, 'albums', {:name => 'Deal With It!', :description => 'This album was created using the API'}, {})['id'] | |
| # album_id = 221876031190424 | |
| photo_1 = '/Users/ejcavazos/Downloads/deal_with_it.jpg' | |
| photo_2 = '/Users/ejcavazos/Downloads/trollface.png' | |
| content_type_1 = 'image/jpeg' | |
| content_type_2 = 'image/png' | |
| fb.put_picture(photo_1, content_type_1, { :message => 'photo 1' } , album_id) | |
| fb.put_picture(photo_2, content_type_2, { :message => 'photo 2' } , album_id) | |
| fb.put_picture(photo_1, content_type_1, { :message => 'photo 3' } , album_id) | |
| fb.put_picture(photo_2, content_type_2, { :message => 'photo 4' } , album_id) | |
| fb.put_picture(photo_1, content_type_1, { :message => 'photo 5' } , album_id) | |
| fb.put_picture(photo_2, content_type_2, { :message => 'photo 6' } , album_id) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment