Skip to content

Instantly share code, notes, and snippets.

@sousatg
sousatg / TwitterBird,py
Created February 13, 2016 17:45
Twitter private API wrapper class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests, time
from lxml import etree
class TwitterHammer:
def __init__(self, username, password):
self.username = username
self.password = password
@sousatg
sousatg / hilo.hs
Created February 12, 2016 17:58
The game of HILO coded in haskell
module Hilo where
import System.Random as R
jogo :: Int -> Int -> IO Int
jogo n x = do
putStr "Tentativa? "
str <- getLine
let y = read str
if y == x then
from selenium import webdriver
url = 'http://betaalbare-website.be'
b = webdriver.Firefox()
b.get( url )
resolutions = [(1024, 768), (1920, 1080), (1366, 768), (1280, 800), (1024, 768), (800, 600)]
for largura, altura in resolutions:
output_name = 'ticked_' + str(largura) + 'x' + str(altura) + '.png'
from splinter import Browser
from lxml import etree
import json
# recebe um objecto etree e devolve uma string com codigo html
def get_page_posts(article):
article_text = article.xpath('.//div[contains(@class, "userContent")]')[0]
a = etree.tostring(article_text, pretty_print=True).encode('utf-8')
return a
@sousatg
sousatg / ahoy_api
Created January 3, 2016 02:49
API developed with Flask to retrive a list of proxy address and their connections.
from flask import Flask, jsonify
from lxml import etree
from urllib3 import PoolManager
import time
app = Flask(__name__)
def parseProxyString(proxyString):
keys = ["address", "port"]
values = proxyString.split(':')