diff options
Diffstat (limited to 'bin/title.c')
-rw-r--r-- | bin/title.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/title.c b/bin/title.c index 9cf444e8..47ff720a 100644 --- a/bin/title.c +++ b/bin/title.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 C. McEnroe <june@causal.agency> +/* Copyright (C) 2019 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -84,7 +84,7 @@ static void showTitle(const char *title) { static CURL *curl; static bool title; static struct { - char buf[8192]; + char buf[64 * 1024]; size_t len; } body; @@ -136,7 +136,7 @@ static CURLcode fetchTitle(const char *url) { body.len = 0; title = false; - curl_easy_setopt(curl, CURLOPT_NOBODY, 0L); + curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L); code = curl_easy_perform(curl); return code; } @@ -158,7 +158,10 @@ int main(int argc, char *argv[]) { curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error); curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/7.54.0"); + curl_easy_setopt( + curl, CURLOPT_USERAGENT, + "curl/7.54.0 facebookexternalhit/1.1 Twitterbot/1.0" + ); curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, ""); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 3L); |