Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yutaka Matsubara mopemope

🏠
Working from home
View GitHub Profile
View gist:65536
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)
View gist:65537
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)
View gist:65538
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)
View gist:65539
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)
View gist:65540
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)
View gist:196450
import timeit
from cStringIO import StringIO
x1 = xrange(1000)
x2 = xrange(10000)
smallbuf = "buffer"
bigbuf = "buffer" * 1024
def str_join1000(buf):
View benchmatk
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/
View empflix.py
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',
]
View simple
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]
View empflix.py
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 = [
You can’t perform that action at this time.