Getting Stocks Using Perl On Linux

View previous topic View next topic Go down

Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 16:00




linuxconfig.org/fetch-stock-quotes-with-perl-finance-quote-module
avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 16:49

Saving Output To File

avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 17:22

Adding Twitter & Search Codes







Pages i used for above script examples

Use run.sh and run2.sh
the difference is the stock csv number file as you can process 5
csv enterys at a time before it goes too slow!

so every 5 make a new run file and add a number you can then run 1 master Run.sh file to run all the run files from 1 line Very Happy



Use Perl Example:

!/usr/bin/perl
 (c) J~Net 2016
ALL RIGHTS RESERVED!

sudo apt-get install libfinance-quote-perl

Usage

./perl_stock.pl stocks.csv  > output.txt
cat output.txt

Or ./run.sh

will do same but via bash Smile


the stocks file for perl stock is stocks.csv




Original https://linuxconfig.org/fetch-stock-quotes-with-perl-finance-quote-module


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The unreliable bash side

./stock_full.sh tickers.txt

use perl to get stock prices


http://perlmaven.com/writing-to-files-with-perl


http://www.perlmonks.org/?node_id=960

http://perlmaven.com/subroutines-and-functions-in-perl

https://stackoverflow.com/questions/10682087/how-to-redirect-console-output-to-a-text-file


http://www.marketwatch.com/tools/quotes/lookup.asp?siteID=mktw&Lookup=t&Country=all&Type=All

https://encrypted.google.com/search?q=stock+trade+codes


Last edited by jamied_uk on 28th July 2016, 17:35; edited 1 time in total
avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 17:29

Forcing 1 Script To Run At A Time On Linux




Code:
sh run.sh && sh run2.sh
avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 17:33

Update Code Link

app.box.com/s/u5evl6taikf89fusouhx2iqpfkwyk1g2
avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by jamied_uk on 28th July 2016, 20:26

Code:
#!/bin/bash
# Usage: ./Run.sh
#
echo -en "\e[92m\c"
mv final.txt old_final.txt
sh run.sh && sh run2.sh > final.txt
cat final.txt
echo "Now for the differences... "
diff old_final.txt final.txt
echo "> Means ^ & < Means Down!"
avatar
jamied_uk
Admin

Posts : 2199
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Getting Stocks Using Perl On Linux

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum