Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program test6;
- uses
- Classes, LibCurl, UnixType;
- Var
- URL : Pchar = 'http://fullcirclemagazine.org/author/ronnie-2/feed/';
- hCurl : pCurl;
- f : TFileStream;
- Function DoWrite(Ptr : Pointer; Size : size_t; nmemb: size_t; Data : Pointer) : size_t; cdecl;
- begin
- DoWrite := TStream(Data).Write(Ptr^,Size*nmemb);
- end;
- begin
- f:=TFileStream.Create('fcm.xml',fmCreate);
- hCurl:= curl_easy_init;
- if Assigned(hCurl) then
- begin
- curl_easy_setopt(hCurl,CURLOPT_VERBOSE, [True]);
- curl_easy_setopt(hCurl,CURLOPT_URL,[URL]);
- curl_easy_setopt(hCurl,CURLOPT_WRITEFUNCTION,[@DoWrite]);
- curl_easy_setopt(hCurl,CURLOPT_WRITEDATA,[Pointer(f)]);
- curl_easy_perform(hCurl);
- curl_easy_cleanup(hCurl);
- end;
- f.Free;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement