Skip to content

Instantly share code, notes, and snippets.

import urllib2
from bs4 import BeautifulSoup
header = open("header.html").read() # Arquivo com a cabeca do arquivo
footer = open("footer.html").read() # Arquivo com o pe do arquivo
paginas = urllib2.urlopen("http://www.rtm.net.br/institucional/imprensa/noticias.asp") # Url com a lista de noticias
soup = BeautifulSoup(paginas)
soup = soup.select(".post_cont h3 a") # Busca por links dentro de h3
/* Processing code for this example */
// Graphing sketch
// This program takes ASCII-encoded strings
// from the serial port at 9600 baud and graphs them. It expects values in the
// range 0 to 1023, followed by a newline, or newline and carriage return
// Created 20 Apr 2005
/*
JoystickDuino
*/
int cima = 1;
int baixo = 2;
int esq = 3;
int dir = 4;
int soco_baixo = 5;
int soco_medio = 6;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>APIs - Hackathon SESI Cultura Digital</title>
<style type="text/css">
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #222;
//Define variaveis para os botaos
int b1 = 0;
int b2 = 0;
int b3 = 0;
int b4 = 0;
int b5 = 0;
int b6 = 0;
int cima = 0;
int baixo = 0;
@pmarkun
pmarkun / pega-letra.sh
Created March 11, 2015 12:59
Pega letras do Vagalume
#!/bin/bash
if [ $# -lt 2 ]
then
echo 'Uso: pega-letra "Nome do Cantor" "Música"' >&2
exit 1
fi
echo "Artista:" $1
import turtle
def floor(x,y):
if x > y:
return x
return y
def draw_fern(length1, angle1, length2, angle2, depth):
flip = 1
for i in range (0, length2):
# -*- coding: utf-8 -*-
from random import random, randint
class Monstro:
'''Classe do Jogador'''
def __init__(self,nome, ataque, defesa, hp, level):
self.nome = nome
self.ataque = ataque
self.defesa = defesa
self.max_hp = hp
# -*- coding: utf-8 -*-
from xgoogle.search import GoogleSearch, SearchError
import time
import urllib2
from lxml.html import parse
url = "http://projetosdelei.com.br/setor/agricult.shtml"
{
"098": {
"orgaos": {
"201098": "Prefeitura Municipal de Junco do Serid\u00c3\u00b3",
"601098": "Fundo Municipal de Sa\u00c3\u00bade de Junco do Serid\u00c3\u00b3",
"101098": "C\u00c3\u00a2mara Municipal de Junco do Serid\u00c3\u00b3"
},
"nome": "Junco do Serid\u00f3"
},
"099": {