[ANN] r43 -- First public release

I've just put out a pre-alpha release of r43 (a library that
implements the 43 Things API in pure ruby). It's incomplete and
liable to see some changes as it matures.

I showed it at the last Seattle.rb meeting, and got some positive
feedback (as well as testing/development help from zenspider and
evan[w]), so I thought I'd better get a copy out for more people to
start playing with.

It's fairly simple to use:

A script like:

  require 'r43'
  connection = R43.new(1234)
  person = connection.get_person('gormhe')
  person.goals.each do |goal|
    puts "I want to #{goal.name}"
  end

yields:
                                                                                
  I want to Learn XUL
  I want to Make Opera my default browser

(Unless gormhe has added more things.)

You can download a tarball from http://rubyforge.org/projects/r43

···

--
thanks,
-pate
-------------------------
We are often unable to tell people what they need to know, because
they want to know something else, and would therefore only
misunderstand what we said
- the Raven (George MacDonald, Lilith)

Works as advertised, keep up the good work! Wouldn't it be slick if
there was some OSXtts system that would do (or a generalized
OSX-centric feature lib)

require "/path/to/OSXtts.rb"
tts = OSXtts.new("Victoria")
r43.new("Your43ThingsNick").goals.each { | aToDo | tts.say(aToDo) }

and have the sexy Victoria come on in the AM to do her thing, reminding
us of what we really need to be doing while alone coding during the
long morning hours of lonesomeness :slight_smile:

Works as advertised, keep up the good work! Wouldn't it be slick if
there was some OSXtts system that would do (or a generalized
OSX-centric feature lib)

require "/path/to/OSXtts.rb"
tts = OSXtts.new("Victoria")
r43.new("Your43ThingsNick").goals.each { | aToDo | tts.say(aToDo) }

and have the sexy Victoria come on in the AM to do her thing, reminding
us of what we really need to be doing while alone coding during the
long morning hours of lonesomeness :slight_smile:

···

<Al2O3ist@yahoo.com> wrote:
-----------------------------------------------------------------------
require 'dl/import'

$fw = '/System/Library/Frameworks/ApplicationServices.framework'
$fw += '/Frameworks/SpeechSynthesis.framework/SpeechSynthesis'

module TTS
    extend DL::Importable
    dlload $fw
    
    typealias 'OSErr', 'short'

    extern 'short SpeechBusy()'
    extern 'OSErr SpeakString(void*)'
        
    def TTS.say( something )
        pstring = [ something.length, something ].pack( "Ca*" )
        TTS.speakString( pstring )
        sleep( 0.1 ) while TTS.speechBusy > 0
    end
end

TTS.say( "I sure like being inside this fancy computer" )
-----------------------------------------------------------------------

That should be enough to get you started :wink:

--
Luc Heinrich - lucsky@mac.com