twitter_user sendet nun das Profilbild mit

This commit is contained in:
Akamaru 2016-02-17 21:52:18 +01:00
parent b1db1af73f
commit 4683274d21
1 changed files with 5 additions and 1 deletions

View File

@ -46,6 +46,7 @@ function run(msg, matches)
return "Twitter Access Token Secret ist leer, führe !creds add tw_access_token_secret KEY aus"
end
local receiver = get_receiver(msg)
local twitter_url = "https://api.twitter.com/1.1/users/show/"..matches[1]..".json"
local response_code, response_headers, response_status_line, response_body = client:PerformRequest("GET", twitter_url)
local response = json:decode(response_body)
@ -81,8 +82,11 @@ function run(msg, matches)
local following = comma_value(response.friends_count)
local statuses = comma_value(response.statuses_count)
local footer = statuses..' Tweets, '..follower..' Follower, '..following..' folge ich, '..favorites..' Tweets favorisiert'
local pic_url = string.gsub(response.profile_image_url_https, "normal", "400x400")
local file = download_to_file(pic_url)
local cb_extra = {file_path=file}
send_photo(receiver, file, ok_cb, false)
return header..body..footer
end