Web Page --> variable. How?

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
Gratch06
Posts: 141
Joined: 2003-05-25 01:48
Location: USA

Web Page --> variable. How?

Post by Gratch06 » 2003-08-26 07:11

I know that you can open a webpage up in a browser from DC++, but is there a way to read a webpage into a variable? If it comes in with all the html tags included, that's fine. I have played with creating HttpConnection variable types, but I can't figure out how to get it OUT of there and into a variable so it can be manipulated, parsed, displayed, etc.

-Gratch06

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-08-30 22:08

the short answer would be:

get your own HttpConnection object,
yourHttpConnection->addListener your own HttpConnectionListener subclass object
call yourHttpConnection->downloadFile,
and then wait for data to arrive in YourListenerObject::onAction(HttpConnectionListener::Types type, HttpConnection* /*conn*/, const BYTE* buf, int len)
(see lines 1423-1432 in MainFrm.cpp)
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2003-08-31 07:56

Someone posted a IP grabber patch... some time in the past. Ugh, gee, that's helpful, but it would be a good thing to look at... if you're not trying to do the same thing. ;)

Gratch06
Posts: 141
Joined: 2003-05-25 01:48
Location: USA

Post by Gratch06 » 2003-09-01 22:43

Code: Select all

C:\...src\windows\HubFrame.cpp(335): error C2664: 'Speaker<class HttpConnectionListener>::addListener' : cannot convert parameter 1 from 'HubFrame *const ' to 'HttpConnectionListener *'

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-09-02 04:03

HttpConnectionListener subclass object


I don't know what you edited, but you might want to add "private HttpConnectionListener" to the list of HubFrame's superclasses
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Gratch06
Posts: 141
Joined: 2003-05-25 01:48
Location: USA

Post by Gratch06 » 2003-09-03 19:22

That did the trick! Works like a charm, thanks Sedulus :D

-Gratch06

Locked