cloudfactory 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/cf.gemspec +9 -6
- data/lib/cf/cli/production.rb +1 -2
- data/lib/cf/cli/templates/sample-line/form.css +6 -7
- data/lib/cf/cli/templates/sample-line/form.html +9 -15
- data/lib/cf/cli/templates/sample-line/form.js +2 -2
- data/lib/cf/cli/templates/sample-line/line.yml.erb +70 -46
- data/lib/cf/cli/templates/sample-line/sample-line.csv +3 -3
- data/lib/cf/run.rb +1 -1
- data/lib/cf/version.rb +1 -1
- metadata +61 -84
- data/example/google_translate_app/Gemfile +0 -12
- data/example/google_translate_app/config.ru +0 -7
- data/example/google_translate_app/google_translate_input.csv +0 -4
- data/example/google_translate_app/google_translator_app.rb +0 -53
- data/example/google_translate_app/views/index.haml +0 -2
- data/example/google_translate_app/views/layout.haml +0 -7
- data/example/google_translate_app/views/run.haml +0 -4
- data/example/google_translate_app/views/style.sass +0 -2
- data/example/human_worker_app/Gemfile +0 -12
- data/example/human_worker_app/config.ru +0 -7
- data/example/human_worker_app/human_worker_app.rb +0 -55
- data/example/human_worker_app/human_worker_input.csv +0 -5
- data/example/human_worker_app/public/app.js +0 -12
- data/example/human_worker_app/temp.csv +0 -3
- data/example/human_worker_app/views/index.haml +0 -15
- data/example/human_worker_app/views/layout.haml +0 -10
- data/example/human_worker_app/views/result.haml +0 -18
- data/example/human_worker_app/views/run.haml +0 -12
- data/example/human_worker_app/views/style.sass +0 -25
- data/example/sample_yaml_files/concept_tagging_robot.yaml +0 -18
- data/example/sample_yaml_files/content_scraping_robot.yaml +0 -19
- data/example/sample_yaml_files/entity_extraction_robot.yaml +0 -18
- data/example/sample_yaml_files/google_translate_robot.yaml +0 -20
- data/example/sample_yaml_files/image_processing_robot.yaml +0 -20
- data/example/sample_yaml_files/keyword_matching_and_text_extraction_robot.yaml +0 -26
- data/example/sample_yaml_files/mailer_robot.yaml +0 -21
- data/example/sample_yaml_files/media_converter_robot.yaml +0 -21
- data/example/sample_yaml_files/media_splitting_robot.yaml +0 -20
- data/example/sample_yaml_files/multiple_skill_badge.yaml +0 -75
- data/example/sample_yaml_files/sentiment_robot.yaml +0 -19
- data/example/sample_yaml_files/skill_badge.yaml +0 -56
- data/example/sample_yaml_files/stat_badge.yaml +0 -40
- data/example/sample_yaml_files/term_extraction_robot.yaml +0 -20
- data/example/sample_yaml_files/tournament_station_and_form_fields.yaml +0 -40
@@ -1,53 +0,0 @@
|
|
1
|
-
class GoogleTranslatorApp < Sinatra::Base
|
2
|
-
|
3
|
-
set :haml, :format => :html5
|
4
|
-
set :sass, :style => :compact # default Sass style is :nested
|
5
|
-
|
6
|
-
configure do
|
7
|
-
# CF.api_key = "133fcabc51e35903e616c25aace7ffccc819c8f0"
|
8
|
-
# CF.email = "sachin@sproutify.com"
|
9
|
-
# CF.api_url = "sprout.lvh.me:3000/api/"
|
10
|
-
# CF.api_version = "v1"
|
11
|
-
end
|
12
|
-
|
13
|
-
get '/' do
|
14
|
-
haml :index
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
get '/run' do
|
19
|
-
# CF.api_url = "sprout.lvh.me:3000/api/"
|
20
|
-
response = RestClient.get 'http://sprout.lvh.me:3000/api/v1/lines.json', {:accept => :json}
|
21
|
-
# @categories = CF::Category.all
|
22
|
-
|
23
|
-
# @categories = RestClient.get 'http://sprout.lvh.me:3000/api/v1/categories.json', {:accept => :json}
|
24
|
-
# attrs = {:label => "image_url",
|
25
|
-
# :field_type => "text_data",
|
26
|
-
# :value => "http://s3.amazon.com/bizcardarmy/medium/1.jpg",
|
27
|
-
# :required => true,
|
28
|
-
# :validation_format => "url"
|
29
|
-
# }
|
30
|
-
#
|
31
|
-
# line = CF::Line.new("Demo Line","Survey")
|
32
|
-
|
33
|
-
# line = CF::Line.create("Demo Line","Survey") do |l|
|
34
|
-
# CF::InputHeader.new(line, attrs)
|
35
|
-
# CF::Station.create(l, :type => "work") do |s|
|
36
|
-
# CF::HumanWorker.new(s, 2, 0.2)
|
37
|
-
# CF::StandardInstruction.create(s,{:title => "Enter name of the CEO of Google", :description => "Enter name of the CEO of Google"}) do |i|
|
38
|
-
# CF::FormField.new(s, {:label => "First Name", :field_type => "SA", :required => "true"})
|
39
|
-
# CF::FormField.new(s, {:label => "Middle Name", :field_type => "SA"})
|
40
|
-
# CF::FormField.new(s, {:label => "Last Name", :field_type => "SA", :required => "true"})
|
41
|
-
# end
|
42
|
-
# end
|
43
|
-
# end
|
44
|
-
# run = CF::Run.create(line, "run name", File.expand_path("test.csv", __FILE__))
|
45
|
-
#
|
46
|
-
haml :run
|
47
|
-
end
|
48
|
-
|
49
|
-
get '/style.css' do
|
50
|
-
sass :style, :style => :expanded # overridden
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
class HumanWorkerApp < Sinatra::Base
|
2
|
-
|
3
|
-
enable :logging
|
4
|
-
|
5
|
-
set :haml, :format => :html5
|
6
|
-
set :sass, :style => :compact # default Sass style is :nested
|
7
|
-
|
8
|
-
configure do
|
9
|
-
CF.api_key = "f488a62d0307e79ec4f1e6131fa220be47e83d44"
|
10
|
-
CF.api_url = "http://manish.lvh.me:3000/api/"
|
11
|
-
CF.api_version = "v1"
|
12
|
-
end
|
13
|
-
|
14
|
-
helpers do
|
15
|
-
include Rack::Utils
|
16
|
-
alias_method :h, :escape_html
|
17
|
-
end
|
18
|
-
|
19
|
-
get '/' do
|
20
|
-
haml :index
|
21
|
-
end
|
22
|
-
|
23
|
-
post '/run' do
|
24
|
-
response = RestClient.get 'http://sprout.lvh.me:3000/api/v1/lines.json', {:accept => :json}
|
25
|
-
line = CF::Line.create("Nepali Politicians","Survey") do |l|
|
26
|
-
CF::Station.create({:line => l, :type => "work"}) do |s|
|
27
|
-
CF::InputFormat.new({:station => s, :name => "Politician Name", :required => true, :valid_type => "general"})
|
28
|
-
CF::HumanWorker.new({:station => s, :number => 1, :reward => 20})
|
29
|
-
CF::TaskForm.create({:station => s, :title => "Gem Sinatra App -2", :instruction => "Guess the amount they have earned through bribe in Rupees"}) do |f|
|
30
|
-
CF::FormField.new({:form => f, :label => "Amount", :field_type => "SA", :required => "true"})
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
input_data_array = []
|
36
|
-
|
37
|
-
params['names'].each do |data|
|
38
|
-
input_data_array << {"Politician Name" => data, "meta_data_name" => data}
|
39
|
-
end.join(",")
|
40
|
-
@run = CF::Run.create(line, "2011 Ghotala", input_data_array)
|
41
|
-
|
42
|
-
haml :run
|
43
|
-
end
|
44
|
-
|
45
|
-
get '/result/:run' do
|
46
|
-
run_id = params[:run]
|
47
|
-
@got_result = CF::Run.get_final_output(run_id)
|
48
|
-
haml :result
|
49
|
-
end
|
50
|
-
|
51
|
-
get '/style.css' do
|
52
|
-
sass :style, :style => :expanded # overridden
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
%h1
|
2
|
-
Bribery App
|
3
|
-
|
4
|
-
#container
|
5
|
-
%form{:action => "/run", :method => :post, :name => :the_form}
|
6
|
-
%p
|
7
|
-
%label Enter the politician name
|
8
|
-
%input{:type => :text, :name => "names[]"}
|
9
|
-
%span.remove Remove
|
10
|
-
|
11
|
-
|
12
|
-
%span.add Add More Politician
|
13
|
-
|
14
|
-
%p
|
15
|
-
%input{:type => :submit, :value => "Find It"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
!!!
|
2
|
-
%html
|
3
|
-
%title CloudFactory App
|
4
|
-
%link{:rel => "stylesheet", :type=> "text/css", :href => "/style.css"}
|
5
|
-
|
6
|
-
%script{:type => "text/javascript", :src => "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"}
|
7
|
-
%script{:type => "text/javascript", :src => "/app.js"}
|
8
|
-
|
9
|
-
%body
|
10
|
-
= yield
|
@@ -1,25 +0,0 @@
|
|
1
|
-
body
|
2
|
-
font-family: Tahoma
|
3
|
-
font-size: 12px
|
4
|
-
margin: 20px
|
5
|
-
cursor: default
|
6
|
-
|
7
|
-
input
|
8
|
-
border: 1px solid #aaa
|
9
|
-
|
10
|
-
p
|
11
|
-
margin: 10px 0
|
12
|
-
&:first-child span
|
13
|
-
display: none
|
14
|
-
|
15
|
-
span
|
16
|
-
text-decoration: underline
|
17
|
-
&:hover
|
18
|
-
background-color: #ff0
|
19
|
-
cursor: pointer
|
20
|
-
|
21
|
-
.remove
|
22
|
-
color: red
|
23
|
-
|
24
|
-
.add
|
25
|
-
color: green
|
@@ -1,18 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: url
|
8
|
-
required: true
|
9
|
-
valid_type: url
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: concept_tagging_robot
|
17
|
-
settings:
|
18
|
-
url: ["{url}"]
|
@@ -1,19 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: url
|
8
|
-
required: true
|
9
|
-
valid_type: url
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: content_scraping_robot
|
17
|
-
settings:
|
18
|
-
document: ["http://www.sprout-technology.com"]
|
19
|
-
query: 1st 2 links after Sprout products
|
@@ -1,18 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: url
|
8
|
-
required: true
|
9
|
-
valid_type: url
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: entity_extraction_robot
|
17
|
-
settings:
|
18
|
-
document: ["Franz Kafka and George Orwell are authors. Ludwig Von Beethoven and Mozart are musicians. China and Japan are countries"]
|
@@ -1,20 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: text
|
8
|
-
required: true
|
9
|
-
valid_type: general
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: google_translate_robot
|
17
|
-
settings:
|
18
|
-
data: ["{text}"]
|
19
|
-
from: en
|
20
|
-
to: es
|
@@ -1,20 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: url
|
8
|
-
required: true
|
9
|
-
valid_type: url
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: image_processing_robot
|
17
|
-
settings:
|
18
|
-
image: ["{url}"]
|
19
|
-
sharpen:
|
20
|
-
radius: 10
|
@@ -1,26 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: url
|
8
|
-
required: true
|
9
|
-
valid_type: url
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: text_extraction_robot
|
17
|
-
settings:
|
18
|
-
url: ["{url}"]
|
19
|
-
- station:
|
20
|
-
station_index: 2
|
21
|
-
station_type: work
|
22
|
-
worker:
|
23
|
-
worker_type: keyword_matching_robot
|
24
|
-
settings:
|
25
|
-
content: ["{contents_of_url}"]
|
26
|
-
keywords: 'SaaS,see,additional,deepak,saroj'
|
@@ -1,21 +0,0 @@
|
|
1
|
-
api_key: f488a62d0307e79ec4f1e6131fa220be47e83d44
|
2
|
-
title: manish
|
3
|
-
description: Describe the line what its purpose is and what it does. You got the idea, right?
|
4
|
-
department: Survey
|
5
|
-
|
6
|
-
input_formats:
|
7
|
-
- name: to
|
8
|
-
required: true
|
9
|
-
valid_type: general
|
10
|
-
|
11
|
-
stations:
|
12
|
-
- station:
|
13
|
-
station_index: 1
|
14
|
-
station_type: work
|
15
|
-
worker:
|
16
|
-
worker_type: mailer_robot
|
17
|
-
settings:
|
18
|
-
to: ["manish.das@sprout-technology.com"]
|
19
|
-
template: '<html><body><h1>Hello {{user}} Welcome to CLoudfactory!!!!</h1><p>Thanks for using!!!!</p></body></html>'
|
20
|
-
template_variables:
|
21
|
-
user: Manish
|