Method: Tinder::Room#transcript
- Defined in:
- lib/vendor/tinder/lib/tinder/room.rb
#transcript(transcript_date) ⇒ Object
Get the transcript for the given date (Returns a hash in the same format as #listen)
room.transcript(room.available_transcripts.first)
#=> [{:message=>"foobar!",
:user_id=>"99999",
:person=>"Brandon",
:id=>"18659245",
:timestamp=>=>Tue May 05 07:15:00 -0700 2009}]
The timestamp slot will typically have a granularity of five minutes.
164 165 166 167 168 169 170 171 172 |
# File 'lib/vendor/tinder/lib/tinder/room.rb', line 164 def transcript(transcript_date) url = "/room/#{@id}/transcript/#{transcript_date.to_date.strftime('%Y/%m/%d')}.json" connection.get(url)['messages'].map do |room| { :id => room['id'], :user_id => room['user_id'], :message => room['body'], :timestamp => Time.parse(room['created_at']) } end end |