initial commit:

- Basic tools. getinfo: curl from 'mubasher' as raw numbers
	readprice: read last price from raw info
	readdelta: read day's change in price
	stonks: still empty (interface)
	- Version 0.1-alpha
	- gitignore: raw/ folder

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-08-19 22:16:30 +03:00
commit 4702263d0a
5 changed files with 32 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
raw/

10
getinfo Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# 19 Aug 2020 - H.B
#read arg and get info from mubasher
raw=$(curl -s "https://english.mubasher.info/markets/TDWL/stocks/$1" | \
html2text2 | \
sed -n '/Last update:/,$p' | \
sed -n '/Stock Statistics/q;p')
mkdir -p raw
echo "$raw" > "raw/$1"

6
readdelta Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
#read days change from raw info
# 19 Aug 2020 - H.B.
cat raw/$1 | head -n-10 | tail -n+5

6
readprice Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
#read last price from raw info file
cat raw/$1 | head -n-12 | tail -n+3

9
stonks Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#cli interface to track TASI profolio
# 19 Aug 2020 - H.B
version=0.1-alpha
version_msg="stonks version $version"
echo "$version_msg"