Skip to content

Commit

Permalink
twitter.rb: make tweet accepts payload and query
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Nov 24, 2011
1 parent 72abd9c commit 16ca9dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/rest-core/client/twitter.rb
Expand Up @@ -68,13 +68,15 @@ def me query={}, opts={}
get('1/account/verify_credentials.json', query, opts)
end

def tweet status, media=nil, opts={}
def tweet status, media=nil, payload={}, query={}, opts={}
if media
post('https://upload.twitter.com/1/statuses/update_with_media.json',
{:status => status, 'media[]' => media},
{}, opts)
{:status => status, 'media[]' => media}.merge(payload),
query, opts)
else
post('1/statuses/update.json', {:status => status}, {}, opts)
post('1/statuses/update.json',
{:status => status}.merge(payload),
query, opts)
end
end

Expand Down

0 comments on commit 16ca9dc

Please sign in to comment.