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 lxml.html | |
import re | |
src = """ | |
lksjdfls <div id ='amazon_345343'> kdjff lsdfs </div> sdjfls <div id | |
= "amazon_35343433">sdfsd</div><div id='amazon_8898'>welcome</div> | |
hello, my age is 86 years old and I was born in 1945. Do you know | |
that | |
PI is roughly 3.1443534534534534534 """ |
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
sandbox$ python test_abi.py | |
INFO:root:opening from cache | |
20100107183014 MAS proclama al compadre Guillermo Mendoza como candidato a concejal de La Paz | |
20100107091921 El sucre empezará a circular para finales de enero en el ALBA | |
20100107114353 Prefectura de Cochabamba seguirá procesos a colaboradores de Reyes Villa implicados en corrupción | |
20100107193810 Illanes demanda a Dips por cohecho activo y exige que demuestre sus acusaciones | |
20100107100743 Misión china inspeccionará base de operaciones del satélite Tupac Katari | |
20100107184303 Ávalos afirma que prefectos opositores ayudaron a Reyes Villa a salir del país y escaparán igual luego de comicios | |
20100107135740 Canciller peruano hace votos por mejoramiento de relaciones con Bolivia | |
20100107173630 Anuncian sanciones económicas y administrativas a colegios privados que cobren más de 10 pensiones |
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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv1J9PYmP8hCXqXgCbxJMEo3HRdPhjSqxaJsgZZUzX0PNbzBVQ7sxPd+O98HHyObBkxKNMYFPx7K7Ka1rzXhKVC5aL/kMzt6cBu4K4BgdEbkwup41W7vd6WCku2xkRZpIkdPCtOOTPiFUUyDYHkC/MUF+50DCu41nshbWli8jCLtbDHgNimAikhHogf84XzPjQ/QNGO+fX3K/4FGdsCkDpLx5J7jz3bYeqEuboea/0HZHPkTdMEj0Zejg0rzwYZHYkSv4r8sD12tOUKSa7YVu7C/tKL90CG71+j+eTTnf3K+DPWpi+SO71eRqneDKcQLQxlQ6nvyPwmNQ9Ro0Ny+G5w== [email protected] |
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
def my_extractor(...): | |
pass | |
class MySpider(CrawlSpider): | |
domain_name = 'domain.com' | |
start_urls = ['http://www.domain.com/'] | |
link_extractors = ( | |
(my_extractor,), | |
) |
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 unittest | |
from scrapy.contrib_exp.spiders.url import UrlSpider, UrlMatcher | |
from scrapy.contrib_exp.url.extractor import SgmlUrlExtractor | |
from scrapy.http import HtmlResponse, Request | |
def test_callable(response): | |
pass |
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
def test_callable(response): | |
pass | |
def capitalize_urls(urls): | |
for url in urls: | |
yield url.upper() | |
class TesSpider(UrlSpider): |
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
rho@ubuntuhh:~/projects/nodejs/twitter-node$ node stream.js | |
DEBUG: GET /1/statuses/sample.json | |
DEBUG: Tweet Rate: 0.0 tweet/sec | |
DEBUG: Memory Usage: 5.55M | |
DEBUG: Tweet Rate: 9.0 tweet/sec | |
DEBUG: Memory Usage: 6.22M | |
DEBUG: Tweet Rate: 8.2 tweet/sec | |
DEBUG: Memory Usage: 6.87M | |
DEBUG: Tweet Rate: 8.2 tweet/sec | |
DEBUG: Memory Usage: 7.55M |
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 TwitterNode = require('./lib').TwitterNode; | |
var sys = require('sys'); | |
var twit = new TwitterNode({ | |
user: 'tuitersbolivia' | |
, password: 'asdf' | |
}); | |
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 sys = require('sys'), | |
http = require('http'), | |
b64 = require('./base64'), | |
query = require('querystring') | |
// Creates a streaming connection with twitter, and pushes any incoming | |
// statuses to a tweet event. | |
var TwitterNode = exports.TwitterNode = function(options) { | |
if(!options) options = {} | |
this.port = options.port || 80 |
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 tcp = require('tcp'); | |
var sys = require('sys'); | |
var count = 0; | |
var connected_callback = function(conn, name) { | |
return function() { | |
count++; | |
sys.debug("Connected " + name); | |
conn.send("GET / HTTP/1.1\r\n"); |