Skip to content

Instantly share code, notes, and snippets.

@alexandernl
alexandernl / gist:8090a79a7af4197c5f5571e8cc8c05b8
Created November 11, 2020 12:28
Convert daily New York Times frontpage to jpg
<?php
// set the output-file
$outputfile = "/var/www/nyt/nyt.jpg";
// set path to todays NYT frontpage
$pathToPdf="https://static01.nyt.com/images/".date('Y')."/".date('m')."/".date('d')."/nytfrontpage/scan.pdf";
// check if there is any today
$file_headers = @get_headers($pathToPdf);