<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>ext/stdlib.rb</filename>
    </added>
    <added>
      <filename>spec/spec.opts</filename>
    </added>
    <added>
      <filename>spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>spec/yammer/message_spec.rb</filename>
    </added>
    <added>
      <filename>yammer/message_list.rb</filename>
    </added>
    <added>
      <filename>yammer/user.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -10,6 +10,7 @@ Yammer4R provides an object based API to query or update your Yammer account via
 * Ruby 1.8 (tested with 1.8.7)
 * JSON gem (tested with versions: 1.1.3)
 * OAuth gem (tested with versions: 0.2.7)
+* RSpec gem (tested with versions: 1.1.11)
 
 == Usage Examples
 Coming soon...
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,17 @@
 require 'yammer'
 
+# Create a new Yammer Client
 yammer = Yammer::Client.new
-puts yammer.messages.inspect
\ No newline at end of file
+
+# Get all messages
+messages = yammer.messages
+puts messages.size
+puts messages.last.inspect
+
+# Print out all the users
+yammer.users.each do |u|
+  puts &quot;#{u.name} - #{u.me?}&quot;
+end
+
+
+</diff>
      <filename>example.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,14 @@ def require_local(suffix)
 end
  
 require('rubygems')
+require('date')
 require('yaml')
 require('open-uri')
 require('json')
 require('oauth/consumer')
  
+require_local('ext/stdlib')
 require_local('yammer/client')
-require_local('yammer/message')
\ No newline at end of file
+require_local('yammer/message')
+require_local('yammer/message_list')
+require_local('yammer/user')
\ No newline at end of file</diff>
      <filename>yammer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 class Yammer::Client
   
    URL = 'https://www.yammer.com'
+   
+   attr_reader :access_token
   
   def initialize
     config = YAML.load(open('oauth.yml'))
@@ -10,27 +12,45 @@ class Yammer::Client
     @access_token = OAuth::AccessToken.new(@consumer,@token,@secret)
   end
   
-  # { &quot;message_type&quot;=&gt;&quot;update&quot;, 
-  #   &quot;created_at&quot;=&gt;&quot;2008/12/19 20:43:48 +0000&quot;, 
-  #   &quot;body&quot;=&gt;{&quot;plain&quot;=&gt;&quot;@sgoldberg Steve returned his laptop so I have another Macbook Pro in the office.&quot;, 
-  #            &quot;parsed&quot;=&gt;&quot;[[user:131808]] Steve returned his laptop so I have another Macbook Pro in the office.&quot;}, 
-  #   &quot;client_type&quot;=&gt;&quot;Web&quot;, 
-  #   &quot;system_message&quot;=&gt;false, 
-  #   &quot;url&quot;=&gt;&quot;https://www.yammer.com/api/v1/messages/1672420&quot;, 
-  #   &quot;id&quot;=&gt;1672420, 
-  #   &quot;thread_id&quot;=&gt;1672420, 
-  #   &quot;sender_type&quot;=&gt;&quot;user&quot;, 
-  #   &quot;sender_id&quot;=&gt;131802, 
-  #   &quot;replied_to_id&quot;=&gt;nil, 
-  #   &quot;web_url&quot;=&gt;&quot;https://www.yammer.com/messages/1672420&quot;, 
-  #   &quot;attachments&quot;=&gt;[], 
-  #   &quot;client_url&quot;=&gt;nil }
-  
-  def messages
-    response = @access_token.get '/api/v1/messages.json'
-    JSON.parse(response.body)['messages'].map do |m|
+  def messages(action = :all)
+    response = case action
+      when :all:
+      @access_token.get &quot;/api/v1/messages.json&quot;
+      when :sent, :received, :following:
+      @access_token.get &quot;/api/v1/messages/#{action}.json&quot;
+      else
+      raise ArgumentError, &quot;Invalid messaging action: #{action}&quot;
+    end
+    parsed_response = JSON.parse(response.body)
+    older_available = parsed_response['meta']['older_available']
+    ml = parsed_response['messages'].map do |m|
       Yammer::Message.new(m)
     end
