Using Bash and Perl in Ubuntu to get Stock Quotes Presented by Dave Mawdsley, DACS Member, Linux SIG November 16, 2011 (a quick way to see the latest prices.

Slides:



Advertisements
Similar presentations
IS 6116 Introduction – 10 Jan Lecturer Details Aonghus Sugrue Website: aonghussugrue.wordpress.com
Advertisements

Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Multiple Tiers in Action
Website Development with PHP and MySQL Introduction.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
PHP and MySQL Week#1  Course Plan.  Introduction to Dynamic Web Content.  Setting Up Development Server Eng. Mohamed Ahmed Black 1.
Linux Operations and Administration
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, October 18, 2012 Session 7: PHP.
CNIT 132 Intermediate HTML and CSS Publish Web Page.
Dynamic Web Pages (Flash, JavaScript)
1 John Magee 9 November 2012 CS120 Lecture 17a: Publishing Web pages.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
Mini Group Presentations: php by Veronica Black + Jia Xu.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
JSON and A Comparison of Scripts. JSON: JavaScript Object Notation Based on a subset of the JavaScript Programming Language provides a standardized data.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
COMP 2923 A2 Website Development 101 Danny Silver JSOCS, Acadia University.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
 Prepared by: Eng. Maryam Adel Abdel-Hady
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Using Grsync with Ubuntu Presented by Dave Mawdsley, DACS Member, Linux SIG August 20, 2008 (making rsync easy with a memory key or a server)
A Simple SED Lesson Presented by Dave Mawdsley, DACS Member, Linux SIG Member February 15, 2012 (modifying HTML tags in an html file)
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
PHP Basics and Syntax Lesson 3 ITBS2203 E-Commerce for IT.
PHP Assignment Help BookMyEssay. What is PHP PHP is a scripting language generally used on web servers. It is an open source language and embedded code.
Using Crontab with Ubuntu
4.01 How Web Pages Work.
JQuery Fundamentals Introduction Tutorial Videos
Distributed Control and Measurement via the Internet
WWW and HTTP King Fahd University of Petroleum & Minerals
Using pktstat with Bash
The Linux Operating System
Introduction to Programming the WWW I
Stop Using ./ as in ./scriptname
Using Clam Anti-Virus with Ubuntu
PHP / MySQL Introduction
Dynamic Web Pages (Flash, JavaScript)
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
7 Best Programming Languages Based as per Earnings & Opportunities
Database Driven Websites
Chapter 27 WWW and HTTP.
Introducing the Arduino Uno
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
IntroductionToPHP Static vs. Dynamic websites
What is Perl? PERL--Practical Extraction and Report Language
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
Architecture of the web
Introduction to PHP.
4.01 How Web Pages Work.
Information Retrieval and Web Design
Introduction to JavaScript
Web Application Development Using PHP
Presentation transcript:

Using Bash and Perl in Ubuntu to get Stock Quotes Presented by Dave Mawdsley, DACS Member, Linux SIG November 16, 2011 (a quick way to see the latest prices of your stocks)

My Requirements I want a summary text file on my desktop that contains quotes of all of my stocks as of today. The text file is to be populated by the Bash and Perl scripts. This summary file will be called stockquotes.txt. I want the stock symbols of my stocks to be in a file in the home directory called stockquotesdwm.csv that the Perl script will read and use. For each line of this cvs file, there is the stock symbol, a comma, and then the exchange abbreviation. The Bash script will be used to manage the Perl script which will do the heavy lifting. 1

stockquotesdwm.csv AAPL,NASDAQ DELL,NASDAQ MSFT,NASDAQ ORCL,NASDAQ YHOO,NASDAQ HPQ,NYSE IBM,NYSE NOK,NYSE 2

Step 1: Install the Perl Financial Utility Using terminal, issue the following command: sudo apt-get install libfinance-quote-perl What this does is to install a finance quote library file that a Perl script can use. It has direct access to stock exchange data when the library features are used. 3

Step 2: Bash Script Manager 'perlmgr.sh' 4

Step 3: Perl Stock Quote Script 'stockquotes.pl' 5

Step 4: Change Permissions 6 Using terminal, issue the following command to make the two scripts executable: chmod u+x perlmgr.sh stockquotes.pl

Step 5: Run the Bash Script 7 Continuing in terminal, issue the following command to run the Bash script 'perlmgr.sh':./perlmgr.sh

The Output of stockquotes.txt 8

Comments p. 1 9 The output has the stock symbol and exchange backwards, but it's still readable with the latest price listed. (a minor coding choice of the Perl script) Perl has a rich library system developed over the years which make Perl scripts easy to use and very functional with time-tested libraries. Perl is called "the Swiss Army chainsaw of programming languages" (Wikipedia) The Bash script is useful for the ease of navigating directories, using utilities central to Linux and for launching applications using other programming languages from the command line. I used two scripts because each was particularly good in its own way.

Comments p Using multiple programming languages or scripts to handle a single problem set is routine today. Imagine what Firefox manages as a user visits a webpage. Here's a sample of some of the things Firefox may be required to do: Read and interpret HTML or some variant of it. Fetch data from a distant URL and reconstruct all the images. Use multiple JavaScript routines to help display surface content. (much of displayed advertising) Use a PHP script to access a database using mySQL and deliver relevant specific information back to the browser's page. Call a CGI script on a server to deliver content to an provider on the server such as SendMail. Embed sound and video using Java. Capture information about the user's computer system. Manage the display preferences of the user.

Using Bash and Perl in Ubuntu to get Stock Quotes This OpenOffice.org Presentation 'stocks.odp' can be downloaded from (a quick way to see the latest prices of your stocks)