Thread: need ready libcurl code to read URL into a buffer

  1. #1
    Registered User
    Join Date
    Apr 2019
    Posts
    5

    need ready libcurl code to read URL into a buffer

    Hi Guys,

    I'm really pressed for time, all I need is to use libcurl to
    download the html for "Market News: Share Market Live Today, Latest Share Market News and Headlines"
    into a String or a memory buffer,and then parse it (this part i know).

    I dont want to use command-line curl - it has to be a C program.

    But the examples are somewhat confusing...
    please help..

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,235
    If I was pressed for time I'd write a small Python program with the requests library instead

    What is your idea for using libcurl and what have you tried? Post your current code and tell us how does it not work.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Feb 2019
    Posts
    550
    Simple code for using libcurl easy interface: url2file.c

  4. #4
    Registered User
    Join Date
    Apr 2019
    Posts
    5
    I dont know Python; but you sound so sure I must try it.

  5. #5
    Registered User
    Join Date
    Apr 2019
    Posts
    5
    Thanks so much!
    I think this is pretty much what I need....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Read 32 Bits From Any File Into Buffer
    By fuzzymanboy in forum C Programming
    Replies: 3
    Last Post: 10-05-2017, 10:12 PM
  2. using C read() into buffer issues
    By npc93 in forum C Programming
    Replies: 5
    Last Post: 02-12-2017, 02:13 PM
  3. thread ready code
    By User Name: in forum C Programming
    Replies: 8
    Last Post: 07-20-2010, 08:20 AM
  4. Question abt read(fd, buffer, 1024)
    By tesla in forum Networking/Device Communication
    Replies: 1
    Last Post: 09-12-2009, 03:52 AM

Tags for this Thread