newbie question about web app programming/design

how to run a process on a web/app server

Page 1 of 1

6 Replies - 1282 Views - Last Post: 20 April 2010 - 05:14 AM

#1 amirn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-April 10

newbie question about web app programming/design

Posted 19 April 2010 - 01:27 AM

Hi,
I'm a veteran C++/SQL programmer (server) on both windows and unix, but I have no clue in web programming.

I need to write an application that collects data about stocks values once a day and insert those values to a DB.
my problem is that the application has to run as part of a website, so I guess C++ is not an option here.

my questions are:
1. we'll have a dedicated web host server (windows, since the UI will be developed in ASP.NET), what language should I use to build such an application (is C# a good one?) , and how do I even run an application on a web server environemnt?

2. can I can standalone application on a web server hosting env? or must it be somehow integrated into the web/application server software (IIS)?

3. how do I run the app once a day? (in tradional programming it can be done via a sleep or crontab)

4. how do I extract data from stock-related websites? I saw that sites like MSN money central, yahoo finance and google finance provide the data I need, but I have no idea how to get it programmatically.

if you can answer or point me in the right direction, that would be great.

Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: newbie question about web app programming/design

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1926
  • View blog
  • Posts: 3,467
  • Joined: 13-January 08

Re: newbie question about web app programming/design

Posted 19 April 2010 - 06:27 AM

Well, my experience is with Coldfusion which can run on .NET servers.

If I were tasked with your project I'd code a website with a simple interface for users to navigate around and a second module to run as a scheduled task to call a web services feed to give me the stock pricing info.

The info is available via RSS feeds that you can call with the stock ticker symbol. A lot of times the info is 15 mins stale but if that's not a deal breaker for you then that pretty much is all the info you need.

Here's a link to a similar question with an answer that lists all kinds of RSS services that you can use.

I work primarily with CF but the same can be done with ASP, ASP.NET, PHP, JSP...hell, pretty much any web dev language.

Good luck!
Was This Post Helpful? 0
  • +
  • -

#3 amirn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-April 10

Re: newbie question about web app programming/design

Posted 19 April 2010 - 07:20 AM

Thank you for the reply and for the link.

my question is how do I program/run/configure the "second module to run as a scheduled task", is it just like a regular standalone process that runs on a windows machine? or does it have to be somehow integrated into IIS?

I need the stocks values only once a day at the end of the day, not in real time, so I can enter them into my own DB.
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1926
  • View blog
  • Posts: 3,467
  • Joined: 13-January 08

Re: newbie question about web app programming/design

Posted 19 April 2010 - 07:39 AM

Well, specific to Coldfusion, a scheduled task is something you set up on the CF server to execute a code page on a specific time frequency. It's built in with CF, I'm sure you could do something similar with PHP but you'd possibly have to hand code it yourself.

Basically, you'd code a page to go out and fetch the stock price(s) you need, insert them into a database and you'd set up a schedule for the running of that page at whatever time interval you need.
Was This Post Helpful? 0
  • +
  • -

#5 amirn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-April 10

Re: newbie question about web app programming/design

Posted 19 April 2010 - 07:55 AM

Thanks. but since CF is not the way we intend to go, I'd appreciate if someone can tell me what's the proper way to run scheduled tasks on IIS with ASP.NET (or C# application)
Was This Post Helpful? 0
  • +
  • -

#6 dsherohman  Icon User is offline

  • Perl Parson
  • member icon

Reputation: 226
  • View blog
  • Posts: 654
  • Joined: 29-March 09

Re: newbie question about web app programming/design

Posted 20 April 2010 - 02:56 AM

View Postamirn, on 19 April 2010 - 02:55 PM, said:

Thanks. but since CF is not the way we intend to go, I'd appreciate if someone can tell me what's the proper way to run scheduled tasks on IIS with ASP.NET (or C# application)

I've never done anything with IIS and rarely touch Windows at all, but...

Is there any reason it has to come from IIS rather than just scheduling it using the normal Windows tool ("Scheduled Tasks", I think they call it?) and connecting to the same database? My normal approach in the *nix world is to write a command-line program to handle maintenance for my web apps and either run it from cron or build it into a daemon and it works great either way, with no need for apache to get involved at all.

If you have to host on a server which doesn't allow any form of scheduled tasks, you might want to take a look at the Drupal "poor man's cron" plugin to see how it works. My understanding of the basic idea is that is stores a timestamp in the db for the last time Drupal's cron.php was called and, if it's time for it to run again, the module inserts some javascript into the next outgoing page which tells the user's browser to request cron.php behind the scenes.
Was This Post Helpful? 0
  • +
  • -

#7 amirn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-April 10

Re: newbie question about web app programming/design

Posted 20 April 2010 - 05:14 AM

using the windows scheduler is a good solution. no reason to do it via IIS, like I said I know very little about web programming and env, so I wanted to know maybe there was a proper way of doing things.

basically my flow is:
- collect stocks end-of-day values from some sites and insert them to DB (once a day per market)
- run some algorithm to calc stuff and update some other tables based on the results
- email users with algo results
- sleep until the next day...

meanwhile users may query the DB [via the webpages], so some sort of locking should be in place

on top of that, there will be some maintainance to thin out tables etc.

if anyone is familiar with the windows scheduler, do I have to be logged in windows for it to run scheduled tasks?

Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1