Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Learning about programming web applications

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

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.

Thanks.
 
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
amk pitt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 67414
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"On the web" is pretty broad. Exactly where do intend to get the information from? A web service? Screen-scraping a web page? Other?

Part of learning to program is learning how to specify problems. You'll need to be much more complete.
 
amk pitt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:"On the web" is pretty broad. Exactly where do intend to get the information from? A web service? Screen-scraping a web page? Other?

Part of learning to program is learning how to specify problems. You'll need to be much more complete.



Ok I see. I guess I would use a Screen-scraping method. I guess thats one place i should start. Thanks Bear.
 
Bear Bibeault
Marshal
Posts: 67414
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To fetch things from the web, check out the classes in the java.net package; especially URLConnection.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Bill
 
Paul Clapham
Marshal
Posts: 25669
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic