SlideShare a Scribd company logo
1 of 15
Fetch Statistics from the
Yahoo Finance and save it
into a Google Sheet
document
About me
• An Engineering Student at the International Institute of
Technology
• Node.js Developer
• Article Writer at CodeProject.com
What is Node.js?
•
•
•
•
•

A powerful platform to let you run JS on the server side
How? Uses Google’s V8 Engine
V8 is built in C
V8 is the fatest JS Engine on the planet
Great way to build modern web apps on both Client and
Server side!
Timeline

July 2011
Nov 2010
Cloud9IDE
launches

Jan 2009
Created Ryan Dahl

2009

April 2010
Heroku launches
node support

2010

July 2010
Yammer adopts
node.js

Nov 2011
Windows Azure
support

LinkedIn adopts
node for mobile
platform
port to Windows

EBay releases API
built on node
Cloud9IDE azure
support

IISNode

2011

Oct 2011 node.js
overtakes Ruby as
most popular
repo on gitHub
Walmart
Launch mobile
site on node.js

Feb 2012
App Harbour
support

2012
Companies support Node.js
•
•
•
•
•
•
•
•

Yahoo!
Microsoft
LinkedIn
Ebay
Fidelizoo
Paypal
CHESS
…
What Can I Do in Node?
•
•
•
•

Anything you want!
Chat servers, Analytics & Crazy fast backends
Socket.io library is a wicked way to build real time apps
Build a social Network! LinkedIn, Dropbox all using Node.js
What Can’t I Do in Node?
• Contradicts previous slide but
 Node.js is not a web framework i.e Sinatra
 Modules for node.js make it into web framework i.e Express
 Node.js is not Multi-threaded
 A single thread to rule them all
Non-Blocking? Blocking? I’m so confused
• By introducing callbacks. Node can move on to
other requests and whenever the callback is
called, node will process is.
• You should read non-blocking code as « put
function and params in queue and fire
callback when you reach the end of the
queue »
• Blocking= return Non-Blocking= no return.
Only callbacks
Fetch Statistics from the Yahoo Finance
• We have to fetch data from the link shown
below:


http://finance.yahoo.com/q/ks?s=LVS

The Company in our example is LVS.
Fetch Statistics from the Yahoo Finance
• You need to install Node.js Of course and it 3 packages:
 npm install request – So we could work with URLs in an easy
way.
 npm install cheerio – jQuery for the server side. This will make
the code 10x shorter.
 npm install edit-google-spreadsheet – to integrate with
Google docs/sheets with 2-3 lines of code.
Fetch Statistics from the Yahoo Finance
•
•
•
•
•

// Some parameters
var ticker = "LVS";
var yUrl = "http://finance.yahoo.com/q/ks?s=" + ticker;
var financeDetails = new Array();
var keyStr = new Array();
Fetch Statistics from the Yahoo Finance
•
•
•
•
•
•
•
•
•

