This is my first post here. I am currently a student who is studying cs. I have a good handle on java and am learning C, but still have plenty more to learn. One thing I am interested in learning is how to write a program that interacts with information on the web. Take this as an example:
Write a small application that lets a user input their email and a desired product (productId or productName) and sends them an email when the price hits at least 20% off the original price.
I have no experience with writing code that can extract information from the web. I have only done things that either read in user input or read information from a text file. I essentially have no idea how I would go about interacting with the web. I was wondering if anyone who knows how to do this could give me a good starting point for learning how to do this. I understand thats a broad question, but I'm really ignorant on the subject. Can I use Java? Do you have any links for tutorials that would be useful? Any advice would be greatly appreciated.
I don't see why you think that "interacting with the web" is part of the solution for that question.
But that's mostly because the specifications are incomplete. For example: where is the data for those products stored? Are you supposed to arrange that storage yourself, or is the data already somewhere and you're just supposed to access it?
posted 6 years ago
I figured since all the user was inputting was his email and product name, that I would have to have my program search for the product's lowest price on the web, and then alert the user once that product is available somewhere on the web for 20% less. Perhaps that is more than the assignment is asking, but assuming I wanted to do this, I would have to access the web. Assume this is the type of problem I want to be able to tackle.
Screen scraping is a LOT more complex now than in the old days of "terminal" displays. Where a terminal display was once created from a single stream of characters, a modern web page may be built from dozens of different resources.
Don't forget that once you have the screen-scraping part working, all that gives you is the current price for the item. You also need somewhere to store the user's e-mail address and the price of the item at the time the user made the request, so that when three weeks later you find a new price which is 20% lower, you'll be able to send that long-awaited e-mail.