Help with libCurl

Just starting out? Need help? Post your questions and find answers here.
KoopaOne
New User
New User
Posts: 9
Joined: Thu May 08, 2008 3:04 pm

Help with libCurl

Post 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
didier69
User
User
Posts: 15
Joined: Wed Apr 30, 2008 11:24 am
Location: Lyon (France)

Post 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.
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post 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)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post 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.
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post 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...
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post 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.
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

Good job mate :) and you also supported linux too {cookie} for you.
Post Reply