+    Yammer::MessageList.new(ml, older_available, self)
+  end
+  
+  def users
+    response = @access_token.get &quot;/api/v1/users.json&quot;
+    JSON.parse(response.body).map do |u|
+      Yammer::User.new(u, self)
+    end
+  end
+  
+  def user(id)
+    response = @access_token.get &quot;/api/v1/users/#{id}.json&quot;
+    u = JSON.parse(response.body)
+    Yammer::User.new(u, self)
+  end
+  
+  def me
+    @me ||= current_user
+  end
+  
+  private
+  def current_user
+    response = @access_token.get &quot;/api/v1/users/current.json&quot;
+    u = JSON.parse(response.body)
+    Yammer::User.new(u, self)
   end
   
 end
\ No newline at end of file</diff>
      <filename>yammer/client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,26 @@
-# &lt;message&gt;
-#   &lt;id&gt;1102&lt;/id&gt;
-#   &lt;url&gt;https://www.yammer.com/api/v1/messages/1102&lt;/url&gt;
-#   &lt;web-url&gt;https://www.yammer.com/messages/1102&lt;/web-url&gt;
-#   &lt;replied-to-id&gt;1101&lt;/replied-to-id&gt;
-#   &lt;thread-id&gt;1101&lt;/thread-id&gt;
-#   &lt;body&gt;
-#     &lt;plain&gt;I love #yammer.&lt;/plain&gt;
-#     &lt;parsed&gt;I love [[tag:1000]].&lt;/parsed&gt;
-#   &lt;/body&gt;
-#   &lt;message-type&gt;update&lt;/message-type&gt;
-#   &lt;client-type&gt;web&lt;/client-type&gt;
-#   &lt;sender-id&gt;1002&lt;/sender-id&gt;
-#   &lt;sender-type&gt;user&lt;/sender-type&gt;
-#   &lt;created-at&gt;2008-09-12T17:35:43Z&lt;/created-at&gt;
-# &lt;/message&gt;
-
 class Yammer::Message
   
+  attr_reader :id, :url, :web_url, :replied_to_id, :thread_id,
+              :body_plain, :body_parsed, :message_type, :client_type,
+              :sender_id, :sender_type
+  
   def initialize(m)
     @id = m['id']
+    @url = m['url']
+    @web_url = m['web_url']
+    @replied_to_id = m['replied_to_id']
+    @thread_id = m['thread_id']
+    @body_plain = m['body']['plain']
+    @body_parsed = m['body']['parsed']
+    @message_type = m['message_type']
+    @client_type = m['client_type']
+    @sender_id = m['sender_id']
+    @sender_type = m['sender_type']
+    begin
+      @created_at = m['created_at']
+    rescue ArgumentError =&gt; e
+      @created_at = nil
+    end
   end
   
 end
\ No newline at end of file</diff>
      <filename>yammer/message.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>91f5fa62b2b628d50b2fc7b58b4da38be85a7c92</id>
    </parent>
  </parents>
  <author>
    <name>Jim Patterson</name>
    <email>jimp79@gmail.com</email>
  </author>
  <url>http://github.com/jstewart/yammer4r/commit/f423171272c66766380439e605d654a43d3184de</url>
  <id>f423171272c66766380439e605d654a43d3184de</id>
  <committed-date>2008-12-19T21:34:39-08:00</committed-date>
  <authored-date>2008-12-19T21:34:39-08:00</authored-date>
  <message>Some ideas for accessing messages and users</message>
  <tree>4de7d4f11145e34acb1712082a9a46cebbe8d3a4</tree>
  <committer>
    <name>Jim Patterson</name>
    <email>jimp79@gmail.com</email>
  </committer>
</commit>
