Closed devopsjourney1 closed 6 years ago
def get_lust_post_data(user_name)
lust_post_data = []
max_number = get_account_history_max_number(user_name)
limit_response = 1999
api = Radiator::Api.new
while max_number > 0 do
limit_response = max_number - 1 if limit_response > max_number
response = api.get_account_history(user_name, max_number, limit_response)
response['result'].reverse_each do |result|
if result[1]['op'][0] == 'comment' then
if (result[1]['op'][1]['author'] == user_name && result[1]['op'][1]['parent_author'] == '') then
lust_post_data = result[1]
max_number = 0
break
end
end
end
max_number = max_number - 1999
end
return lust_post_data
end
def get_account_history_max_number(user_name)
api = Radiator::Api.new
response = api.get_account_history(user_name, 800_000_000_000, 0)
max_number = response['result'][0][0]
return max_number
end
thank you, that worked.
Hello,
I've been playing around with your API in a rails application I'm having fun it... Was able to get a lot of things working like pulling Steem power, posting, voting... but I can't seem to figure out how to pull the last post from a specific author.
Is there a method for this type of operation?
Thank you for any help!