downloading webpages is hard

This commit is contained in:
Jeremy Kauffman 2016-06-29 13:35:45 -04:00
parent 1a66549f26
commit 02c16c46e2
4 changed files with 21 additions and 8 deletions

View file

@ -139,7 +139,7 @@ class Controller
unset($headers[static::HEADER_STATUS]);
}
}
foreach($headers as $name => $value)
{
header($name . ': ' . $value);

View file

@ -75,9 +75,20 @@ class ContentActions extends Actions
$zip = new ZipArchive();
$zip->open($zipPath, ZipArchive::OVERWRITE);
//file_get_contents fails on servers without proper SSL, so use live site always for now
$html = file_get_contents('https://lbry.io/press-kit');
// $html = file_get_contents('https://' . $_SERVER['HTTP_HOST'] . '/press-kit'));
$pageHtml = View::render('page/press-kit', ['showHeader' => false]);
$html = <<<EOD
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns#">
<title>LBRY Press Kit</title>
<link href='https://fonts.googleapis.com/css?family=Raleway:300,300italic,400,400italic,700' rel='stylesheet' type='text/css'>
<link href="https://lbry.io/css/all.css" rel="stylesheet" type="text/css" media="screen,print" />
</head>
<body>
$pageHtml
</body>
</html>
EOD;
$zip->addFromString('press.html', $html);

View file

@ -1,6 +1,8 @@
<?php Response::setMetaDescription('LBRY Press Kit. Information and media for those who want to report on LBRY.') ?>
<?php NavActions::setNavUri('/learn') ?>
<?php echo View::render('nav/header', ['isDark' => false]) ?>
<?php if (!isset($showHeader) || $showHeader): ?>
<?php Response::setMetaDescription('LBRY Press Kit. Information and media for those who want to report on LBRY.') ?>
<?php NavActions::setNavUri('/learn') ?>
<?php echo View::render('nav/header', ['isDark' => false]) ?>
<?php endif ?>
<main>
<div class="content content-light markdown">
<h1>LBRY Press Kit</h1>

View file

@ -33,7 +33,7 @@
.icon-mega
{
font-size: 200px;
line-height: 1;
line-height: 1;
}
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen