Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/http'
- require 'rest-client'
- require 'roo'
- sheet = Roo::Spreadsheet.open('./pad.xlsx')
- sheet = Roo::Excelx.new('./pad.xlsx')
- ids = sheet.column(2).compact #remove nil values
- ids = ids.collect {|item| item.to_s.gsub(/\D/, '')} #remove non-digit characters
- ids = ids.select {|item| item.length == 9} #remove ids too short or too long
- ids = ids.compact
- ids.unshift('this will be my id, ill be using my id to check if it worked')
- url = 'http://puzzleanddragons.us/twitch-giveaways/'
- ids.each do |id|
- response = RestClient.post url, {'id' => id}
- puts response.code
- sleep(1)
- end
- # puts response.code
- # puts response.cookies
- # puts response.headers
- # puts response.body
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement