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
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(':') |
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
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 | |
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
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' |
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
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 |
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
#!/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 |
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
#!/usr/bin/env/python | |
# -*- coding: utf-8 -*- | |
import requests | |
import uuid | |
import os | |
import csv | |
from lxml import etree | |
import time |
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
from splinter import Browser | |
import csv, time | |
class TwitterAccount: | |
def __init__(self, username, password): | |
self.username = username | |
self.password = password | |
self.b = Browser() |
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 random | |
n = int( random.random() * 100 ) | |
tentativas = 0 | |
while True: | |
a = raw_input('Numero entre 0 e 100: ') | |
if int(a) == n: |
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
var page = new WebPage(); | |
//spoof it as opera mini, to get the mobile page working properly | |
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10"; | |
function doLogin(){ | |
page.evaluate(function(){ | |
var frm = document.getElementById("login_form"); | |
frm.elements["email"].value = "--enter-your-email--"; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
class Reff: | |
def __init__(self, ent_id, subent_id, order_id, order_value): | |
self.ent_id = ent_id | |
self.subent_id = subent_id | |
self.order_id = '0000' + order_id | |
self.order_value = order_value | |
array = [3, 30, 9, 90, 27, 76, 81, 34, 49, 5, 50, 15, 53, 45, 62, 38, 89, 17, 73, 51] |
OlderNewer