Hosting a web app -- technical details
I have some experience with writing scrapers/bots. So f开发者_JAVA技巧ar, I've been writing them in C#, to be ran from a local computer. But the new client wants a web application that will monitor a website and mail him whenever there is a change. So I have questions:
1) What language should I use? PHP?
2) If I do use PHP, will the app be drastically different to develop? I would have no problems with writing it as a C# program.
3) What's a good host to test the project?
1) Whichever language the host or server supports that you're comfortable with.
2) I can't say I have any experience in C#, but even if you had to learn PHP from scratch, it wouldn't be that difficult. PHP has all sorts of functions, including http wrappers and email capabilities (after configuration, that is).
3) You can always setup a virtual machine running the OS that will be run on the server. If you just need to test if it works as a web application, consider getting a testing environment like XAMPP.
On a side note, if you're looking to have a script run regularly on a server, you'll probably have to have it run using a cron job or with some other scheduling tool. If the application you're building doesn't produce any on-demand user-viewable content (HTML output when visited, etc) then you'll probably need to double check with whoever is hosting the application to make sure that they're ok with you doing scheduled runs of it. (In the past I've been booted from a web host for running hourly PHP scripts from cron jobs without permission! Oops!)
Why does the client want their monitor program to take the form of a web application? I don't see what's wrong with either a scheduled task or an on-demand program...
Are you to target a specific website? If not, and this is supposed to be a general purpose thing, how would you know to disregard say the date being included on a web page, and not see that as a change?
The first thing I think you have to do is define exactly what you are trying to do, and why the customer wants you to do it. Customer's don't always know best, and there could be a better solution to whatever the problem is that they are facing...
Martin.
精彩评论