PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Getting Stocks Using Perl On Linux

Go down

Getting Stocks Using Perl On Linux Empty Getting Stocks Using Perl On Linux

Post by jamied_uk 28th July 2016, 16:00




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

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by jamied_uk 28th July 2016, 16:49

Saving Output To File

jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by jamied_uk 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
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by jamied_uk 28th July 2016, 17:29

Forcing 1 Script To Run At A Time On Linux




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

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by jamied_uk 28th July 2016, 17:33

Update Code Link

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

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by jamied_uk 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!"
jamied_uk
jamied_uk
Admin

Posts : 2943
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Stocks Using Perl On Linux Empty Re: Getting Stocks Using Perl On Linux

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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