This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx jsx */ | |
import { useState } from 'react' | |
import { css, jsx } from '@emotion/react' | |
import { Container, Row, Col, Form } from 'react-bootstrap' | |
const customers = ['Jack', 'Sally', 'Jane', 'Mark'] | |
const Invoice = () => { | |
const [customer, setCustomer] = useState('') | |
const [title, setTitle] = useState('') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx jsx */ | |
import React, { useState, useEffect, useRef } from 'react' | |
import { css, jsx } from '@emotion/core' | |
import SliderContent from './SliderContent' | |
import Slide from './Slide' | |
/** | |
* @function Slider | |
*/ | |
const Slider = props => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require("puppeteer"); | |
const createCsvWriter = require("csv-writer").createArrayCsvWriter; | |
const csvWriter = createCsvWriter({ | |
header: [ | |
"Country", | |
"Total Cases", | |
"New Cases", | |
"Total Deaths", | |
"New Deaths", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const worldData = await page.evaluate(() => { | |
const tbody = document.querySelector( | |
"table#main_table_countries_today tbody" | |
); | |
const trs = Array.from( | |
tbody.querySelectorAll("tr:not(.total_row_world)") | |
); | |
const worldData = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await page.goto("https://www.worldometers.info/coronavirus/"); | |
await page.waitForSelector("table#main_table_countries_today"); | |
await page.evaluate(() => { | |
const tbody = document.querySelector( | |
"table#main_table_countries_today tbody" | |
); | |
const trs = Array.from( | |
tbody.querySelectorAll("tr:not(.total_row_world)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await page.goto("https://www.worldometers.info/coronavirus/"); | |
await page.waitForSelector("table#main_table_countries_today"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require("puppeteer"); | |
const createCsvWriter = require("csv-writer").createArrayCsvWriter; | |
const csvWriter = createCsvWriter({ | |
header: [ | |
"Country", | |
"Total Cases", | |
"New Cases", | |
"Total Deaths", | |
"New Deaths", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id":1, | |
"value":"banana" | |
}, | |
{ | |
"id":2, | |
"value":"apple" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"away": { | |
"stat_name": "wind speed", | |
"stat_value": 8, | |
"league_high": 13, | |
"team_rank": 15 | |
}, | |
"home": { | |
"stat_name": "wind speed", | |
"stat_value": 8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
useEffect, | |
useState | |
} from "https://cdn.skypack.dev/react@17.0.1"; | |
import ReactDOM from "https://cdn.skypack.dev/react-dom@17.0.1"; | |
import axios from "https://cdn.skypack.dev/axios@0.21.1"; | |
const App = () => { | |
const [stats, setStats] = useState([]); |