This file contains hidden or 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 gevent | |
from gevent import monkey; monkey.patch_all() | |
from gevent import pool | |
import random | |
from time import sleep, time | |
import urllib2 | |
POOL_SIZE = 5 |
This file contains hidden or 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 django.contrib.auth.backends import ModelBackend | |
from django.contrib.auth.models import User | |
class EmailorUsernameBackend(ModelBackend): | |
""" | |
Authenticate given a users email or user name. | |
Does a double look up on email and user name but would rather | |
call super for ModelBackend to keep up with any changes. | |
put the following in your settings.py |
This file contains hidden or 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 urllib2 | |
from time import sleep | |
from datetime import datetime | |
from subprocess import Popen | |
PRODUCT_URL = "http://content.newegg.com/LandingPage/ItemInfo4ProductDetail.aspx?Item=N82E16834158004" | |
def check(): | |
""" | |
Check product url and look for 'Out of Stock' in the specified xpath. |
This file contains hidden or 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 urllib2 | |
from lxml import html | |
from time import sleep | |
from datetime import datetime | |
from subprocess import Popen | |
PRODUCT_URL = "http://www.shopping.hp.com/store/product/product_detail/FB355UA%2523ABA?jumpid=se_r1002_fp_usen_hho" | |
def check(): | |
""" |
NewerOlder