Last active
December 31, 2015 18:49
-
-
Save PhDP/8029422 to your computer and use it in GitHub Desktop.
Get titles from arXiv's Stat.ML
This file contains hidden or 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
open System.Xml.Linq | |
open FSharp.Data | |
/// Use F#'s awesome type provider to access arXiv's API. | |
type StatML = XmlProvider<"http://export.arxiv.org/api/query?search_query=stat.ML&start=0&max_results=1000"> | |
/// Request Stat.ML articles from 'a' to 'b'. | |
let APIReq (a: int) (b: int) = | |
"http://export.arxiv.org/api/query?search_query=stat.ML&start=" + (string a) + "&max_results=" + (string b) | |
/// Get titles from 'a' to 'b' (e.g. StatMLTitles 0 1000, StatMLTitles 4247 6381). Store the titles in | |
/// a set object (sorted automatically). | |
let StatMLTitles a b = | |
(Set.empty, StatML.Load(APIReq a b).GetEntries()) | |
||> Array.fold (fun acc e -> Set.add e.Title acc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment