Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Perl server question

by Anonymous Monk
on Sep 10, 2012 at 02:18 UTC ( #992648=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to make my own indicators for stock market analysis, I however need quotes for every minutes and cant have my laptop on forever to grab and save these. How difficult and time consuming would it be to make an ubuntu server that runs a perl script capturing quotes every minute during 9 till 5, stores quotes in a file and I would be able to access that data through the internet from any place to get the any quotes it has captured and saved in a file? I am sorry that this is a rather odd question but I have no clue how hard this would be.

Replies are listed 'Best First'.
Re: Perl server question
by PriNet (Monk) on Sep 10, 2012 at 02:51 UTC
    You would need to set aside some coding time and lots of coffee.... I'm not sure how you are retrieving the stock information directly, but it would probably be easiest to provide the information to a structured file that could be put on a website either locally or remotely that can be accessed via inet. Getting the information into a usable format would be the trickiest, but publishing the info to a website should be realativly easy, there are some good modules that allow you to send and recieve files over TCP using sockets. Most ISP's provide at least a little web space that you could bury the results page in that could be "scraped" later to get the information. This would probably mean you would need perl at your stock source computer and you laptop so you can proccess the information between the two rather seamlessly.

    I did try re-inventing the wheel...
    But it kept getting stuck on the corners

Re: Perl server question
by dsheroh (Prior) on Sep 10, 2012 at 09:15 UTC
    As Perl projects go, collecting data from an external source (calling an API to get the quotes, scraping them off a website, whatever) and writing it to a file is pretty damn easy. However, as already mentioned, the fact that you're asking this question in the first place suggests that you have zero or near-zero Perl knowledge, so even a relatively easy project may still be very difficult for you. You also haven't said anything about the source you'd be getting the quotes from, which could add a bit of complexity (both technical and legal - have you verified that their terms of service would permit this?) depending on how that source is set up.

      I already wrote the script that succesfully scrapes the quotes, I know how to store these in a file and then i can send that to my laptop and split that possibly or parse that again. I only have no idea in what form I would sent that file directly to my laptop from a server, and how to program a server in generalxD , I will check cpan:) I checked the source and it is legal:)

        Or store the file somewhere on your "server" where you can retrieve it with FTP. You could even automate the retrieval by writing a little script on your laptop based upon modules such as IO::Ftp.


        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        My blog: Imperial Deltronics

        Once you've got it on disk, why not simply rsync it to the laptop?

Re: Perl server question
by Anonymous Monk on Sep 10, 2012 at 03:50 UTC

    How difficult and time consuming would it be to ...

    Its one of those things, if you have to ask, then it probably is very difficult taking a long time :)

    Its also one of those things somebody has already done, maybe :) cpan cpan cpan

Re: Perl server question
by zentara (Archbishop) on Sep 10, 2012 at 10:20 UTC
Re: Perl server question
by MidLifeXis (Monsignor) on Sep 10, 2012 at 12:44 UTC

    Is there already a historical archive of the quotes provided by the data source? Then you don't need to handle the storage of the data, extra server, etc yourself.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://992648]
Approved by ww
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2018-06-21 14:49 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.