Skip to content

Instantly share code, notes, and snippets.

View luxu's full-sized avatar
🏠
Working from home

Luciano da Silva Martins luxu

🏠
Working from home
View GitHub Profile
@luxu
luxu / cbf_jogos_por_rodada.py
Last active March 22, 2018 11:39
Arquivo que pega as rodadas do BR2018 e cria o arquivo: tabelas.json que será usada numa aplicação em Vue
# -*- coding: utf-8 -*-
#!/usr/bin/python
import os
import re
import requests
from bs4 import BeautifulSoup
def run(link):
if link is None:
@luxu
luxu / Tabela.Vue
Created April 25, 2018 20:40
Campeonato Brasileiro 2018
<script>
import api from '@/api'
import { log } from 'util'
import axios from 'axios'
import { isEmpty } from 'lodash'
export default {
name: 'tabela',
data () {
{% extends "core/base.html" %}
{% block container %}
<div id="starting">
<div class="container">
<div class="row">
<h3>Lista dos Gastos
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addGastoModal">Add Gastos</button>
</h3>
&emsp;
{% extends "core/base.html" %}
{% block container %}
<div id="starting">
<div class="container">
<div class="row">
<h3>Lista dos Gastos
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addGastoModal">Add Gastos</button>
</h3>
&emsp;
{% extends "core/base.html" %}
{% block container %}
<div id="starting">
<div class="container">
<div class="row">
<h3>Lista dos Gastos
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addGastoModal">Add Gastos</button>
</h3>
&emsp;
@luxu
luxu / userede.py
Created September 9, 2018 20:24
Site Rede - Cartões
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from time import sleep
# coding: utf-8
import re
def lerArquivo(arquivo):
with open(arquivo, encoding="utf8") as _file:
texto = _file.readlines()
for t in texto:
'''Transforma o texto em dicionário tirando os espaços em branco'''
t = t.split(' ')
'''Só pega as linhas do texto que seja maior do que 30
tabuleiro = {'top-L':' ','top-M':' ','top-R':' ',
'mid-L':' ','mid-M':' ','mid-R':' ',
'low-L':' ','low-M':' ','low-R':' '}
def imprimeTabuleiro(tabuleiro):
print(tabuleiro['top-L'] + '|' + tabuleiro['top-M'] + '|' + tabuleiro['top-R'])
print('-+-+-')
print(tabuleiro['mid-L'] + '|' + tabuleiro['mid-M'] + '|' + tabuleiro['mid-R'])
print('-+-+-')
print(tabuleiro['low-L'] + '|' + tabuleiro['low-M'] + '|' + tabuleiro['low-R'])
# -*- coding: utf-8 -*-
from requests import get
from bs4 import BeautifulSoup as bs
def links(url):
html = get(url)
soup = bs(html.content, 'html.parser')
return soup
def parse(soup):
from requests import get
from bs4 import BeautifulSoup as bs
from shutil import copyfileobj
import os
html = get('http://www.afterfest.com.br/mr-moo-4a-edicao/')
soup = bs(html.content, 'html.parser')
def download_file(name, url, pasta):
os.makedirs(pasta, exist_ok=True) # armazena as na pasta