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
# | |
# Print entire HTML text after processed JavaScript | |
# | |
# usage: | |
# /usr/bin/xvfb-run python getbodytext.py test.html | |
# | |
# libs: | |
# - pygtk: http://www.pygtk.org/ | |
# - pywebkitgtk(python-webkit): http://code.google.com/p/pywebkitgtk/ | |
# - jswebkit: http://code.google.com/p/pywebkitgtk/issues/detail?id=28#c9 |
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
/* | |
* Print entire HTML text after processed JavaScript | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0` | |
* gcc -Wall $FLAGS getbodytext.c -o getbodytext | |
* | |
* usage: | |
* /usr/bin/xvfb-run ./getbodytext test.html | |
* |
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
# | |
# Get web page screenshot | |
# | |
# usage: | |
# xvfb-run -s "-screen 0 1024x768x24" python getschreenshot.py test.html | |
# | |
# libs: | |
# - pygtk: http://www.pygtk.org/ | |
# - pywebkitgtk(python-webkit): http://code.google.com/p/pywebkitgtk/ | |
# - PIL: http://www.pythonware.com/products/pil/ |
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
/* | |
* Print entire HTML text after processed JavaScript | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0` | |
* gcc -Wall $FLAGS -lgc getbodytext_gc.c -o getbodytext_gc | |
* | |
* usage: | |
* /usr/bin/xvfb-run ./getbodytext test.html | |
* |
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
/* | |
* get screenshot PNG from web page | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0` | |
* gcc -Wall $FLAGS getscreenshot.c -o getscreenshot | |
* | |
* usage: | |
* /usr/bin/xvfb-run -s "-screen 0 1024x768x24" ./getscreenshot test.html | |
* |
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
/* make PNG thumbnail by gegl: http://gegl.org/ | |
* | |
* build: | |
* gcc -Wall `pkg-config --cflags --libs gegl` geglthumbnail.c -o geglthumbnail | |
* | |
* usage: | |
* ./geglthumbnail image.xxx thumbnail.png | |
* | |
*/ | |
#include <glib.h> |
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
/* | |
* get screenshot PNG from web page | |
* | |
* build: | |
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 webkit-1.0 gegl` | |
* gcc -Wall $FLAGS getscreenshot_gegl.c -o getscreenshot_gegl | |
* | |
* usage: | |
* xvfb-run -s "-screen 0 1024x768x24" ./getscreenshot_gegl test.html | |
* |
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
/* list operations by gegl: http://gegl.org/ | |
* | |
* build: | |
* gcc -Wall `pkg-config --cflags --libs gegl` geglops.c -o geglops | |
* | |
* usage: | |
* ./geglops | |
*/ | |
#include <glib.h> | |
#include <glib-object.h> |
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 | |
""" | |
web page screenshot by webkit | |
command usage: | |
python webkitscreenshot.py test.html | |
library usage: | |
import webkitscreenshot | |
image = webkitscreenshot.screenshot_vfb("file://test.html") |
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 sys | |
class Engine(object): | |
"""Brainf**k interpreter. | |
usage: | |
bf = Engine() | |
bf("++++++++++++++.") | |
""" | |
def __init__(self): | |
self.insts = { |
OlderNewer