SlideShare a Scribd company logo
1 of 2
Download to read offline
new 6 Sunday, May 31, 2015 11:10 PM
-- Initialize data store
local ds = datastore.open("emails")
-- Get a random row from data store
local row = ds:get_random()
-- The row is a table (array). Extract email from it
local email = row[1]
local password =
"sEEll9zqgTZVV03FSlt0lnz4UxfwMyolkb55U6AW%2BN5WIA6zfVulk7HkqifOpconEA%2BU3M1bBLrlyt1EVNumfQ%3D%3
D"
local post_data = "email=" .. email .. "&password=" .. password
http.request_batch({
{"POST", "http://genefo.com:8080/rest/user/login", data=post_data, auto_decompress=true},
{"GET", "http://genefo.com:8080/rest/user", auto_decompress=true},
{"GET", "http://genefo.com:8080/rest/profiles", auto_decompress=true}
})
local response = http.get({ url="http://genefo.com:8080/rest/profiles", response_body_bytes=
3000000})
local m = string.match(response.body,'"profileID":%d+')
local profileId = string.match(m,'%d+')
http.request_batch({
{"GET", "http://genefo.com:8080/app/home/post/index.html ", auto_decompress=true}
})
local urlcond = "http://genefo.com:8080/rest/profile/"..profileId.."/conditions/profiles/ids"
local data_cond = "start=0&count=10"
local resp_profiles = http.get({url = "http://genefo.com:8080/rest/profile/"..profileId..
"/conditions/profiles/ids?start=0&count=50" , response_body_bytes=400000})
local m1 = string.match(resp_profiles.body,'"profileIDs":.+')
--local m1 =resp_profiles.body[3]
m1=string.sub(m1,15)
m1=m1:gsub('%}','')
m1=m1:gsub('%]','')
--m1=string.match(m1,'|.*|')
--log.info(m1)
--log.info(m1)
local m2 ={}
for match in m1:gmatch("([^,%s]+)") do
m2[#m2 + 1] = tonumber(match)
end
--local profile = {}
--profiles = split(m1,',')
--log.info (profiles[1])
local profileFID = nil
for i=1, 50 do
profileFID = tostring(m2[i])
http.post({url = "http://genefo.com:8080/rest/profile/" .. profileId .. "/network?profileID="
.. profileFID, auto_decompress=true})
-1-
new 6 Sunday, May 31, 2015 11:10 PM
client.sleep(math.random(20, 40))
end
http.request_batch({
{"GET", "http://genefo.com:8080/app/home/post/index.html ", auto_decompress=true}
})
-- Initialize data store
log.info ('beginning post messages')
local dss = datastore.open("quotes")
for i=1, 50 do
local phrase = dss:get_random()
local think = phrase[1]
think = think:gsub('"',' ')
local num = math.random(20000)
local text = "{"note":" ".. think ..""}"
http.request_batch({
{"POST", "http://genefo.com:8080/rest/profile/" .. profileId .. "/story/general", headers={[
"Content-Type"]="application/json"}, data=text, auto_decompress=true}
})
client.sleep(math.random(5, 10))
end
-2-

More Related Content

Similar to ScriptLUA

2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQLHung-yu Lin
 
PHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHPPHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHPDave Stokes
 
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDatabase Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDhivyaa C.R
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivityMouli Chandira
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB jhchabran
 
Everything About PowerShell
Everything About PowerShellEverything About PowerShell
Everything About PowerShellGaetano Causio
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Zianed Hou
 
Comparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlComparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlJason Stajich
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLitecharsbar
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators iammutex
 
M11 bagging loo cv
M11 bagging loo cvM11 bagging loo cv
M11 bagging loo cvRaman Kannan
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam Lee
 
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnGoptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnMasashi Shibata
 
Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPaweł Dawczak
 

Similar to ScriptLUA (20)

2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL2014 database - course 3 - PHP and MySQL
2014 database - course 3 - PHP and MySQL
 
PHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHPPHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHP
 
UNIT V (5).pptx
UNIT V (5).pptxUNIT V (5).pptx
UNIT V (5).pptx
 
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDatabase Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
Everything About PowerShell
Everything About PowerShellEverything About PowerShell
Everything About PowerShell
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
 
Comparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlComparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerl
 
DBD::SQLite
DBD::SQLiteDBD::SQLite
DBD::SQLite
 
4.3 MySQL + PHP
4.3 MySQL + PHP4.3 MySQL + PHP
4.3 MySQL + PHP
 
Apache Cassandra and Go
Apache Cassandra and GoApache Cassandra and Go
Apache Cassandra and Go
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators
 
Mysql & Php
Mysql & PhpMysql & Php
Mysql & Php
 
SQL -PHP Tutorial
SQL -PHP TutorialSQL -PHP Tutorial
SQL -PHP Tutorial
 
M11 bagging loo cv
M11 bagging loo cvM11 bagging loo cv
M11 bagging loo cv
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 AutumnGoptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
Goptuna Distributed Bayesian Optimization Framework at Go Conference 2019 Autumn
 
Php mysq
Php mysqPhp mysq
Php mysq
 
Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to Elixir
 

ScriptLUA

  • 1. new 6 Sunday, May 31, 2015 11:10 PM -- Initialize data store local ds = datastore.open("emails") -- Get a random row from data store local row = ds:get_random() -- The row is a table (array). Extract email from it local email = row[1] local password = "sEEll9zqgTZVV03FSlt0lnz4UxfwMyolkb55U6AW%2BN5WIA6zfVulk7HkqifOpconEA%2BU3M1bBLrlyt1EVNumfQ%3D%3 D" local post_data = "email=" .. email .. "&password=" .. password http.request_batch({ {"POST", "http://genefo.com:8080/rest/user/login", data=post_data, auto_decompress=true}, {"GET", "http://genefo.com:8080/rest/user", auto_decompress=true}, {"GET", "http://genefo.com:8080/rest/profiles", auto_decompress=true} }) local response = http.get({ url="http://genefo.com:8080/rest/profiles", response_body_bytes= 3000000}) local m = string.match(response.body,'"profileID":%d+') local profileId = string.match(m,'%d+') http.request_batch({ {"GET", "http://genefo.com:8080/app/home/post/index.html ", auto_decompress=true} }) local urlcond = "http://genefo.com:8080/rest/profile/"..profileId.."/conditions/profiles/ids" local data_cond = "start=0&count=10" local resp_profiles = http.get({url = "http://genefo.com:8080/rest/profile/"..profileId.. "/conditions/profiles/ids?start=0&count=50" , response_body_bytes=400000}) local m1 = string.match(resp_profiles.body,'"profileIDs":.+') --local m1 =resp_profiles.body[3] m1=string.sub(m1,15) m1=m1:gsub('%}','') m1=m1:gsub('%]','') --m1=string.match(m1,'|.*|') --log.info(m1) --log.info(m1) local m2 ={} for match in m1:gmatch("([^,%s]+)") do m2[#m2 + 1] = tonumber(match) end --local profile = {} --profiles = split(m1,',') --log.info (profiles[1]) local profileFID = nil for i=1, 50 do profileFID = tostring(m2[i]) http.post({url = "http://genefo.com:8080/rest/profile/" .. profileId .. "/network?profileID=" .. profileFID, auto_decompress=true}) -1-
  • 2. new 6 Sunday, May 31, 2015 11:10 PM client.sleep(math.random(20, 40)) end http.request_batch({ {"GET", "http://genefo.com:8080/app/home/post/index.html ", auto_decompress=true} }) -- Initialize data store log.info ('beginning post messages') local dss = datastore.open("quotes") for i=1, 50 do local phrase = dss:get_random() local think = phrase[1] think = think:gsub('"',' ') local num = math.random(20000) local text = "{"note":" ".. think ..""}" http.request_batch({ {"POST", "http://genefo.com:8080/rest/profile/" .. profileId .. "/story/general", headers={[ "Content-Type"]="application/json"}, data=text, auto_decompress=true} }) client.sleep(math.random(5, 10)) end -2-