This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openLink getToday |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getFileForToday = | |
getFile System.DateTime.Now | |
let getToday = | |
getFileForToday NewYork PDF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let openLink (url : string) = | |
ignore (System.Diagnostics.Process.Start(url)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getFile System.DateTime.Now NewYork PDF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getFile date edition format = | |
let path = getFormatPath date format | |
let fileRoot = getFileRoot date edition | |
let extension = getFileExtension format | |
path + fileRoot + "." + extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getFileExtension format = | |
match format with | |
| PDF -> "pdf" | |
| JPG -> "jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getFileRoot (date : System.DateTime) edition = | |
match edition with | |
| NewYork -> "scan" | |
| National -> "scannat" | |
| International -> sprintf "INYT_frontpage_global.%i%02i%02i" date.Year date.Month date.Day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getFormatPath (date : System.DateTime) format = | |
match format with | |
| PDF -> sprintf "http://www.nytimes.com/images/%i/%02i/%02i/nytfrontpage/" date.Year date.Month date.Day | |
| JPG -> sprintf "https://static01.nyt.com/images/%i/%02i/%02i/nytfrontpage/" date.Year date.Month date.Day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Edition = | |
| NewYork | |
| National | |
| International | |
type Format = | |
| JPG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NY PDF: http://www.nytimes.com/images/2017/02/19/nytfrontpage/scan.pdf | |
// National PDF: http://www.nytimes.com/images/2017/02/19/nytfrontpage/scannat.pdf | |
// International PDF: http://www.nytimes.com/images/2017/02/19/nytfrontpage/INYT_frontpage_global.20170125.pdf | |
// NY JPG: https://static01.nyt.com/images/2017/02/19/nytfrontpage/scan_paper.jpg | |
// National JPG: https://static01.nyt.com/images/2017/02/19/nytfrontpage/scannat_paper.jpg | |
// International JPG: https://static01.nyt.com/images/2017/02/19/nytfrontpage/INYT_frontpage_global.20170125.jpg |
NewerOlder