Created
February 4, 2023 17:06
-
-
Save R3DHULK/c66dee19518867a333996688023850c5 to your computer and use it in GitHub Desktop.
Osint In C Program
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
#include <stdio.h> | |
#include <curl/curl.h> | |
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) { | |
size_t written = fwrite(ptr, size, nmemb, stream); | |
return written; | |
} | |
int main(void) { | |
CURL *curl; | |
FILE *fp; | |
CURLcode res; | |
char *url = "https://example.com"; | |
char outfilename[FILENAME_MAX] = "example.html"; | |
curl = curl_easy_init(); | |
if (curl) { | |
fp = fopen(outfilename,"wb"); | |
curl_easy_setopt(curl, CURLOPT_URL, url); | |
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); | |
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); | |
res = curl_easy_perform(curl); | |
curl_easy_cleanup(curl); | |
fclose(fp); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HELP ME
osint-in-c.c:2:10: fatal error: curl/curl.h: No such file or directory
2 | #include <curl/curl.h>
| ^~~~~~~~~~~~~
compilation terminated.