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
# Python YouTube downloader | |
# 1. start script | |
# 2. copy youtube url into clipboard | |
# 3. press ctrl-d to start downloading | |
import sys | |
import pygtk | |
pygtk.require('2.0') | |
import gtk |
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
#!/bin/bash | |
if [ -n "$1" ]; then | |
TARGET="$1" | |
else | |
TARGET="." | |
fi | |
command="find $TARGET -name '*.pyc' 2>/dev/null" |
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
""" | |
Routed Crawler | |
""" | |
class Route(dict): | |
"""Spider route request""" | |
pass | |
class Router(scrapy.Spider): | |
"""Spider routing and loader handling""" |
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 | |
# usbreset -- send a USB port reset to a USB device | |
# | |
# http://askubuntu.com/questions/645#answer-661 | |
# | |
# $ sudo usbreset.py DUB | |
# Looking for device: DUB | |
# Executing command: `lsusb | grep DUB` | |
# Subprocess: b'Bus 001 Device 006: ID 2001:1a02 D-Link Corp. DUB-E100 Fast...' | |
# Found device 001 on bus 006 for "D-Link Corp. DUB-E100 Fast Ethernet Adapt..." |
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
# [PackageDev] target_format: plist, ext: tmLanguage | |
--- | |
name: Scrapy Log | |
scopeName: source.slog | |
fileTypes: [slog] | |
uuid: 030ae93f-5fcf-4bbd-8caa-81fcdcf77ec3 | |
patterns: | |
- comment: date-time [logger] level |
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
class MySpider(RouteSpider): | |
name = "example.com" | |
def start_routes(self, response): | |
for city in response.css('#location .dropdown-bg li'): | |
yield Route( | |
url=city.xpath('a/@href'), | |
callback=self.parse_city, |
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 | |
# Google Places Search | |
# | |
# Use the Google Places API to text search for the supplied keywords and output | |
# the first result to standard out. | |
import sys | |
import json | |
import argparse |
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
<?php | |
/** | |
* generic debug printer | |
* | |
* Because I didn't like having to pass two arguments to a debug printer, namely the | |
* evaluated and un-evaluated expressions, like: $baker->bread and "baker.bread", i.e., | |
* I only wanted to pass the un-evaluated string and let the print routine do the | |
* evaluating. This script does that proceduraly, i.e., not in a function, so expression | |
* scope is not changed. | |
* |
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 PyQt4.QtCore import QUrl | |
from PyQt4.QtGui import QApplication | |
from PyQt4.QtWebKit import QWebPage | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from scrapy.spider import BaseSpider | |
from scrapy.http import HtmlResponse | |
class Render(QWebPage): | |
def __init__(self, url): |
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
# main.py: | |
from project.spiders.log_test import TestSpider as EstiloMASpider | |
from scrapy.xlib.pydispatch import dispatcher | |
from scrapy.crawler import Crawler | |
from twisted.internet import reactor | |
from scrapy.utils.project import get_project_settings | |
from scrapy import log, signals |
OlderNewer