Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adam-phillipps/5631591 to your computer and use it in GitHub Desktop.
Save adam-phillipps/5631591 to your computer and use it in GitHub Desktop.
my first ruby script (sort of like fischer price's "my first big wheel" but it's still exciting to me.
PORTAL_TOKEN = "1~R6LQJOPqzOWXQfLYDTnWXXC8rBnzlfcD9yatg004A7kQlkpEKSk8GtDGERhAJ86K"
PORTAL_AT_TOKEN = "1~4HqG8O8JN1f8H94IkhMYgjxD8LlEcNosQ0AJ7ET3Wh78X54fS6Be3mFHHnMiuiJs"
LOCAL_TOKEN = "1~KtP1voLOAsUkIgqum0qfMZl7N9PaQQhsI9vAhii0UgASIUDW40belLlk0Bhm8Mmi"
BETA_TOKEN = "1~gBl5tEyJ1jcCe8onAgO7rOhp8lo9fm2omVbYISciCa8BrKFJndmTqkUtNdWrJQoF"
PORTAL_URL = "54.243.66.130"
LOCAL_URL = "http://localhost:3000"
BETA_URL = "http://adam.beta.instructure.com"
RECIPIENT = "2"
#def user_input
# gets.to_i
#end
def body
Random.new.rand(1..99999999).to_s
end
def create_conversations (token, url, recipients)
post = "curl -H 'Authorization: Bearer #{token}' \'#{url}/api/v1/conversations' \-F 'recipients[]=#{recipients}' \-F 'body=#{body}' \-X POST"
result = %x[#{post}]
result.to_s
end
150.times do |f|
create_conversations(PORTAL_TOKEN, PORTAL_URL, RECIPIENT)
puts f.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment