You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
With the proper edits, this might be useful when we do have support ...
#!/usr/bin/perl
## Adapted from an online example.
## Adam M Dutko - 2013
use Cwd;
use HTTP::Cookies;
use LWP::UserAgent;
use Modern::Perl '2011';
use constant BASE => "https://openrecipes.s3.amazonaws.com/";
use constant FILE => "recipeitems-latest.json.gz";
use constant MD5 => "";
## Check if file exists
if (-e getcwd() . "/" . FILE)
{
print FILE . " exists. Right now checksum freshness checks are not supported.\n";
} else {
## Setup agent and cookies
my $ua = LWP::UserAgent->new();
my $download_cookies = HTTP::Cookies->new(
file => "download_cookies.txt",
autosave => 1
);
$ua->cookie_jar($download_cookies);
$ua->agent("Openrecip.es Download Agent");
## Download file
my $download_response = $ua->get(BASE . FILE);
unless($download_response->is_success)
{
print "ERROR: " . $download_response->status_line;
}
## Write the downloaded data
my $recipes = FILE;
unless(open RECIPES, '>' . $recipes)
{
die "ERROR: Cannot save the new recipes files.\n";
}
print RECIPES $download_response->decoded_content;
close RECIPES;
print "Latest recipes downloaded.\n";
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
No description provided.
The text was updated successfully, but these errors were encountered: