Sockets for a site?

Well, I used to script in mIRC and I was able to make a socket script that would basiclly connect through HTTP, using port 80 to a site and return a value that I tell it to from the source of the page

So what I am wondering is how in c++ I can prompt the user to enter a word, than my program would get the definition from dictionary.com and return the def to the user.
First off, go find out how the headers and stuff are handled dictionary.com.
Last edited on
You just need to know how dictionary.com finds requests. If it uses GET requests, then you can just issue a GET.

In fact, I just checked. All you need to do is download http://www.dictionary.com/browse/<word> and parse the HTML to find the definitions.

In pseudo-code:
1
2
3
4
take input from user
check it's a word (if it's more than one word, you could either just take the first word, or if you want to be really impressive, do a different search for each one)
download e.g. http://dictionary.reference.com/browse/foo
read the HTML file and look for the definition


Or you could download the page and then render it... but that would be a lot harder.
Can someone explain more......Like a example of the code
what of the above steps is unclear?...
Topic archived. No new replies allowed.