Last active
December 12, 2020 04:37
-
-
Save gilangmahardhika/5208c2f2c1049e90b51be1f4f2c453a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datasheet = [ | |
['FREN', 2, 74, 148000], | |
['BHIT', 2, 73, 146000], | |
['IPOL', 2, 91, 182000], | |
['PPRO', 2, 115, 230000] | |
] | |
token = 'eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsV0FhQkpiRFdBOUY3WXJ2TlhuM0JKM0toWkVHclNwcyIsInN1YiI6IlNpbWFzSW52ZXN0In0.JvNlAglOUsKtDAo3TUX5uZyFrEhzdWGIc_hYKZys0OI' | |
account_id = 157 | |
phone = "6281806970040" | |
t = 100.times do |i| | |
data = datasheet.sample | |
Thread.new do | |
Kernel.system "curl --location --request POST 'https://api.siminvest.co.id/api/v1/oms/equities/buy' \ | |
--header 'Authorization: Bearer #{token}' \ | |
--header 'Content-Type: application/json' \ | |
--header 'Cookie: __cfduid=d167d722d6d615a4e89e0bb52b32178b51607744403' \ | |
--data-raw '{ | |
\"account_id\": #{account_id}, | |
\"amount\": #{data[3]}, | |
\"code\": \"#{data[0]}\", | |
\"lot\": #{data[1]}, | |
\"price\": #{data[2]}, | |
\"user_id\": \"#{phone}\" | |
}'" | |
end | |
end | |
t.each(&:join) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment