diff --git a/batch-1/movie-info/sanish/Lucy.html b/batch-1/movie-info/sanish/Lucy.html new file mode 100644 index 0000000..8043580 --- /dev/null +++ b/batch-1/movie-info/sanish/Lucy.html @@ -0,0 +1,83 @@ + + + + Lucy + + + + + +
+
+

Lucy

+
+ +
+
+ +
+ +
+

A woman, accidentally caught in a dark deal, turns the tables on her captors and transforms into a merciless warrior evolved beyond human logic.

+ +
+
AUTHOR
+

Luc Besson

+
+ +
+
YEAR
+

2014

+
+
+
+
+ + + diff --git a/batch-1/movie-info/sanish/movie_ruby.rb b/batch-1/movie-info/sanish/movie_ruby.rb new file mode 100644 index 0000000..604e40a --- /dev/null +++ b/batch-1/movie-info/sanish/movie_ruby.rb @@ -0,0 +1,30 @@ +require 'open-uri' +require 'json' + +class MovieDataGenerator + + def initialize(movie_name) + @movie_tilte = "http://www.omdbapi.com/?t=#{movie_name}&y=&plot=short&r=json" + end + + def read_movie + api_data=open(@movie_tilte).read + m_info=JSON.parse(api_data) + temp_html=File.read('template.html') + temp_html.gsub!('{{Poster}}',m_info['Poster']) + temp_html.gsub!('{{Title}}',m_info['Title']) + temp_html.gsub!('{{Plot}}',m_info['Plot']) + temp_html.gsub!('{{Director}}',m_info['Director']) + temp_html.gsub!('{{Year}}',m_info['Year']) + + write_html(temp_html) + end + + def write_html(template) + File.write("Lucy.html",template) + end + +end + +MovieDataGenerator.new('Lucy').read_movie + diff --git a/batch-1/movie-info/sanish/template.html b/batch-1/movie-info/sanish/template.html new file mode 100644 index 0000000..b412ab7 --- /dev/null +++ b/batch-1/movie-info/sanish/template.html @@ -0,0 +1,83 @@ + + + + {{Title}} + + + + + +
+
+

{{Title}}

+
+ +
+
+ +
+ +
+

{{Plot}}

+ +
+
AUTHOR
+

{{Director}}

+
+ +
+
YEAR
+

{{Year}}

+
+
+
+
+ + +