diff options
-rw-r--r-- | context_mirror_bot.ml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/context_mirror_bot.ml b/context_mirror_bot.ml index d937c98..148dd37 100644 --- a/context_mirror_bot.ml +++ b/context_mirror_bot.ml @@ -26,7 +26,6 @@ ****************************************************************************** * * TODO - * * curl user agent * * logging * *****************************************************************************) @@ -71,6 +70,10 @@ let sources = page = "http://www.pragma-ade.com/download-1.htm"; url = "http://www.pragma-ade.com/context/current/cont-tmf.zip"; } ] +(* owner and contact details for the user agent string *) +let bot_owner = "Philipp Gesang" +let owner_contact = "phg42.2a@gmail.com" + let repo_root = "/home/phg/src/mirror" let repo_subdir = "context-git" let repo_dir = Filename.concat repo_root repo_subdir @@ -81,10 +84,9 @@ let ssh_id = "context_mirror_bot_id_rsa" let ssh_id_dst = (Filename.concat repo_root ssh_id) let static_files = [ ("context-license.txt", "COPYING"); - ("context-readme.rst", "README") + ("context-readme.rst", "README.rst") ] - let gitconfig = Printf.sprintf "\ [core] repositoryformatversion = 0 @@ -481,10 +483,17 @@ let prepare_dst () = * source download *****************************************************************************) +let user_agent = Printf.sprintf + "Mirror Bot operated by %s <%s>" + bot_owner + owner_contact + + let grab url writer = let open Curl in let c = init () in set_url c url; + setopt c (CURLOPT_USERAGENT user_agent); set_followlocation c true; set_writefunction c writer; perform c; |