Skip to content

Instantly share code, notes, and snippets.

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

Yutaka Matsubara mopemope

🏠
Working from home
View GitHub Profile
from twisted.web import client
from twisted.internet import reactor, defer
from lxml import etree
from StringIO import StringIO
import re
import os
save_dir = "~/.video/jizzhut/"
base_url = "http://jizzhut.com"
download_re = re.compile('so.addVariable\("content_video",\s*"([\w\d.:/_]*)"\);', re.M)
from twisted.web import client
from twisted.internet import reactor, defer
from lxml import etree
from StringIO import StringIO
import re
import os
save_dir = "~/.video/pornzapp/"
base_url = "http://www.pornzapp.com"
download_re = re.compile('"/js/interface.php\?id=([\w\d.:/_]*)"', re.M)
from twisted.web import client
from twisted.internet import reactor, defer
from lxml import etree
from StringIO import StringIO
import re
import os
save_dir = "~/.video/tube8/"
base_url = "http://www.tube8.com"
download_re = re.compile("so.addVariable\('videoUrl',\s*'([\w\d.:/_]*)'\);", re.M)
from twisted.web import client
from twisted.internet import reactor, defer
from lxml import etree
from StringIO import StringIO
import re
import os
save_dir = "~/.video/xhamster/"
base_url = "http://www.xhamster.com"
download_re = re.compile("so.addVariable\('file',\s*'([\w\d\.:/_\-\?=]*)'\);", re.M)
from twisted.web import client
from twisted.internet import reactor, defer
from lxml import etree
from StringIO import StringIO
import re
import os
save_dir = "~/.video/xnxx/"
base_url = "http://video.xnxx.com"
download_re = re.compile("so.addVariable\('flv_url',\s*'([\w\d.:/_]*)'\);", re.M)
import timeit
from cStringIO import StringIO
x1 = xrange(1000)
x2 = xrange(10000)
smallbuf = "buffer"
bigbuf = "buffer" * 1024
def str_join1000(buf):
simple benchmark
http://github.com/mopemope/meinheld/tree/master/bench/hello/
result:
ma2@xxxx:11:51:ab -c 100 -n 10000 http://192.168.2.10:8000/ ~
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
from os import path
from werkzeug import secure_filename
import eventlet
from eventlet.green import urllib2
from pyquery import PyQuery as pq
from urlparse import urlparse
search_urls = [
'http://www.empflix.com/browsecat.php?page=%s&chid=17&category=rd',
]
from meinheld import server
def hello_world(environ, start_response):
status = '200 OK'
res = "Hello world!"
response_headers = [('Content-type','text/plain')]
start_response(status, response_headers)
print environ
print environ["QUERY_STRING"]
return [res]
from os import path
from werkzeug import secure_filename
import eventlet
from eventlet.green import urllib2
from pyquery import PyQuery as pq
from urlparse import urlparse
import psyco
psyco.full()
search_urls = [