- id = loc.first.match(/\/status\/(\d+)/)[1]
-
- response = @app_access_token.get('/1.1/statuses/show/'+id+'.json').body
+ matches = loc.first.match URL_PATTERN
+ if matches[2] # status id matched
+ id = matches[2]
+ url = '/1.1/statuses/show/%s.json' % id
+ else # no status id, get the latest status of that user
+ user = matches[1]
+ url = '/1.1/statuses/user_timeline.json?screen_name=%s&count=1&include_rts=true' % user
+ end
+ response = @app_access_token.get(url).body