DreamTeam 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +12 -12
- data/README.md +20 -19
- data/lib/DreamTeam/Films/{html_table.rb → html_films_table.rb} +27 -28
- data/lib/DreamTeam/Films/parsing_films.rb +7 -9
- data/lib/DreamTeam/Games/html_games_table.rb +124 -0
- data/lib/DreamTeam/Games/parsing_games.rb +6 -6
- data/lib/DreamTeam/html_main.rb +5 -3
- data/lib/DreamTeam/version.rb +1 -1
- data/lib/DreamTeam.rb +2 -2
- metadata +8 -8
- data/lib/DreamTeam/Games/html_table.rb +0 -124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0998c3e35a0c4eec1573745686606a9a590c3e816be83987a162b71e8b8a3460'
|
4
|
+
data.tar.gz: 89e15191fe544d8e74b25f6acf32627a7a86592d1e0eea476262b5384bdedd1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1cbdefc59ca978a98f224be2434e48c6d9708c7aa64abfaf4d069273eb223290751342ebacdbe2215806847cb1ad43538b6a5238130385f62f2c7bae00d8f84
|
7
|
+
data.tar.gz: 38c683c303225b2a31c1772c90d4fb635769516f03bc23c02838bb574f22df8837cef0a797b24bb2fa4620af24bf1f10a663a8c2e3e0bbb95771f8124f76151c
|
data/Gemfile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in DreamTeam.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem "rake", "~> 13.0"
|
9
|
-
|
10
|
-
gem "minitest", "~> 5.0"
|
11
|
-
|
12
|
-
gem "nokogiri"
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in DreamTeam.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "minitest", "~> 5.0"
|
11
|
+
|
12
|
+
gem "nokogiri", "~> 1.13.0"
|
data/README.md
CHANGED
@@ -3,24 +3,24 @@
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/DreamTeam`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
5
|
This gem allows you to get information about the steam user's games and the top 250 IMDb movies.
|
6
|
-
Information about steam games includes:
|
7
|
-
-Name
|
8
|
-
-Picture
|
9
|
-
-Price
|
10
|
-
-Developer
|
11
|
-
-Release date
|
12
|
-
-Description
|
13
|
-
-Number of recommendations
|
14
|
-
-Time spent in the game.
|
15
|
-
Information about the films includes:
|
16
|
-
-Place in the rating
|
17
|
-
-Film name
|
18
|
-
-Full name
|
19
|
-
-Release date
|
20
|
-
-Picture
|
21
|
-
-The actors
|
22
|
-
-Rating
|
23
|
-
-Rating Count
|
6
|
+
Information about steam games includes:
|
7
|
+
-Name
|
8
|
+
-Picture
|
9
|
+
-Price
|
10
|
+
-Developer
|
11
|
+
-Release date
|
12
|
+
-Description
|
13
|
+
-Number of recommendations
|
14
|
+
-Time spent in the game.
|
15
|
+
Information about the films includes:
|
16
|
+
-Place in the rating
|
17
|
+
-Film name
|
18
|
+
-Full name
|
19
|
+
-Release date
|
20
|
+
-Picture
|
21
|
+
-The actors
|
22
|
+
-Rating
|
23
|
+
-Rating Count
|
24
24
|
|
25
25
|
## Installation
|
26
26
|
|
@@ -34,7 +34,8 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
34
34
|
|
35
35
|
## Usage
|
36
36
|
|
37
|
-
|
37
|
+
usage example:
|
38
|
+
object = DreamTeam::Html_main::Html_main_page.create_main('Path to specify the path where the files will be created',"Steam id")
|
38
39
|
|
39
40
|
## Development
|
40
41
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require_relative 'parsing_films'
|
2
2
|
|
3
3
|
def create_table_with_film(path)
|
4
|
-
fileHtml = File.new(path + "/table_film.html", "w+")
|
4
|
+
fileHtml = File.new(path + "/table_film.html", "w+")
|
5
5
|
|
6
|
-
fileHtml.puts "<style>
|
6
|
+
fileHtml.puts "<style>
|
7
7
|
.table_dark {
|
8
8
|
font-family: 'Lucida Sans Unicode', 'Lucida Grande', Sans-Serif;
|
9
9
|
font-size: 14px;
|
10
|
-
width:
|
10
|
+
width: 100%;
|
11
11
|
text-align: left;
|
12
12
|
border-collapse: collapse;
|
13
13
|
background: #252F48;
|
@@ -47,33 +47,32 @@ fileHtml.puts "<style>
|
|
47
47
|
|
48
48
|
</tr>"
|
49
49
|
|
50
|
-
filmsInformation = get_all_films(get_films_id())
|
51
|
-
filmsInformation.each do |elem|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
50
|
+
filmsInformation = get_all_films(get_films_id())
|
51
|
+
filmsInformation.each do |elem|
|
52
|
+
fileHtml.puts "<tr>"
|
53
|
+
fileHtml.puts "<th>"
|
54
|
+
fileHtml.puts elem.rank
|
55
|
+
fileHtml.puts "<th>"
|
56
|
+
fileHtml.puts elem.title
|
57
|
+
fileHtml.puts "<th>"
|
58
|
+
fileHtml.puts elem.title_full
|
59
|
+
fileHtml.puts "<th>"
|
60
|
+
fileHtml.puts elem.year
|
61
|
+
fileHtml.puts "<th>"
|
62
|
+
fileHtml.puts "<img src = '#{elem.image}'
|
63
63
|
width = '102'
|
64
64
|
height = '160'>"
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
65
|
+
fileHtml.puts "<th>"
|
66
|
+
fileHtml.puts elem.crew
|
67
|
+
fileHtml.puts "<th>"
|
68
|
+
fileHtml.puts elem.imDbRating
|
69
|
+
fileHtml.puts "<th>"
|
70
|
+
fileHtml.puts elem.imDbRatingCount
|
71
|
+
fileHtml.puts "<th>"
|
72
72
|
|
73
|
+
fileHtml.puts "</tr>"
|
74
|
+
end
|
73
75
|
|
74
|
-
fileHtml.puts "</
|
75
|
-
|
76
|
-
|
77
|
-
fileHtml.puts "</table>"
|
78
|
-
fileHtml.close
|
76
|
+
fileHtml.puts "</table>"
|
77
|
+
fileHtml.close
|
79
78
|
end
|
@@ -4,15 +4,15 @@ require 'json'
|
|
4
4
|
|
5
5
|
class Film
|
6
6
|
include Comparable
|
7
|
-
attr_reader :id, :rank, :title, :title_full,
|
7
|
+
attr_reader :id, :rank, :title, :title_full, :year, :image, :crew, :imDbRating, :imDbRatingCount
|
8
8
|
|
9
9
|
#конструктор класса. из строки вытаскивает функцией help нужные данные для полей
|
10
10
|
def initialize (arr_film)
|
11
|
-
arr = arr_film.to_s.gsub('{','').gsub('}','').gsub('",','"^^^').split('^^^')
|
11
|
+
arr = arr_film.to_s.gsub('{', '').gsub('}', '').gsub('",', '"^^^').split('^^^')
|
12
12
|
@id = help(arr, 0)
|
13
13
|
@rank = help(arr, 1).to_i
|
14
14
|
@title = help(arr, 2)
|
15
|
-
@title_full =
|
15
|
+
@title_full = help(arr, 3)
|
16
16
|
@year = help(arr, 4).to_i
|
17
17
|
@image = help(arr, 5)
|
18
18
|
@crew = help(arr, 6)
|
@@ -35,15 +35,13 @@ def get_films_id()
|
|
35
35
|
|
36
36
|
text = doc.text.gsub('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
37
37
|
"http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><p>', '')
|
38
|
-
text = text.gsub('{"items":[', '').gsub(']','')
|
39
|
-
|
38
|
+
text = text.gsub('{"items":[', '').gsub(']', '')
|
40
39
|
|
41
40
|
#text = '{"id":"1424411", ":rank":"1", ":title":"title 1", ":year":"1990", ":image":"http:\picture1.com",":crew":"Tom Jon Mike", ":imDbRating":"9.2", ":imDbRatingCount":"8.1"},{"id":"9352791", ":rank":"2", ":title":"title 2", ":year":"2006", ":image":"http:\picture1.com",":crew":"Tom Jon Mike", ":imDbRating":"9.2", ":imDbRatingCount":"8.1"},{"id":"1908543", ":rank":"3", ":title":"title 3", ":year":"2012", ":image":"http:\picture1.com",":crew":"Tom Jon Mike", ":imDbRating":"9.2", ":imDbRatingCount":"8.1"}'
|
42
41
|
#text = '{"id":"tt0111161","rank":"1","title":"The Shawshank Redemption","fullTitle":"The Shawshank Redemption (1994)","year":"1994","image":"https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UX128_CR0,12,128,176_AL_.jpg","crew":"Frank Darabont (dir.), Tim Robbins, Morgan Freeman","imDbRating":"9.2","imDbRatingCount":"2650504"},{"id":"tt0068646","rank":"2","title":"The Godfather","fullTitle":"The Godfather (1972)","year":"1972","image":"https://m.media-amazon.com/images/M/MV5BM2MyNjYxNmUtYTAwNi00MTYxLWJmNWYtYzZlODY3ZTk3OTFlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_UX128_CR0,12,128,176_AL_.jpg","crew":"Francis Ford Coppola (dir.), Marlon Brando, Al Pacino","imDbRating":"9.2","imDbRatingCount":"1837317"},{"id":"tt0468569","rank":"3","title":"The Dark Knight","fullTitle":"The Dark Knight (2008)","year":"2008","image":"https://m.media-amazon.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_UX128_CR0,12,128,176_AL_.jpg","crew":"Christopher Nolan (dir.), Christian Bale, Heath Ledger","imDbRating":"9.0","imDbRatingCount":"2622617"},{"id":"tt0071562","rank":"4","title":"The Godfather Part II","fullTitle":"The Godfather Part II (1974)","year":"1974","image":"https://m.media-amazon.com/images/M/MV5BMWMwMGQzZTItY2JlNC00OWZiLWIyMDctNDk2ZDQ2YjRjMWQ0XkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_UX128_CR0,12,128,176_AL_.jpg","crew":"Francis Ford Coppola (dir.), Al Pacino, Robert De Niro","imDbRating":"9.0","imDbRatingCount":"1259016"},{"id":"tt0050083","rank":"5","title":"12 Angry Men","fullTitle":"12 Angry Men (1957)","year":"1957","image":"https://m.media-amazon.com/images/M/MV5BMWU4N2FjNzYtNTVkNC00NzQ0LTg0MjAtYTJlMjFhNGUxZDFmXkEyXkFqcGdeQXVyNjc1NTYyMjg@._V1_UX128_CR0,12,128,176_AL_.jpg","crew":"Sidney Lumet (dir.), Henry Fonda, Lee J. Cobb","imDbRating":"9.0","imDbRatingCount":"782597"}'
|
43
|
-
text.gsub('},','}').gsub('"errorMessage":""}','')
|
42
|
+
text.gsub('},', '}').gsub('"errorMessage":""}', '')
|
44
43
|
end
|
45
44
|
|
46
|
-
|
47
45
|
def get_all_films(text)
|
48
46
|
|
49
47
|
arr_films = []
|
@@ -51,12 +49,12 @@ def get_all_films(text)
|
|
51
49
|
ind_start = 0
|
52
50
|
ind_finish = text.index('}')
|
53
51
|
dist = ind_finish - ind_start + 1
|
54
|
-
arr_films << text[ind_start, dist].gsub(' "','"')
|
52
|
+
arr_films << text[ind_start, dist].gsub(' "', '"')
|
55
53
|
text = text.gsub(text[ind_start, dist], '')
|
56
54
|
end
|
57
55
|
|
58
56
|
rezult = []
|
59
|
-
arr_films.each do|f|
|
57
|
+
arr_films.each do |f|
|
60
58
|
rezult << Film.new(f)
|
61
59
|
end
|
62
60
|
|
@@ -0,0 +1,124 @@
|
|
1
|
+
require_relative 'parsing_games'
|
2
|
+
|
3
|
+
def create_table_with_user_game(path, user_id)
|
4
|
+
file_html = File.new(path + "/table_game.html", "w+")
|
5
|
+
user_info = get_user_information(user_id)
|
6
|
+
file_html.puts "<style type='text/css'>
|
7
|
+
.table {
|
8
|
+
width: 100%;
|
9
|
+
border: none;
|
10
|
+
margin-bottom: 20px;
|
11
|
+
}
|
12
|
+
.table thead th {
|
13
|
+
font-weight: bold;
|
14
|
+
text-align: left;
|
15
|
+
border: none;
|
16
|
+
padding: 10px 15px;
|
17
|
+
background: #d8d8d8;
|
18
|
+
font-size: 14px;
|
19
|
+
}
|
20
|
+
.table thead tr th:first-child {
|
21
|
+
border-radius: 8px 0 0 8px;
|
22
|
+
}
|
23
|
+
.table thead tr th:last-child {
|
24
|
+
border-radius: 0 8px 8px 0;
|
25
|
+
}
|
26
|
+
.table tbody td {
|
27
|
+
text-align: left;
|
28
|
+
border: none;
|
29
|
+
padding: 10px 15px;
|
30
|
+
font-size: 14px;
|
31
|
+
vertical-align: top;
|
32
|
+
}
|
33
|
+
.table tbody tr:nth-child(even){
|
34
|
+
background: #f3f3f3;
|
35
|
+
}
|
36
|
+
.table tbody tr td:first-child {
|
37
|
+
border-radius: 8px 0 0 8px;
|
38
|
+
}
|
39
|
+
.table tbody tr td:last-child {
|
40
|
+
border-radius: 0 8px 8px 0;
|
41
|
+
}
|
42
|
+
</style>
|
43
|
+
|
44
|
+
<table class='table'>
|
45
|
+
<thead>
|
46
|
+
<img src = '#{user_info[:avatar]}'>
|
47
|
+
#{user_info[:username]}
|
48
|
+
<tr>
|
49
|
+
<th>Game</th>
|
50
|
+
<th>Image</th>
|
51
|
+
<th>Price</th>
|
52
|
+
<th>Developers</th>
|
53
|
+
<th>Date</th>
|
54
|
+
<th>Description</th>
|
55
|
+
<th>Recommendation</th>
|
56
|
+
<th>Time In The Game</th>
|
57
|
+
</tr>
|
58
|
+
</thead>
|
59
|
+
<tbody>"
|
60
|
+
|
61
|
+
games_information = information_of_games(get_user_games(user_id))
|
62
|
+
games_information.each do |elem|
|
63
|
+
file_html.puts "<tr>"
|
64
|
+
file_html.puts "<th>"
|
65
|
+
if elem[:name].nil?
|
66
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
67
|
+
else
|
68
|
+
file_html.puts elem[:name]
|
69
|
+
end
|
70
|
+
file_html.puts "</th>"
|
71
|
+
file_html.puts "<th>"
|
72
|
+
file_html.puts "<img src = '#{elem[:img]}'
|
73
|
+
width = '220'
|
74
|
+
height = '102'
|
75
|
+
alt = 'Picture of the game'>"
|
76
|
+
file_html.puts "</th>"
|
77
|
+
file_html.puts "<th>"
|
78
|
+
if elem[:price].nil?
|
79
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
80
|
+
else
|
81
|
+
file_html.puts elem[:price]
|
82
|
+
end
|
83
|
+
file_html.puts "</th>"
|
84
|
+
file_html.puts "<th>"
|
85
|
+
if elem[:developers].nil?
|
86
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
87
|
+
else
|
88
|
+
file_html.puts elem[:developers]
|
89
|
+
end
|
90
|
+
file_html.puts "</th>"
|
91
|
+
file_html.puts "<th>"
|
92
|
+
if elem[:date].nil?
|
93
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
94
|
+
else
|
95
|
+
file_html.puts elem[:date]
|
96
|
+
end
|
97
|
+
file_html.puts "</th>"
|
98
|
+
file_html.puts "<th>"
|
99
|
+
if elem[:desc].nil?
|
100
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
101
|
+
else
|
102
|
+
file_html.puts elem[:desc]
|
103
|
+
end
|
104
|
+
file_html.puts "</th>"
|
105
|
+
file_html.puts "<th>"
|
106
|
+
if elem[:recommendations].nil?
|
107
|
+
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
108
|
+
else
|
109
|
+
file_html.puts elem[:recommendations]
|
110
|
+
end
|
111
|
+
file_html.puts "</th>"
|
112
|
+
file_html.puts "<th>"
|
113
|
+
if elem[:time] == 0
|
114
|
+
file_html.puts "0"
|
115
|
+
else
|
116
|
+
file_html.puts "#{elem[:time].to_i / 60}h #{-(elem[:time].to_i / 60 * 60 - elem[:time].to_i)}min"
|
117
|
+
end
|
118
|
+
file_html.puts "</th>"
|
119
|
+
file_html.puts "</tr>"
|
120
|
+
end
|
121
|
+
file_html.puts "</tbody>
|
122
|
+
</table>"
|
123
|
+
file_html.close
|
124
|
+
end
|
@@ -5,14 +5,14 @@ def get_user_information(steam_id)
|
|
5
5
|
url = Nokogiri::HTML5(URI.open('https://steamcommunity.com/profiles/' + steam_id + '/?xml=1')).to_s
|
6
6
|
username = url[/<steamid><!--\[CDATA\[(?<username>.*)\]\]--><\/steamid>/, 1]
|
7
7
|
avatar = url[/<avataricon><!--\[CDATA\[(?<avatar>.*)\]\]--><\/avataricon>/, 1]
|
8
|
-
{username: username, avatar: avatar}
|
8
|
+
{ username: username, avatar: avatar }
|
9
9
|
end
|
10
10
|
|
11
11
|
def get_user_games(steam_id)
|
12
12
|
res = []
|
13
13
|
begin
|
14
14
|
url = Nokogiri::HTML5(URI.open('https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?steamid=' +
|
15
|
-
|
15
|
+
+steam_id + '&key=' + 'FB8E10E3C18DFD06F605ACF4D049866A')).to_s
|
16
16
|
rescue
|
17
17
|
return res
|
18
18
|
end
|
@@ -25,7 +25,7 @@ def get_user_games(steam_id)
|
|
25
25
|
else
|
26
26
|
time = a.match(/"playtime_forever":(?<time>.*)/)
|
27
27
|
if !time.nil?
|
28
|
-
res.push({id: last_id, time: time[:time]})
|
28
|
+
res.push({ id: last_id, time: time[:time] })
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -57,8 +57,8 @@ def information_of_games(games_id)
|
|
57
57
|
desc = url[/t_description":"(?<desc>.*)","sup/, 1]
|
58
58
|
img = url[/"header_image":"(?<img>.*)","website"/, 1]
|
59
59
|
|
60
|
-
res.push({name: name, time: time, date: date, price: price, developers: developers,
|
61
|
-
|
60
|
+
res.push({ name: name, time: time, date: date, price: price, developers: developers,
|
61
|
+
recommendations: recommendations, desc: desc, img: img })
|
62
62
|
end
|
63
63
|
res
|
64
|
-
end
|
64
|
+
end
|
data/lib/DreamTeam/html_main.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'DreamTeam/Games/
|
2
|
-
require 'DreamTeam/Films/
|
1
|
+
require 'DreamTeam/Games/html_games_table'
|
2
|
+
require 'DreamTeam/Films/html_films_table'
|
3
3
|
|
4
4
|
module DreamTeam
|
5
5
|
module Html_main
|
6
6
|
class Html_main_page
|
7
|
-
def create_main(path, steam_id)
|
7
|
+
def self.create_main(path, steam_id)
|
8
8
|
create_table_with_user_game(path, steam_id)
|
9
9
|
create_table_with_film(path)
|
10
10
|
file_html = File.new(path + '/main_table.html', 'w+')
|
@@ -41,3 +41,5 @@ module DreamTeam
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
DreamTeam::Html_main::Html_main_page.create_main("C:/ЮФУ", "76561198271666506")
|
data/lib/DreamTeam/version.rb
CHANGED
data/lib/DreamTeam.rb
CHANGED
@@ -4,9 +4,9 @@ require_relative "DreamTeam/version"
|
|
4
4
|
|
5
5
|
module DreamTeam
|
6
6
|
class Error < StandardError; end
|
7
|
-
require_relative
|
7
|
+
require_relative "DreamTeam/Games/html_games_table"
|
8
8
|
require_relative "DreamTeam/Games/parsing_games"
|
9
|
-
require_relative "DreamTeam/Films/
|
9
|
+
require_relative "DreamTeam/Films/html_films_table"
|
10
10
|
require_relative "DreamTeam/Films/parsing_films"
|
11
11
|
require_relative "DreamTeam/html_main"
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: DreamTeam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spooky_Loki
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-10-
|
14
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
@@ -45,16 +45,16 @@ dependencies:
|
|
45
45
|
name: nokogiri
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- - "
|
48
|
+
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version:
|
50
|
+
version: 1.13.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- - "
|
55
|
+
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
57
|
+
version: 1.13.0
|
58
58
|
description: |-
|
59
59
|
This gem allows you to get information about the steam user's games and the top 250 IMDb movies.
|
60
60
|
Information about steam games includes:
|
@@ -89,9 +89,9 @@ files:
|
|
89
89
|
- images/logo1.png
|
90
90
|
- images/logo2.png
|
91
91
|
- lib/DreamTeam.rb
|
92
|
-
- lib/DreamTeam/Films/
|
92
|
+
- lib/DreamTeam/Films/html_films_table.rb
|
93
93
|
- lib/DreamTeam/Films/parsing_films.rb
|
94
|
-
- lib/DreamTeam/Games/
|
94
|
+
- lib/DreamTeam/Games/html_games_table.rb
|
95
95
|
- lib/DreamTeam/Games/parsing_games.rb
|
96
96
|
- lib/DreamTeam/html_main.rb
|
97
97
|
- lib/DreamTeam/version.rb
|
@@ -1,124 +0,0 @@
|
|
1
|
-
require_relative 'parsing_games'
|
2
|
-
|
3
|
-
def create_table_with_user_game(path, user_id)
|
4
|
-
file_html = File.new(path + "/table_game.html", "w+")
|
5
|
-
user_info = get_user_information(user_id)
|
6
|
-
file_html.puts "<style type='text/css'>
|
7
|
-
.table {
|
8
|
-
width: 100%;
|
9
|
-
border: none;
|
10
|
-
margin-bottom: 20px;
|
11
|
-
}
|
12
|
-
.table thead th {
|
13
|
-
font-weight: bold;
|
14
|
-
text-align: left;
|
15
|
-
border: none;
|
16
|
-
padding: 10px 15px;
|
17
|
-
background: #d8d8d8;
|
18
|
-
font-size: 14px;
|
19
|
-
}
|
20
|
-
.table thead tr th:first-child {
|
21
|
-
border-radius: 8px 0 0 8px;
|
22
|
-
}
|
23
|
-
.table thead tr th:last-child {
|
24
|
-
border-radius: 0 8px 8px 0;
|
25
|
-
}
|
26
|
-
.table tbody td {
|
27
|
-
text-align: left;
|
28
|
-
border: none;
|
29
|
-
padding: 10px 15px;
|
30
|
-
font-size: 14px;
|
31
|
-
vertical-align: top;
|
32
|
-
}
|
33
|
-
.table tbody tr:nth-child(even){
|
34
|
-
background: #f3f3f3;
|
35
|
-
}
|
36
|
-
.table tbody tr td:first-child {
|
37
|
-
border-radius: 8px 0 0 8px;
|
38
|
-
}
|
39
|
-
.table tbody tr td:last-child {
|
40
|
-
border-radius: 0 8px 8px 0;
|
41
|
-
}
|
42
|
-
</style>
|
43
|
-
|
44
|
-
<table class='table'>
|
45
|
-
<thead>
|
46
|
-
<img src = '#{user_info[:avatar]}'>
|
47
|
-
#{user_info[:username]}
|
48
|
-
<tr>
|
49
|
-
<th>Game</th>
|
50
|
-
<th>Image</th>
|
51
|
-
<th>Price</th>
|
52
|
-
<th>Developers</th>
|
53
|
-
<th>Date</th>
|
54
|
-
<th>Description</th>
|
55
|
-
<th>Recommendation</th>
|
56
|
-
<th>Time In The Game</th>
|
57
|
-
</tr>
|
58
|
-
</thead>
|
59
|
-
<tbody>"
|
60
|
-
|
61
|
-
games_information = information_of_games(get_user_games(user_id))
|
62
|
-
games_information.each do |elem|
|
63
|
-
file_html.puts "<tr>"
|
64
|
-
file_html.puts "<th>"
|
65
|
-
if elem[:name].nil?
|
66
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
67
|
-
else
|
68
|
-
file_html.puts elem[:name]
|
69
|
-
end
|
70
|
-
file_html.puts "</th>"
|
71
|
-
file_html.puts "<th>"
|
72
|
-
file_html.puts "<img src = '#{elem[:img]}'
|
73
|
-
width = '220'
|
74
|
-
height = '102'
|
75
|
-
alt = 'Picture of the game'>"
|
76
|
-
file_html.puts "</th>"
|
77
|
-
file_html.puts "<th>"
|
78
|
-
if elem[:price].nil?
|
79
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
80
|
-
else
|
81
|
-
file_html.puts elem[:price]
|
82
|
-
end
|
83
|
-
file_html.puts "</th>"
|
84
|
-
file_html.puts "<th>"
|
85
|
-
if elem[:developers].nil?
|
86
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
87
|
-
else
|
88
|
-
file_html.puts elem[:developers]
|
89
|
-
end
|
90
|
-
file_html.puts "</th>"
|
91
|
-
file_html.puts "<th>"
|
92
|
-
if elem[:date].nil?
|
93
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
94
|
-
else
|
95
|
-
file_html.puts elem[:date]
|
96
|
-
end
|
97
|
-
file_html.puts "</th>"
|
98
|
-
file_html.puts "<th>"
|
99
|
-
if elem[:desc].nil?
|
100
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
101
|
-
else
|
102
|
-
file_html.puts elem[:desc]
|
103
|
-
end
|
104
|
-
file_html.puts "</th>"
|
105
|
-
file_html.puts "<th>"
|
106
|
-
if elem[:recommendations].nil?
|
107
|
-
file_html.puts "<span style = 'font-size:20pt'> - </span>"
|
108
|
-
else
|
109
|
-
file_html.puts elem[:recommendations]
|
110
|
-
end
|
111
|
-
file_html.puts "</th>"
|
112
|
-
file_html.puts "<th>"
|
113
|
-
if elem[:time] == 0
|
114
|
-
file_html.puts "0"
|
115
|
-
else
|
116
|
-
file_html.puts "#{elem[:time].to_i/60}h #{-(elem[:time].to_i/60*60 - elem[:time].to_i)}min"
|
117
|
-
end
|
118
|
-
file_html.puts "</th>"
|
119
|
-
file_html.puts "</tr>"
|
120
|
-
end
|
121
|
-
file_html.puts "</tbody>
|
122
|
-
</table>"
|
123
|
-
file_html.close
|
124
|
-
end
|