Page 1 of 1
Help with libCurl
Posted: Thu May 08, 2008 3:09 pm
by KoopaOne
Hello, i am trying to get the libCurl which is available here to work.
i have two curl-lines i would need to be translated to work in pb.
can someone help?
the lines are:
Code: Select all
curl -c cookie.txt -L http://www.xxx.com/xxx.html"
curl --cookie cookie.txt -o " +verz$+linkname$ + " --referer http://www.xxx.com/public/" + link$ + ".html " + "http://www.xxx.com/public/view/" + link$ + ".html"
it works using the curl.exe but i have to clue about userlibs and need this to be done afap ... this cannot be that hard *gg*
thanks in advance
Posted: Thu May 08, 2008 9:16 pm
by didier69
Hi,
Progi1984 made a wrapper of libculr for purebasic.
You can find it here:
http://purebasic.myftp.org/?filename=fi ... 7.17.1.zip
I made a
client to twitter with this library, and it works great.
I didn't test the cookie parameters, but it shall work.
Post your code here when you find a solution.
Regards.
Posted: Fri May 09, 2008 1:01 pm
by lexvictory
didier69 wrote:Progi1984 made a wrapper of libculr for purebasic.
maybe he started the include, but i did some of the work...
especially the linux stuff, and the https read function, and some constants....
word of warning: that include most likely wont work on linux... as its only windows that needs the "As '_*'" stuff....
see "
http://puremessenger.svn.sourceforge.ne ... libcurl.pb" for my version (phpbb doesnt like the *'s in the url, copy + paste)
Posted: Fri May 09, 2008 1:25 pm
by Progi1984
@lexvictory :
Sorry lexvictory but my version is my work. I completly imported header of Libcurl, function after function, constant after constant, structure after structure. Like I have done for all my wrappers.
Actually my wrapper has not been tested under Linux. And I have some modifications to do on my wrapper inspirated of you own, you will be in credits.
@KoopaOne :
Like you can see here (
http://curl.netmirror.org/libcurl/c/lib ... orial.html) in the section "Cookies Without Chocolate Chips", you can send cookie via this function :
Code: Select all
curl_easy_setopt(easyhandle, #CURLOPT_COOKIE, @"name1=var1; name2=var2;")
So in you case, you must read the content of you file in text mode, put this content in a string and define it with curl_easy_setopt.
Posted: Fri May 09, 2008 2:19 pm
by lexvictory
sorry, had a bad mood moment.
but not all of the constants were done completely by you. so to me the constant after constant isnt true.
perhaps i am being too critical, but its late here... and lets face it, we all have our moments...
Posted: Fri May 09, 2008 3:16 pm
by Progi1984
lexvictory wrote:sorry, had a bad mood moment.
but not all of the constants were done completely by you. so to me the constant after constant isnt true.
perhaps i am being too critical, but its late here... and lets face it, we all have our moments...
Constant after constant is an expression bad translated from french. Sorry. I want to say that i parsed all headers files for converting it in Purebasic.
Posted: Sun Nov 16, 2008 11:46 am
by Inner
Good job mate

and you also supported linux too {cookie} for you.