Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed Sep 25, 2018
2 parents ac9daf0 + f031949 commit 9ffea09
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cgi/sucres_check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
my $actual = decode utf8=>param('actual');
my $points = decode utf8=>param('points');

open (my $OUT, ">>" , "/home/sucres/logs/sugar_log");
open (my $OUT, ">>" , "/srv/sucres/logs/sugar_log");
print $OUT remote_addr() . "\t" . time() . "\t" . $product . "\t" . $code . "\t" . $actual . "\t" . $answer . "\t" . $points . "\n";
close $OUT;

Expand Down
2 changes: 1 addition & 1 deletion cgi/sucres_random.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use List::Util qw(shuffle);
use Log::Any qw($log);

my $ids_ref = lock_retrieve("/home/sucres/data/products_ids.sto");
my $ids_ref = lock_retrieve("/srv/sucres/data/products_ids.sto");
my @ids = @$ids_ref;

srand();
Expand Down
2 changes: 1 addition & 1 deletion cgi/sugar_check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
my $actual = decode utf8=>param('actual');
my $points = decode utf8=>param('points');

open (my $OUT, ">>" , "/home/sugar/logs/sugar_log");
open (my $OUT, ">>" , "/srv/sugar/logs/sugar_log");
print $OUT remote_addr() . "\t" . time() . "\t" . $product . "\t" . $code . "\t" . $actual . "\t" . $answer . "\t" . $points . "\n";
close $OUT;

Expand Down
2 changes: 1 addition & 1 deletion cgi/sugar_random.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use List::Util qw(shuffle);
use Log::Any qw($log);

my $ids_ref = lock_retrieve("/home/sugar/data/products_ids.sto");
my $ids_ref = lock_retrieve("/srv/sugar/data/products_ids.sto");
my @ids = @$ids_ref;

srand();
Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_sucres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
my $cubes_small = sprintf("%.1f", $sc);
my $cubes_big = sprintf("%.1f", $big);
my $producturl = product_url($product_ref);
$producturl =~ s/^\//http:\/\/fr.openfoodfacts.org\//;
$producturl =~ s/^\//https:\/\/fr.openfoodfacts.org\//;

my $code = $product_ref->{"code"};

Expand Down Expand Up @@ -243,7 +243,7 @@

$product_ref->{jqm} = 1;
my $img = display_image($product_ref, 'front', 200);
$img =~ s/src="\//src="http:\/\/fr.openfoodfacts.org\//;
$img =~ s/src="\//src="https:\/\/fr.openfoodfacts.org\//;
my $img_url = '';
my $zoom = '';
if ($img =~ /src="(.*?)"/) {
Expand Down Expand Up @@ -482,7 +482,7 @@
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
Expand Down Expand Up @@ -607,7 +607,7 @@
HTML
;

open (my $OUT, ">:encoding(UTF-8)", "/home/sucres/html/$id.html");
open (my $OUT, ">:encoding(UTF-8)", "/srv/sucres/html/$id.html");
print $OUT $page;
close $OUT;

Expand All @@ -624,7 +624,7 @@
print $OUT $html;
close $OUT;

store("/home/sucres/data/products_ids.sto", \@ids);
store("/srv/sucres/data/products_ids.sto", \@ids);

print "$k products, $kk products kept\n";
}
Expand Down
10 changes: 5 additions & 5 deletions scripts/gen_sugar.pl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@



my $query_ref = {lc=>$lc, states_tags=>'complete'};
my $query_ref = {lc=>$lc, states_tags=>'en:complete'};
#$query_ref->{"nutriments.sugars_100g"}{ '$gte'} = 0.01;
# -> does not seem to work for sugars, maybe some string values?!

Expand Down Expand Up @@ -194,7 +194,7 @@
my $cubes_small = sprintf("%.1f", $sc);
my $cubes_big = sprintf("%.1f", $big);
my $producturl = product_url($product_ref);
$producturl =~ s/^\//http:\/\/world.openfoodfacts.org\//;
$producturl =~ s/^\//https:\/\/world.openfoodfacts.org\//;

my $code = $product_ref->{"code"};

Expand Down Expand Up @@ -247,7 +247,7 @@

$product_ref->{jqm} = 1;
my $img = display_image($product_ref, 'front', 200);
$img =~ s/src="\//src="http:\/\/world.openfoodfacts.org\//;
$img =~ s/src="\//src="https:\/\/world.openfoodfacts.org\//;
my $img_url = '';
my $zoom = '';
if ($img =~ /src="(.*?)"/) {
Expand Down Expand Up @@ -613,7 +613,7 @@
HTML
;

open (my $OUT, ">:encoding(UTF-8)", "/home/sugar/html/$id.html");
open (my $OUT, ">:encoding(UTF-8)", "/srv/sugar/html/$id.html");
print $OUT $page;
close $OUT;

Expand All @@ -630,7 +630,7 @@
print $OUT $html;
close $OUT;

store("/home/sugar/data/products_ids.sto", \@ids);
store("/srv/sugar/data/products_ids.sto", \@ids);

print "$k products, $kk products kept\n";
}
Expand Down

0 comments on commit 9ffea09

Please sign in to comment.