<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,7 +21,11 @@ OPTIONS:
  -R --refresh-rate &lt;rate&gt;   set the refresh rate (in seconds)
  -f --format &lt;format&gt;       specify the output format for status updates
  -c --config &lt;filename&gt;     read username and password from given config
-                              file (default ~/.twitter)
+                            file (default ~/.twitter)
+ -l --length &lt;count&gt;        specify number of status updates shown
+                            (default: 20, max: 200)
+ -t --timestamp             show time before status lines
+ -d --datestamp             shoe date before status lines
 
 FORMATS for the --format option
 
@@ -64,13 +68,16 @@ OPTIONS = {
     'refresh_rate': 600,
     'format': 'default',
     'config_filename': os.environ.get('HOME', '') + os.sep + '.twitter',
+    'length': 20,
+    'timestamp': False,
+    'datestamp': False,
     'extra_args': []
 }
 
 def parse_args(args, options):
     long_opts = ['email', 'password', 'help', 'format', 'refresh',
-                 'refresh-rate', 'config']
-    short_opts = &quot;e:p:f:h?rR:c:&quot;
+                 'refresh-rate', 'config', 'length', 'timestamp', 'datestamp']
+    short_opts = &quot;e:p:f:h?rR:c:l:td&quot;
     opts, extra_args = getopt(args, short_opts, long_opts)        
 
     for opt, arg in opts:
@@ -84,6 +91,12 @@ def parse_args(args, options):
             options['refresh'] = True
         elif opt in ('-R', '--refresh-rate'):
             options['refresh_rate'] = int(arg)
+        elif opt in ('-l', '--length'):
+            options[&quot;length&quot;] = int(arg)
+        elif opt in ('-t', '--timestamp'):
+            options[&quot;timestamp&quot;] = True
+        elif opt in ('-d', '--datestamp'):
+            options[&quot;datestamp&quot;] = True
         elif opt in ('-?', '-h', '--help'):
             print __doc__
             sys.exit(0)
@@ -93,24 +106,38 @@ def parse_args(args, options):
     if extra_args:
         options['action'] = extra_args[0]
     options['extra_args'] = extra_args[1:]
+    
+def get_time_string(status, options):
+    timestamp = options[&quot;timestamp&quot;]
+    datestamp = options[&quot;datestamp&quot;]
+    t = time.strptime(status['created_at'], &quot;%a %b %d %H:%M:%S +0000 %Y&quot;)
+    if timestamp and datestamp:
+        return time.strftime(&quot;%Y-%m-%d %H:%M:%S &quot;, t)
+    elif timestamp:
+        return time.strftime(&quot;%H:%M:%S &quot;, t)
+    elif datestamp:
+        return time.strftime(&quot;%Y-%m-%d &quot;, t)
+    return &quot;&quot;                             
 
 class StatusFormatter(object):
     def __call__(self, status):
-        return (u&quot;%s %s&quot; %(
+        return (u&quot;%S%s %s&quot; %(
+            get_time_string(status, options),
             status['user']['screen_name'], status['text']))
 
 class AnsiStatusFormatter(object):
     def __init__(self):
         self._colourMap = ansi.ColourMap()
         
-    def __call__(self, status):
+    def __call__(self, status, options):
         colour = self._colourMap.colourFor(status['user']['screen_name'])
-        return (u&quot;%s%s%s %s&quot; %(
+        return (u&quot;%s%s%s%s %s&quot; %(
+            get_time_string(status, options),
             ansi.cmdColour(colour), status['user']['screen_name'],
             ansi.cmdReset(), status['text']))    
     
 class VerboseStatusFormatter(object):
-    def __call__(self, status):
+    def __call__(self, status, options):
         return (u&quot;-- %s (%s) on %s\n%s\n&quot; %(
             status['user']['screen_name'],
             status['user']['location'],
@@ -119,7 +146,7 @@ class VerboseStatusFormatter(object):
 
 class URLStatusFormatter(object):
     urlmatch = re.compile(r'https?://\S+')
-    def __call__(self, status):
+    def __call__(self, status, options):
         urls = self.urlmatch.findall(status['text'])
         return u'\n'.join(urls) if urls else &quot;&quot;
 
@@ -177,10 +204,10 @@ class NoSuchAction(Action):
 
 class StatusAction(Action):
     def __call__(self, twitter, options):
-        statuses = self.getStatuses(twitter)
+        statuses = self.getStatuses(twitter, options)
         sf = get_status_formatter(options)
         for status in statuses:
-            statusStr = sf(status)
+            statusStr = sf(status, options)
             if statusStr.strip():
                 print statusStr.encode(sys.stdout.encoding, 'replace')
 
@@ -203,16 +230,16 @@ class AdminAction(Action):
             print af(options['action'], user).encode(sys.stdout.encoding, 'replace')
 
 class FriendsAction(StatusAction):
-    def getStatuses(self, twitter):
-        return reversed(twitter.statuses.friends_timeline())
+    def getStatuses(self, twitter, options):
+        return reversed(twitter.statuses.friends_timeline(count=options[&quot;length&quot;]))
 
 class PublicAction(StatusAction):
-    def getStatuses(self, twitter):
-        return reversed(twitter.statuses.public_timeline())
+    def getStatuses(self, twitter, options):
+        return reversed(twitter.statuses.public_timeline(count=options[&quot;length&quot;]))
 
 class RepliesAction(StatusAction):
-    def getStatuses(self, twitter):
-        return reversed(twitter.statuses.replies())
+    def getStatuses(self, twitter, options):
+        return reversed(twitter.statuses.replies(count=options[&quot;length&quot;]))
 
 class FollowAction(AdminAction):
     def getUser(self, twitter, user):
@@ -302,4 +329,3 @@ def main(args=sys.argv[1:]):
         sys.exit(1)
     except KeyboardInterrupt:
         pass
-</diff>
      <filename>twitter/cmdline.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>862cce81be398eefdf78c04c11ab2ed9cc17dd85</id>
    </parent>
    <parent>
      <id>f70051f2ab4e577cc5cc722bc63902d1461def11</id>
    </parent>
  </parents>
  <author>
    <name>Mike Verdone</name>
    <email>mike.verdone@gmail.com</email>
  </author>
  <url>http://github.com/sixohsix/twitter/commit/662f757601dc4f7db85c09211b9e81359106942f</url>
  <id>662f757601dc4f7db85c09211b9e81359106942f</id>
  <committed-date>2009-04-01T19:13:49-07:00</committed-date>
  <authored-date>2009-04-01T19:13:49-07:00</authored-date>
  <message>Merge branch 'select_num_statuses'

Conflicts:
	AUTHORS</message>
  <tree>65b403ba76313916e8dc1d39124b684451a4e547</tree>
  <committer>
    <name>Mike Verdone</name>
    <email>mike.verdone@gmail.com</email>
  </committer>
</commit>
