digitalmars.D - Phobos urllib
- Mengu (3/3) Aug 12 2010 Hello everyone,
- Mengu (2/7) Aug 13 2010 Anyone has any idea on this matter?
- Adam Ruppe (12/12) Aug 13 2010 I've been using the curl library with a thin wrapper in D:
- Graham Fawcett (7/25) Aug 13 2010 Just FYI, if you add 'pragma(lib, "curl");' to the top of your
- Adam Ruppe (4/7) Aug 13 2010 Very cool. For some reason, I thought that didn't work on linux... I
- Nick Sabalausky (3/9) Aug 13 2010 I had been thinking it was just a feature of "bud". Very good to know.
- Stanislav Blinov (5/15) Aug 16 2010 It works well with .d files, but not with import (.di) files. Both on
- Graham Fawcett (11/22) Aug 13 2010 I don't think there is anything usable in Phobos at the moment. However,
- Mengu (2/2) Aug 13 2010 Adam and Graham,
- Andrei Alexandrescu (10/32) Aug 14 2010 Graham,
- Graham Fawcett (7/54) Aug 14 2010 Yes -- I am happy to share it with the Phobos team.
- Jonathan M Davis (3/5) Aug 14 2010 Yes, sign right here, under "I agree to write quality code." ;)
Hello everyone, Python has a library named urllib which can be found at http://docs.python.org/library/urllib2.html. Does Phobos have anything similar to this library? All I need is fetching data from a web site.
Aug 12 2010
Mengu Wrote:Hello everyone, Python has a library named urllib which can be found at http://docs.python.org/library/urllib2.html. Does Phobos have anything similar to this library? All I need is fetching data from a web site.Anyone has any idea on this matter?
Aug 13 2010
I've been using the curl library with a thin wrapper in D: http://arsdnet.net/dcode/curl.d Example use: dmd test.d curl.d -L-lcurl ===== import std.stdio; import arsd.curl; void main() { writefln("%s", curl("http://arsdnet.net/dcode/curl.d")); } ===== That fetches the code off my site and prints it out.
Aug 13 2010
Hey Adam, On Fri, 13 Aug 2010 10:21:33 -0400, Adam Ruppe wrote:I've been using the curl library with a thin wrapper in D: http://arsdnet.net/dcode/curl.d Example use: dmd test.d curl.d -L-lcurlJust FYI, if you add 'pragma(lib, "curl");' to the top of your curl.d file, you shouldn't need '-L-lcurl' any more; dmd will add it automatically during linking. Best, Graham===== import std.stdio; import arsd.curl; void main() { writefln("%s", curl("http://arsdnet.net/dcode/curl.d")); } ===== That fetches the code off my site and prints it out.
Aug 13 2010
On 8/13/10, Graham Fawcett <fawcett uwindsor.ca> wrote:Just FYI, if you add 'pragma(lib, "curl");' to the top of your curl.d file, you shouldn't need '-L-lcurl' any more; dmd will add it automatically during linking.Very cool. For some reason, I thought that didn't work on linux... I must have just been doing it wrong before. Thanks!
Aug 13 2010
"Adam Ruppe" <destructionator gmail.com> wrote in message news:mailman.284.1281721417.13841.digitalmars-d puremagic.com...On 8/13/10, Graham Fawcett <fawcett uwindsor.ca> wrote:I had been thinking it was just a feature of "bud". Very good to know.Just FYI, if you add 'pragma(lib, "curl");' to the top of your curl.d file, you shouldn't need '-L-lcurl' any more; dmd will add it automatically during linking.Very cool. For some reason, I thought that didn't work on linux... I must have just been doing it wrong before.
Aug 13 2010
13.08.2010 22:27, Nick Sabalausky wrote:"Adam Ruppe"<destructionator gmail.com> wrote in message news:mailman.284.1281721417.13841.digitalmars-d puremagic.com...It works well with .d files, but not with import (.di) files. Both on Windows and Linux. Maybe I miss something? --On 8/13/10, Graham Fawcett<fawcett uwindsor.ca> wrote:I had been thinking it was just a feature of "bud". Very good to know.Just FYI, if you add 'pragma(lib, "curl");' to the top of your curl.d file, you shouldn't need '-L-lcurl' any more; dmd will add it automatically during linking.Very cool. For some reason, I thought that didn't work on linux... I must have just been doing it wrong before.
Aug 16 2010
Hi Mengu, On Fri, 13 Aug 2010 10:15:01 -0400, Mengu wrote:Mengu Wrote:I don't think there is anything usable in Phobos at the moment. However, several people have written bindings for libCURL, which will do what you need. I've got one here: http://github.com/gmfawcett/d-play-libcurl/blob/master/fawcett/curl.d There's one on dsource, here: http://dsource.org/projects/curld/browser/trunk/curld Best, GrahamHello everyone, Python has a library named urllib which can be found at http://docs.python.org/library/urllib2.html. Does Phobos have anything similar to this library? All I need is fetching data from a web site.Anyone has any idea on this matter?
Aug 13 2010
On 08/13/2010 09:23 AM, Graham Fawcett wrote:Hi Mengu, On Fri, 13 Aug 2010 10:15:01 -0400, Mengu wrote:Graham, I see your translation of libcurl's header is fairly complete. May I copy it into std.etc? We wanted to put libcurl there for a long time (Walter even exchanged emails with its author), and it would be a timesaver to copy yours. After we have the basic translation we should define higher-level APIs in Phobos that cloak it (libcurl has an unsafe interface). Thanks, AndreiMengu Wrote:I don't think there is anything usable in Phobos at the moment. However, several people have written bindings for libCURL, which will do what you need. I've got one here: http://github.com/gmfawcett/d-play-libcurl/blob/master/fawcett/curl.d There's one on dsource, here: http://dsource.org/projects/curld/browser/trunk/curld Best, GrahamHello everyone, Python has a library named urllib which can be found at http://docs.python.org/library/urllib2.html. Does Phobos have anything similar to this library? All I need is fetching data from a web site.Anyone has any idea on this matter?
Aug 14 2010
Hi Andrei, On Sat, 14 Aug 2010 09:35:21 -0500, Andrei Alexandrescu wrote:On 08/13/2010 09:23 AM, Graham Fawcett wrote:Yes -- I am happy to share it with the Phobos team. If you need me to sign a Contributor's Agreement or something, please email me. Regards, GrahamHi Mengu, On Fri, 13 Aug 2010 10:15:01 -0400, Mengu wrote:Graham, I see your translation of libcurl's header is fairly complete. May I copy it into std.etc? We wanted to put libcurl there for a long time (Walter even exchanged emails with its author), and it would be a timesaver to copy yours. After we have the basic translation we should define higher-level APIs in Phobos that cloak it (libcurl has an unsafe interface).Mengu Wrote:I don't think there is anything usable in Phobos at the moment. However, several people have written bindings for libCURL, which will do what you need. I've got one here: http://github.com/gmfawcett/d-play-libcurl/blob/master/fawcett/curl.d There's one on dsource, here: http://dsource.org/projects/curld/browser/trunk/curld Best, GrahamHello everyone, Python has a library named urllib which can be found at http://docs.python.org/library/urllib2.html. Does Phobos have anything similar to this library? All I need is fetching data from a web site.Anyone has any idea on this matter?Thanks, Andrei
Aug 14 2010
On Saturday 14 August 2010 15:43:54 Graham Fawcett wrote:If you need me to sign a Contributor's Agreement or something, please email me.Yes, sign right here, under "I agree to write quality code." ;) - Jonathan M Davis
Aug 14 2010