Skip to content

Instantly share code, notes, and snippets.

View raphapassini's full-sized avatar

Raphael Passini Diniz raphapassini

  • Belo Horizonte, Brasil
View GitHub Profile
# -*- coding: utf-8 -*-
import scrapy
from scrapy import Request
from scrapy import signals
class G1Spider(scrapy.Spider):
name = 'g1'
allowed_domains = ['g1.globo.com']
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import React, { useEffect, useState } from 'react'
export const AppContext = React.createContext()
export const WS = new WebSocket("ws://localhost:8000/subscribe=accounts,funds,orders,quotes&refresh=2")
export const AppContextProvider = (props) => {
let [loading, setLoading] = useState(true)
let [accounts, setAccounts] = useState({})
let [funds, setFunds] = useState({})
let [orders, setOrders] = useState([])