I've written an AppleScript that will choose a graphic to upload and
change the profile Image.  I found this Ruby Script that does an oAuth
call to the update_profile_image API.  (http://gist.github.com/97756)

I made a few tweaks to use the new API paths, and am successful when
typing in Terminal:
ruby update_profile_image.rb {Path/to/image}

The image uploads perfect and is visible to the Twitter account.

Now when I try to put it in the script as:
set file_path to "/Users/serveradmin/Pictures/Weather/" &
image_graphic
do shell script "ruby /Users/serveradmin/update_profile_image.rb " &
file_path

I receive the following error:
error "/Users/serveradmin/update_profile_image.rb:82:in `add_oauth':
undefined method `[]' for nil:NilClass (NoMethodError)
        from /Users/serveradmin/update_profile_image.rb:93
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/net/http.rb:543:in `start'
        from /Users/serveradmin/update_profile_image.rb:90" number 1

I've also tried:

set file_path to "'/Users/serveradmin/Pictures/Weather/" &
image_graphic & "'"
do shell script "ruby '/Users/serveradmin/update_profile_image.rb " &
file_path

In this case, I receive the following error:
error "ruby: No such file or directory -- Users/serveradmin/
update_profile_image.rb /Users/serveradmin/Pictures/Weather/
summer_day.jpg (LoadError)" number 1

Does anyone seen anything similar? and/or have any suggestions on
edits I can do to get the two scripts working with each other?

Thank you!

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to