How to read data from website?

Currently I'm using system command to download raw paste from pastebin.
However, it would be nicer to just to read the data from the website and put it into string.

Solution I found, was to install CURL and OpenSSL, but seems too complicated for this little project. Is there a nice quick way to get raw paste from pastebin to string with less effort?
Last edited on
> Is there a nice quick way to get raw paste from pastebin to string with less effort?
Use a more network centric programming language which has all that stuff built into it.

Are you on Windows or Linux?
Windows. Stuff I'm doing is harder on other languages, as this is just a small part of my program.
windows (visual studio, that is) does have a browser widget. you can fire one up hidden and see if it can do the dirty work for you with the correct parameters, and lift it from there.

you can also do a mixed language solution, like calling python in the C++ and dump the result to a text file or shared memory.
Last edited on
It needs less installing of 3rd party software...

But "simpler" is in the eye of the beholder.

Make yourself comfortable for a day or two of solid reading and trying example programs before trying to integrate what you've learnt into your own programs.
MS has WinHTTP and WinInet. HTTP Sessions is part of WinINet. Both are "native" parts of the WinAPI.

WinINet vs. WinHTTP -

hasane, you have some reading and deciding to do.
Furry Guy. Maybe you should read the question again.
hasane. Maybe you should be less of an a** and consider that Furry Guy actually knows his schnizzit, especially since you are the one asking the question.

It doesn’t get any simpler than using curl. You will have to do the same things no matter what other language you choose, only you will also have to set up the sockets, create the connection, POST the request, and wait on the response. Curl does all that for you automagically.

You will need to know the API of pastebin (which I have never looked at nor care to). It is likely you will have to perform a few POSTs to make pastebin give you access, but otherwise the data should simply be a file you can request.

Honestly, though, it sounds to me like you have an XY problem.
Topic archived. No new replies allowed.