// The main call to fetch the data, parse it and work on
it.
request(yUrl, function (error, response, body) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(body);
// the keys - We get them from a certain class attribute
var td = $('.yfnc_tablehead1');
$(td).each(function(j, val) {
keyStr[j] = $(val).text();
});
Working with Google Sheet Document
•
•
•
•
•
•
•
•
•
•

// upload our data to Google sheet
Spreadsheet.create({
debug: true,
username: 'TODO-fill',
password: 'TODO-fill',
debug: true,
spreadsheetName: 'TODO-yourSheetName',
worksheetName: 'TODO-Sheet1orAbetterName',
callback: sheetReady
});
Demo
Thank you

hadrichmed@gmail.com

More Related Content

What's hot

Azure series 2 creating a cloud service - web role
Azure series 2   creating a cloud service - web roleAzure series 2   creating a cloud service - web role
Azure series 2 creating a cloud service - web roleSaravanan Subburayal
 
JS digest. July 2017
JS digest. July 2017JS digest. July 2017
JS digest. July 2017ElifTech
 
semantic::core - A look back into seven years of enterprise class MediaWiki a...
semantic::core - A look back into seven years of enterprise class MediaWiki a...semantic::core - A look back into seven years of enterprise class MediaWiki a...
semantic::core - A look back into seven years of enterprise class MediaWiki a...Alexander Gesinn
 
Building fast aspnet websites
Building fast aspnet websitesBuilding fast aspnet websites
Building fast aspnet websitesMaarten Louage
 
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...ashishpd
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Kanika Gera
 
PHPNW14 - Getting Started With AWS
PHPNW14 - Getting Started With AWSPHPNW14 - Getting Started With AWS
PHPNW14 - Getting Started With AWSbenwaine
 
Node.JS and WebSockets with Faye
Node.JS and WebSockets with FayeNode.JS and WebSockets with Faye
Node.JS and WebSockets with FayeMatjaž Lipuš
 

What's hot (13)

Azure series 2 creating a cloud service - web role
Azure series 2   creating a cloud service - web roleAzure series 2   creating a cloud service - web role
Azure series 2 creating a cloud service - web role
 
JS digest. July 2017
JS digest. July 2017JS digest. July 2017
JS digest. July 2017
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 
Infra for startup
Infra for startupInfra for startup
Infra for startup
 
semantic::core - A look back into seven years of enterprise class MediaWiki a...
semantic::core - A look back into seven years of enterprise class MediaWiki a...semantic::core - A look back into seven years of enterprise class MediaWiki a...
semantic::core - A look back into seven years of enterprise class MediaWiki a...
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Building fast aspnet websites
Building fast aspnet websitesBuilding fast aspnet websites
Building fast aspnet websites
 
Why NodeJS
Why NodeJSWhy NodeJS
Why NodeJS
 
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...
Visual studio2019 launchevent_may25_blazor_presentation_net_bc_user_group_by_...
 
ASP.NET MVC 4
ASP.NET MVC 4ASP.NET MVC 4
ASP.NET MVC 4
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction
 
PHPNW14 - Getting Started With AWS
PHPNW14 - Getting Started With AWSPHPNW14 - Getting Started With AWS
PHPNW14 - Getting Started With AWS
 
Node.JS and WebSockets with Faye
Node.JS and WebSockets with FayeNode.JS and WebSockets with Faye
Node.JS and WebSockets with Faye
 

Similar to Fetch Company's statististics from Yahoo Finance and save it info a Google Sheet Document.

How to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysHow to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysBrett McLain
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development PresentationTurnToTech
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB
 
React for .net developers
React for .net developersReact for .net developers
React for .net developersmacsdickinson
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comCodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comChristopher Cubos
 
Simple Cloud with Amazon Lightsail - Mike Coleman
Simple Cloud with Amazon Lightsail - Mike ColemanSimple Cloud with Amazon Lightsail - Mike Coleman
Simple Cloud with Amazon Lightsail - Mike ColemanAmazon Web Services
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdflubnayasminsebl
 
VishalTaksale_RESUME_FORMAT
VishalTaksale_RESUME_FORMATVishalTaksale_RESUME_FORMAT
VishalTaksale_RESUME_FORMATVishal Taksale
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleAlexandre Marreiros
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixPeter Nazarov
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoAmazon Web Services
 
DevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryDevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryMikhail Prudnikov
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterpriseTaylor Lovett
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressDanilo Ercoli
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGGDBologna
 
Desarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webDesarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webSoftware Guru
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleyn_adam_stanley
 
Simple Cloud with Amazon Lightsail
Simple Cloud with Amazon LightsailSimple Cloud with Amazon Lightsail
Simple Cloud with Amazon LightsailAmazon Web Services
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseTaylor Lovett
 

Similar to Fetch Company's statististics from Yahoo Finance and save it info a Google Sheet Document. (20)

Real time web
Real time webReal time web
Real time web
 
How to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysHow to build a SaaS solution in 60 days
How to build a SaaS solution in 60 days
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
MongoDB World 2018: Ch-Ch-Ch-Ch-Changes: Taking Your Stitch Application to th...
 
React for .net developers
React for .net developersReact for .net developers
React for .net developers
 
CodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.comCodeIgniter - PHP MVC Framework by silicongulf.com
CodeIgniter - PHP MVC Framework by silicongulf.com
 
Simple Cloud with Amazon Lightsail - Mike Coleman
Simple Cloud with Amazon Lightsail - Mike ColemanSimple Cloud with Amazon Lightsail - Mike Coleman
Simple Cloud with Amazon Lightsail - Mike Coleman
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
VishalTaksale_RESUME_FORMAT
VishalTaksale_RESUME_FORMATVishalTaksale_RESUME_FORMAT
VishalTaksale_RESUME_FORMAT
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a couple
 
Sitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helixSitecore development approach evolution – destination helix
Sitecore development approach evolution – destination helix
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - Toronto
 
DevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryDevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous Delivery
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterprise
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 
Desarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webDesarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías web
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanley
 
Simple Cloud with Amazon Lightsail
Simple Cloud with Amazon LightsailSimple Cloud with Amazon Lightsail
Simple Cloud with Amazon Lightsail
 
Best Practices for WordPress in Enterprise
Best Practices for WordPress in EnterpriseBest Practices for WordPress in Enterprise
Best Practices for WordPress in Enterprise
 

More from mohamed hadrich

More from mohamed hadrich (11)

Professional assesment
Professional assesmentProfessional assesment
Professional assesment
 
Implentation d'une solution Cloud IAAS
Implentation d'une solution Cloud IAASImplentation d'une solution Cloud IAAS
Implentation d'une solution Cloud IAAS
 
Plan de secours inormatique
Plan de secours inormatiquePlan de secours inormatique
Plan de secours inormatique
 
Introduction into Big data
Introduction into Big dataIntroduction into Big data
Introduction into Big data
 
radius
radiusradius
radius
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
IIT Microsoft Tech Club
IIT Microsoft Tech Club IIT Microsoft Tech Club
IIT Microsoft Tech Club
 
IIT Microsoft Tech Club
IIT Microsoft Tech ClubIIT Microsoft Tech Club
IIT Microsoft Tech Club
 
What is Node.js
What is Node.jsWhat is Node.js
What is Node.js
 
How to be a rock star .Net Developer
How to be a rock star .Net DeveloperHow to be a rock star .Net Developer
How to be a rock star .Net Developer
 
Why we choose Skype ?
Why we choose Skype ?Why we choose Skype ?
Why we choose Skype ?
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

Fetch Company's statististics from Yahoo Finance and save it info a Google Sheet Document.

  • 1. Fetch Statistics from the Yahoo Finance and save it into a Google Sheet document
  • 2. About me • An Engineering Student at the International Institute of Technology • Node.js Developer • Article Writer at CodeProject.com
  • 3. What is Node.js? • • • • • A powerful platform to let you run JS on the server side How? Uses Google’s V8 Engine V8 is built in C V8 is the fatest JS Engine on the planet Great way to build modern web apps on both Client and Server side!
  • 4. Timeline July 2011 Nov 2010 Cloud9IDE launches Jan 2009 Created Ryan Dahl 2009 April 2010 Heroku launches node support 2010 July 2010 Yammer adopts node.js Nov 2011 Windows Azure support LinkedIn adopts node for mobile platform port to Windows EBay releases API built on node Cloud9IDE azure support IISNode 2011 Oct 2011 node.js overtakes Ruby as most popular repo on gitHub Walmart Launch mobile site on node.js Feb 2012 App Harbour support 2012
  • 6. What Can I Do in Node? • • • • Anything you want! Chat servers, Analytics & Crazy fast backends Socket.io library is a wicked way to build real time apps Build a social Network! LinkedIn, Dropbox all using Node.js
  • 7. What Can’t I Do in Node? • Contradicts previous slide but  Node.js is not a web framework i.e Sinatra  Modules for node.js make it into web framework i.e Express  Node.js is not Multi-threaded  A single thread to rule them all
  • 8. Non-Blocking? Blocking? I’m so confused • By introducing callbacks. Node can move on to other requests and whenever the callback is called, node will process is. • You should read non-blocking code as « put function and params in queue and fire callback when you reach the end of the queue » • Blocking= return Non-Blocking= no return. Only callbacks
  • 9. Fetch Statistics from the Yahoo Finance • We have to fetch data from the link shown below:  http://finance.yahoo.com/q/ks?s=LVS The Company in our example is LVS.
  • 10. Fetch Statistics from the Yahoo Finance • You need to install Node.js Of course and it 3 packages:  npm install request – So we could work with URLs in an easy way.  npm install cheerio – jQuery for the server side. This will make the code 10x shorter.  npm install edit-google-spreadsheet – to integrate with Google docs/sheets with 2-3 lines of code.
  • 11. Fetch Statistics from the Yahoo Finance • • • • • // Some parameters var ticker = "LVS"; var yUrl = "http://finance.yahoo.com/q/ks?s=" + ticker; var financeDetails = new Array(); var keyStr = new Array();
  • 12. Fetch Statistics from the Yahoo Finance • • • • • • • • • // The main call to fetch the data, parse it and work on it. request(yUrl, function (error, response, body) { if (!error && response.statusCode == 200) { var $ = cheerio.load(body); // the keys - We get them from a certain class attribute var td = $('.yfnc_tablehead1'); $(td).each(function(j, val) { keyStr[j] = $(val).text(); });
  • 13. Working with Google Sheet Document • • • • • • • • • • // upload our data to Google sheet Spreadsheet.create({ debug: true, username: 'TODO-fill', password: 'TODO-fill', debug: true, spreadsheetName: 'TODO-yourSheetName', worksheetName: 'TODO-Sheet1orAbetterName', callback: sheetReady });
  • 14. Demo